- Python3 with a preference for conda, and python version
3.8(higher versions might work, but they are untested).
- Knowledge of managing Python environments. The instructions below assume knowledge of the conda management system.
- GPU compute (usually needed for faster training):
- Windows: Microsoft Visual C++ 14.0 or greater. This is required for PyTorch to work on Windows. If you are using conda, you can install it using the following command for your virtual environment:
conda install -c anaconda m2w64-toolchain.
GaNDLF's primary computational foundation is built on PyTorch, and as such it supports all hardware types that PyTorch supports. Please install PyTorch for your hardware type before installing GaNDLF. See the PyTorch installation instructions for more details. An example installation using CUDA, ROCm, and CPU-only is shown below:
(base) $> conda create -n venv_gandlf python=3.8 -y (base) $> conda activate venv_gandlf (venv_gandlf) $> ### subsequent commands go here ### PyTorch installation - https://pytorch.org/get-started/previous-versions/#v1131 ## CUDA 11.6 # (venv_gandlf) $> pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116 ## ROCm # (venv_gandlf) $> pip install torch==1.13.1+rocm5.2 torchvision==0.14.1+rocm5.2 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/rocm5.2 ## CPU-only # (venv_gandlf) $> pip install torch==1.13.1+cpu torchvision==0.14.1+cpu torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cpu
The following dependencies are optional, and are needed for specific features of GaNDLF.
Install from Package Managers¶
This option is recommended for most users, and allows for the quickest way to get started with GaNDLF.
If you are interested in running the latest version of GaNDLF, you can install the nightly build by running the following command:
Install from Sources¶
Use this option if you want to contribute to GaNDLF, or are interested to make other code-level changes for your own use.
We provide containerized versions of GaNDLF, which allows you to run GaNDLF without worrying about installation steps or dependencies.
Steps to run the Docker version of GaNDLF¶
- Install the Docker Engine for your platform.
- GaNDLF is available from GitHub Package Registry. Several platform versions are available, including support for CUDA, ROCm, and CPU-only. Choose the one that best matches your system and drivers. For example, if you want to get the bleeding-edge GaNDLF version, and you have CUDA Toolkit v11.6, run the following command:
This will download the GaNDLF image onto your machine. See the usage page for details on how to run GaNDLF in this "dockerized" form.
Enable GPU usage from Docker (optional, Linux only)¶
In order for "dockerized" GaNDLF to use your GPU, several steps are needed:
- Ensure sure that you have correct NVIDIA drivers for your GPU.
- Then, on Linux, follow the instructions to set up the NVIDIA Container Toolkit.
- This can be replicated for ROCm for AMD , by following the instructions to set up the ROCm Container Toolkit.
On Windows, GPU and CUDA support requires either Windows 11, or (on Windows 10) to be registered for the Windows Insider program. If you meet those requirements and have current NVIDIA drivers, GPU support for Docker should work automatically. Otherwise, please try updating your Docker Desktop version.
Note: We cannot provide support for the Windows Insider program or for Docker Desktop itself.
Building your own GaNDLF Docker Image¶
You may also build a Docker image of GaNDLF from the source repository. Just specify the
Dockerfile for your preferred GPU-compute platform (or CPU):