docker/README.md
The recommended way to use Docker for NVIDIA hardware is described here.
You can also run PyG with CUDA 12.1 inside a docker image. This method is deprecated and we highly recommend the above mentioned official NVIDIA docker containers instead.
The creation of our dockerfile refers to the dockerfiles provided by NVIDIA and PyTorch.
$ docker build -t "custom image name"$ docker run --rm -it --init --runtime=nvidia --ipc=host --network=host --volume=$PWD:/app -e NVIDIA_VISIBLE_DEVICES=0 "custom image name" /bin/bashIf you encounter any problems, please feel free to create a GitHub issue.
You can also run PyG with Intel GPU inside a docker image. The creation of our dockerfile refers to the dockerfiles provided by Intel and the installation guidance provided by Intel® Extension for PyTorch.
$ docker build -f docker/Dockerfile.xpu -t "custom image name"$ docker run --rm -it --ipc=host -v /dev/dri:/dev/dri --volume=$PWD:/app "custom image name" /bin/bashYou can run PyG inside a singularity image. An example singularity file can be found in this folder.
You might have to modify the script; depending on your needs, modify the following:
From: nvidia/cuda:10.1-cudnn7-devel-ubuntu16.04 to the corresponding tag from https://hub.docker.com/r/nvidia/cuda. Same if you want to use anything but Ubuntu 16.04. Your host has to have at least this cuda version!pyenv install 3.7.2 and the following lines to the corresponding version.pip install torch==1.3.0.pytorch_geometric requirements (scatter: 1.4.0, sparse: 0.4.3, cluster: 1.4.5, geometric 1.3.2). To change these, change the corresponding git checkout lines near the bottom./usr/local/cuda-10.1/extras/demo_suite/deviceQuery | grep 'CUDA Capability'; if not, check here.Note: If your harddisk runs full after multiple builds, this is known and apparently working as intended; delete the /tmp/sbuild-XXXXXXXXX files.
To build the container, run
sudo singularity build geometric.sif singularity
then wait. Once finished, you can run the GAT example in the folder you built the image in by calling
wget https://raw.githubusercontent.com/pyg-team/pytorch_geometric/master/examples/gat.py
(to download the sample),
then
singularity exec geometric.sif python3 gat.py
to run on the CPU, or
singularity exec --nv geometric.sif python3 gat.py
to run on the GPU.