appendix B Installing and configuring PyTorch Geometric
B.1 Installing PyTorch Geometric
PyTorch Geometric (PyG) is a library built on top of PyTorch for working with graph neural networks (GNNs). The newest pytorch geometric versions can be installed with: pip install torch_geometric. Only PyTorch is needed as a dependency. To install PyG with its extensions, you need to ensure that you have the correct versions of Compute Unified Device Architecture (CUDA), PyTorch, and PyG installed and compatible with each other.
B.1.1 On Windows/Linux
- Install PyTorch. First, install the appropriate version of PyTorch for your system. You can find the instructions on the official PyTorch website (https://pytorch.org/get-started/locally/). Make sure to select the correct CUDA version if you have an NVIDIA GPU.
- Find the PyTorch CUDA version. After installing PyTorch, check its version and the CUDA version it was built with by running the following from Python:
import torch print(torch.__version__) print(torch.version.cuda)
This can also be run from the command line as follows:
!python -c "import torch; print(torch.__version__)" !python -c "import torch; print(torch.version.cuda)"
The outputs from this code will be used in the next step.
- Install PyG dependencies. Install the PyG dependencies (
torch-scatter
,torch-sparse
,torch-cluster
,torch-spline-conv
) from the PyG repository, specifying the correct CUDA version: