A docker image that comes with common packages for science, especially for machine learning with Nvidia + CUDA.
- tensorflow
- keras
- numpy
- matplotlib
- h5py
- cmcrameri
- scipy
- seaborn
- pyyaml
- tqdm
- ipython
- ipykernel
- jupyterlab
- docker
- docker-compose (optional)
- nvidia-container-toolkit configured for docker
$ nvidia-ctk runtime configure --runtime=docker
$ sudo systemctl restart docker
$ git pull github.com/mstcl/pycde
$ cd pycde
$ docker compose up -d --build
You can change the bind mount inside docker-compose.yml
to mount your project
folder.
If you want to use standalone Docker instead:
$ docker build -t pycde
$ docker run -p 127.0.0.1:8888:8888 -v /srv/projects:/projects --restart unless-stopped --security-opt=no-new-privileges --log-opt max-size=1g --gpus 1 pycde
- ipykernel
- ipython
$ python -m ipykernel install --user --name=docker
Then edit ~/.local/share/jupyter/kernels/docker/kernel.json
to look something
like (also in examples/kernel.json ):
{
"argv": [
"/usr/bin/docker",
"run",
"--rm",
"--network=host",
"--gpus",
"all",
"-v",
"{connection_file}:/connection-spec",
"-v",
"/projects:/project",
"pycde-pycde",
"python",
"-m",
"ipykernel_launcher",
"-f",
"/connection-spec"
],
"display_name": "docker",
"language": "python"
}
In VSCode, Jupyter Lab, or whatever, you can select the "docker" kernel instead.