Important
We are no longer actively maintaining this repository. All active work by the Allen Institute for Cell Science is located under the AllenCell organization.
Creates a docker image for running PyTorch on NVIDIA GPUs with Jupyter notebook support
-
There's a "regular" dockerfile in the
jupytersubdirectory. It adds useful python libraries to the pytorch docker image. This is sort of our "base" image. -
There are "fancy" versions in the
jupyter_Randjupyter_R_juliasubdirectories, which also have R and Julia installed and set up to work with Jupyter. Thejupyter_Rversion is built off of thejupyterimage, andjupyter_R_juliais built off ofjupyter_R. -
If you just want to run things and not build them yourself, use
docker pull rorydm/pytoch_extras:<tag>where<tag>is (say)jupyter_R_juliato pull the prebuilt images from docker hub. -
To build any of the images yourself, from the main directory use
bash build_dockerfile.sh <subdir_name>. -
Run any of them from the main directory by using
bash run_docker_image.sh <subdir_name> <port>, where<port>is the port you're forwarding out of the docker container, e.g. 9699.
-
On an Ubuntu system (e.g. aws) install current nvidia drivers:
sudo add-apt-repository ppa:graphics-drivers/ppasudo apt-get update && sudo apt-get install nvidia-390
-
Install nvida docker (and docker): https://github.com/NVIDIA/nvidia-docker
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.listsudo apt-get updatesudo apt-get install -y nvidia-docker2sudo pkill -SIGHUP dockerd
-
Install pytorch on docker: https://github.com/pytorch/pytorch
git clone https://github.com/pytorch/pytorch.gitcd pytorch && docker build -t rorydm/pytorch:master .
-
Clone this repo next to the pytorch one and run the build script
bash build_dockerfile.sh jupyterto first build the minimally extended versionbash build_dockerfile.sh jupyter_Rto next build the version with Rbash build_dockerfile.sh jupyter_R_juliato next build the version with R and Julia
-
To run and start a jupyter server (maybe start a screen session first), from this directory:
bash run_docker_image.sh <subdir_name> <port>
-
To enter the running docker container:
docker exec -it <container_name> bash
Note: the terminal inside docker sometimes acts funny. using the following seems to help:
docker exec -t <container_name> /bin/bash -c "export COLUMNS=tput cols; export LINES=tput lines; exec bash"