This lesson is being piloted (Beta version)

Using Jupyter Lab in SuperPOD

Overview

Teaching: 20 min
Exercises: 0 min
Questions
  • How to use Jupter Lab in SuperPOD?

Objectives
  • Learn port forwarding technique to enable Jupter Lab

4. Jupter Lab on SuperPOD

$ ssh -C -D 8000 username@superpod.smu.edu

The C stands for Compression and D stands for Dynamic port-forwarding with SOCKS4/5 to port number 8000. Feel free to change the port and remember to set it up in your browser

4.1 Setup browser to enable proxy viewing (similar for MacOS/Linux as well)

4.1.1 Using Firefox as browser:

Open Firefox, my version is 104.0.2. Use combination Alt+T+S to open up the settings tab. Scroll to bottom and select Settings from Network Settings:

image

4.1.2 Using Chrome/Safari as browser:

Search for proxies and set a Socks proxy with sever localhost and port 8000. image

4.2 Test Proxy

4.2.1. Test Proxy using conda environment:

Go back to MobaXTerm and login into SuperPOD using regular SSH Request a compute node

$ srun -N1 -G1 -c10 --mem=64G --time=12:00:00 --pty $SHELL

Load cuda, cudnn and activate any of your conda environment, for example Tensorflow_2.9 in the home directory

$ module load conda gcc; module load cuda; module load cudnn
$ conda activate ~/tensorflow_2.9   

Make sure to install jupyter

$ pip install jupyterlab

Next insert the following command:

$ jupyter notebook --ip=0.0.0.0 --no-browser
# or
$ jupyter lab --ip=0.0.0.0 --no-browser   

The following screen appears

image

Copy the highlighted URLs to Firefox, you will see Jupyter Notebook port forward to this:

image

Select TensorflowGPU29 kernel notebook and Check GPU device:

image

4.2.2. Test Proxy using docker container:

For docker container, the command line need to have 1 additional flag:

$ jupyter lab --ip=0.0.0.0 --no-browser --allow-root

You will need to replace the hostname to the name of the node that you are having:

image

For example in the previous command, you need to copy and paste the following line to Firefox browser:

$ http://bcm-dgxa100-0016:8888/?token=daefb1c3e2754b37b6b94b619387cb3fd9710608e0152182 

Troubleshoot for notebook requesting password

In certain case, your Jupyter Notebook requires password to be enable, you can setup the password using the command below prior to requesting jupyter lab instance:

$ jupyter notebook password   

In case changing password do not help, it might be the case that the forwarded port has some problems. In that case you should either:

(1) change the default port 8888 to other (8889 for example), or
(2) change the localhost port when you first login to SuperPOD 8000 in this case to other local port (5000 for example)

Key Points

  • Jupter Lab, Port-Forwarding