Jupyter Notebooks

From the login node, launch an interactive session on a compute node. For example, to request one core and one GPU during 5 hours on the gpu queue:

srun -A your_slurm_account -p gpu --gres=gpu:1 -t 05:00:00 --pty bash -i

Create a conda environment including jupyter and activate it:

module load miniconda
conda create -n jupyter_env python=3.8 jupyter
source activate jupyter_env

If you need to install other Python packages, you can do it this way:

conda install package_name

If you need to load some of the cluster modules, do it with:

module load module_name

Pick a free port (here 10002, the value should be between 1025 and 60000) and set the SSH redirection:

export myport=10002
echo "ssh -NL $myport:$(hostname):$myport $USER@login-hpc.univ-cotedazur.fr"

Copy the output of this command.

Launch Jupyter :

jupyter-notebook --no-browser --port=$myport --ip='0.0.0.0'

In a second terminal, execute the previously copied command, it should look like:

ssh -NL 10002:gpu01:10002 user1@login-hpc.univ-cotedazur.fr

Nothing happens after a successful connection.

Open a web browser and paste the URL written in the first terminal, the one that starts with 127.0.0.1. For example:

Jupyter Notebook 6.4.11 is running at:
http://127.0.0.1:10002/?token=fd205eb91399103f95d1bc80d0400bf0536442810ba3df1a

To end the Jupyter session: CTRL-C twice in your terminal.

To deactivate your Python environment: conda deactivate

To quit the interactive session: exit