PGAP 2023 Software

Software installation for GPU course

Software installation.

To actively participate in this course, you need the following software:

  • NVIDIA CUDA drivers
  • NVIDIA CUDA toolkit
  • Anaconda / miniconda

Installation instructions for Ubuntu:

  1. Install CUDA drivers and toolkit. The following should be sufficient:
sudo apt-get update
sudo apt-get -y install nvidia-cuda-toolkit
  1. Then continue to install Anaconda by following the instructions here:

After these two are installed, you should be able to create a new conda environment. Start by downloading the following YML evironment file gpu_env.yml. In a terminal, execute the following:

conda env create --name gpu_env --file gpu_env.yml
conda activate gpu_env

You should now be able to run jupyter notebooks with pycuda. Try it out with

conda activate gpu_env

and a browser window with jupyter lab should appear.

Accessing jupyter on a remote server

Let us assume that we have an SSH server that has a GPU, and we want to access jupyterlab on that machine. The following is a recipe for that. Let us name the two machines laptop and gpu-server. The procedure can be listed as follows:

  1. SSH to gpu-server as usual. Open a terminal, and ssh to the server:
ssh username@gpu-server
  1. Start jupyterlab (without browser). In the same terminal, start jupyterlab:
jupyter lab --no-browser

Make a note of the port that jupyterlab starts on and the token. You will need it for the next point. They have the following format:

  1. Open ssh tunnel which connects a port on laptop with the jupyterlab port on gpu-server. In a new terminal, execute the following:
ssh -L 8000:localhost:8888 gpu-server

In this command, you need to replace 8888 with the port number from jupyterlab in the previous point.

  1. Open browser to interact with jupyterlab on the gpu-server. Open http://localhost:8000/lab?token=<TOKEN-CODE> in your browser, and you should be able to access jupyterlab. Make sure you replace <TOKEN-CODE> with what jupter lab wrote to the terminal in the step above.
Log In Page last modified on March 23, 2023, at 02:04 PM