Guide to operating SEACAS2023 Hackathon Notebook Offline: Difference between revisions

From Center for Integrated Circuits and Devices Research (CIDR)
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
=== Installing Jupyter ===
=== Installing Jupyter ===
From your Ubuntu terminal, run the following command
From your Ubuntu terminal, run the following command
<code>sudo apt-get update</code>


<code>sudo apt-get install jupyter</code>
<code>sudo apt-get install jupyter</code>
Line 26: Line 28:
This should automatically open a browser containing the notebook. Run it as you would the colab notebook.
This should automatically open a browser containing the notebook. Run it as you would the colab notebook.


== For Windows ==
== For Windows ==  
For Windows systems, Jupyter Notebook does not easily run without bugs. You may browse the internet for clues as how to make it work, if you want. My preferred way is to use VSCode's Jupyter extension instead.


=== WSL2 Installation ===
=== WSL2 Installation ===
Line 33: Line 34:


Detailed installation instructions can be found [https://learn.microsoft.com/en-us/windows/wsl/install here] in the Microsoft website. For a quickstart, run the following command in your command prompt.
Detailed installation instructions can be found [https://learn.microsoft.com/en-us/windows/wsl/install here] in the Microsoft website. For a quickstart, run the following command in your command prompt.
[[File:VSCode running ipynb.png|thumb|1000x1000px]]
 
<code>wsl --install</code>
<code>wsl --install</code>


Line 42: Line 43:
After this, you can enter Ubuntu by typing <code>wsl</code> in your command prompt.
After this, you can enter Ubuntu by typing <code>wsl</code> in your command prompt.


=== Installing VSCode with WSL2 & Jupyter Extensions ===
=== Option 1: Jupyter Notebook ===
To install Jupyter notebook, simply do
 
<code>sudo apt-get update</code>
 
<code>sudo apt-get install jupyter</code>
 
and then run
 
<code>jupyter notebook SEACAS_2023.ipynb</code>[[File:VSCode running ipynb.png|thumb|1000x1000px]]
 
=== Option 2: VSCode Jupyter Extension ===
For WSL systems, Jupyter Notebook may not easily run without bugs. You may browse the internet for clues as how to make it work, if you want (I made it work by downgrading/updating a few other packages).
 
My preferred way is to use VSCode's Jupyter extension instead.
 
==== Installing VSCode with WSL2 & Jupyter Extensions ====
First, [https://code.visualstudio.com/download download VScode] and open it.
First, [https://code.visualstudio.com/download download VScode] and open it.


Line 49: Line 66:
Search for the Remote Development extension and install it. Next, search for the Jupyter extension and install it.  
Search for the Remote Development extension and install it. Next, search for the Jupyter extension and install it.  


=== Running the notebook inside VSCode ===
==== Running the notebook inside VSCode ====
Open a new command prompt window and type WSL to enter Ubuntu terminal.  
Open a new command prompt window and type WSL to enter Ubuntu terminal.  
1. Go into WSL
2. sudo apt-get update
3. sudo apt-get install python3-pip
4. pip install -U ipykernel


From Ubuntu, navigate to the workspace you created earlier. For me, it is in <code>/mnt/c/Users/Lawrence/seacas2023</code>. Your C folder is in /mnt from inside WSL.
From Ubuntu, navigate to the workspace you created earlier. For me, it is in <code>/mnt/c/Users/Lawrence/seacas2023</code>. Your C folder is in /mnt from inside WSL.
Line 60: Line 85:
Finally, open the ipynb file from inside VScode and run it as you would from Colab.
Finally, open the ipynb file from inside VScode and run it as you would from Colab.


=== Note for Performance ===
==== Note for Performance ====
In order to make things run faster, I recommend transferring the workspace to a folder inside the WSL2 folders (not /mnt/c).  
In order to make things run faster, I recommend transferring the workspace to a folder inside the WSL2 folders (not /mnt/c).  



Latest revision as of 17:11, 14 September 2023

Clarification: In order to run the SEACAS2023 Hackathon Notebook Offline, you must run it once while online in order to download the dependencies of the notebook. After that, you may skip all parts that try to access apt-get or curl as those need internet.

First, make a new directory in your computer as your workspace. I recommend the name seacas2023

Next, download the SEACAS2023 Hackathon notebook by going to File > Download > .ipynb from inside the notebook and save it to this folder.

To run the .ipynb from your computer, you will need an Ubuntu environment.

For Ubuntu

For Ubuntu systems, Jupyter Notebook should work as intended

Installing Jupyter

From your Ubuntu terminal, run the following command

sudo apt-get update

sudo apt-get install jupyter

Once that is done, you will have the Jupyter notebook program in your PC.

Running the notebook

Change your directory to the workspace you created earlier. For me, it is /home/lawrence/seacas2023

Finally, run the following command:

jupyter notebook SEACAS_2023.ipynb

This should automatically open a browser containing the notebook. Run it as you would the colab notebook.

For Windows

WSL2 Installation

WSL stands for Windows Subsystem for Linux. It runs Ubuntu inside Windows so that you are able to run Linux commands.

Detailed installation instructions can be found here in the Microsoft website. For a quickstart, run the following command in your command prompt.

wsl --install

To make sure that your WSL is WSL2, run the following command:

wsl --set-version Ubuntu 2

After this, you can enter Ubuntu by typing wsl in your command prompt.

Option 1: Jupyter Notebook

To install Jupyter notebook, simply do

sudo apt-get update

sudo apt-get install jupyter

and then run

jupyter notebook SEACAS_2023.ipynb

VSCode running ipynb.png

Option 2: VSCode Jupyter Extension

For WSL systems, Jupyter Notebook may not easily run without bugs. You may browse the internet for clues as how to make it work, if you want (I made it work by downgrading/updating a few other packages).

My preferred way is to use VSCode's Jupyter extension instead.

Installing VSCode with WSL2 & Jupyter Extensions

First, download VScode and open it.

On the left side bar, you will see a button for "Extensions" which should be a 4-block icon. Alternatively, you can open it with CTRL + SHIFT + X.

Search for the Remote Development extension and install it. Next, search for the Jupyter extension and install it.

Running the notebook inside VSCode

Open a new command prompt window and type WSL to enter Ubuntu terminal.

1. Go into WSL

2. sudo apt-get update

3. sudo apt-get install python3-pip

4. pip install -U ipykernel

From Ubuntu, navigate to the workspace you created earlier. For me, it is in /mnt/c/Users/Lawrence/seacas2023. Your C folder is in /mnt from inside WSL.

Open this folder in VScode by typing code . inside the terminal.

The window should look like the picture provided.

Finally, open the ipynb file from inside VScode and run it as you would from Colab.

Note for Performance

In order to make things run faster, I recommend transferring the workspace to a folder inside the WSL2 folders (not /mnt/c).

To transfer files into WSL2, you may simply open Linux from inside your file explorer sidebar (by clicking the penguin icon on the sidebar containing This PC, Network, Linux).

Alternatively, you can navigate into this by putting \\wsl$ on the address bar of explorer.