Run Jupyter Server with GPU Access on HPCs
Last updated
Was this helpful?
Last updated
Was this helpful?
You can run a Jupyter notebook/lab server that has GPU access inside your container and connect to it from your local computer. The following steps describe the details:
ssh
connection with DGX or DLS as described in After completing the setup process, you should be able to connect to DGX or DLS with ssh
.
In your ssh config file, inside DGX and DLS environments, add the following line:
To avoid conflict with other people and other applications, the port number 56789 should be replaced by a port number in [49152, 65535]. The modified config file should be similar to this:
Add an additional -p
argument when starting your container:
Start your Jupyter notebook/lab server with:
or
To run the server in the background, so you can still do other things within your container, start the server with nohup
:
or
Notice the &
symbol at the end of the commands.
On your local machine, type localhost:56789
in your browser address bar and hit enter. If this is your first connection, you will see a page similar to:
You can find the token in your jupyter.log file. The token should look like this:
Copy and paste the token into the text bar and click log in. Now you should be able to enjoy the convenience of Jupyter notebook/lab on our DGX/DLS with the power of GPUs.
If you do not like the long token string, you can set up a password for your notebook. To do that, before starting the server, you need to create a config file for Jupyter:
then create a password:
Type in your password twice, then an encrypted password will be saved into the config file you created above. Now you can start the Jupyter server as in step 4. When you connect to the server started this way, the login page will only ask you for the password.