-
Install docker
-
Build container images
docker compose build shell
-
Setup the virtualenv
docker compose run --rm shell python -m venv .venv docker compose run --rm shell pip install --no-deps -r requirements.cpu.txt
-
Enable nbextensions
jupyter contrib nbextension install --sys-prefix
-
Run jupyter notebook
docker compose up notebook
-
Jupyter server should print out a link you can use to open the notebook, it should look like http://127.0.0.1:8888/?token=abcd1234...
-
Install and enable
nvidia-container-toolkit
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
-
Enable CUDA-specific compose overrides
ln -s ./docker-compose.cuda.yml ./docker-compose.override.yml
-
Rebuild container images
docker compose build shell
-
Recreate the virtualenv
rm -rf .venv docker compose run --rm shell python -m venv .venv docker compose run --rm shell pip install --no-deps -r requirements.cuda.txt
-
Check if everything worked
docker compose run --rm shell python -c \ 'import torch; print(f"CUDA available: {torch.cuda.is_available()}")'
should print out
CUDA available: True