Devito docker image library
In order to facilitate the dissemination, usage, and development of Devito, we provide a series of docker images. These images support numerous architectures and compilers and are tagged accordingly. In the following, we describe the available images and the workflow to build it yourself. You can find all the available images at DevitoHub.
Devito images
Devito provides three main images that are targeting different architectures and/or using different compilers. In the following, all images are described as imagename-*
. The *
corresponds to, and should be swapped for, the different release tags dev
, latest
or vx.x.x
depending on if you are interested in specific versions (vx.x.x
), the latest stable release(latest
), or the latest development status (dev
)
Devito on CPU
We provide two CPU images:
devito:gcc-*
with the standard GNU gcc compiler.devito:icc-*
with the intel C compiler for intel architectures.
these base images provide a working Devito environment for any CPU architecture and come with Devito, gcc/icc
and mpi
preinstalled as well as utilities such as jupyter
for usability and exploration of the package.
To run this image locally, you will need docker
to be installed. Once available, the following commands will get you started:
docker run --rm -it -p 8888:8888 -p 8787:8787 -p 8786:8786 devitocodes/devito:gcc-latest
docker run --rm -it -p 8888:8888 -p 8787:8787 -p 8786:8786 --device=/dev/infiniband/uverbs0 --device=/dev/infiniband/rdma_cm devitocodes/devito:gcc-latest
or to run in user context on a cluster with shared filesystem, you can add the correct user config as docker options e.g.:
docker run --rm -it -v `pwd`:`pwd` -w `pwd` -u $(id -u):$(id -g) devitocodes/devito:gcc-latest python examples/seismic/acoustic/acoustic_example.py
Notes: In addition, the following legacy tags are available:
devito:cpu-*
that corresponds todevito:gcc-*
Devito on GPU
Second, we provide three types of images to run Devito on GPUs. These two images are tagged devito:nvidia-nvc-*
, devito:nvidia-clang-*
, and devito:amd-*
.
devito:nvidia-nvc-*
is intended to be used on NVIDIA GPUs. It comes with the configuration to use thenvc
compiler foropenacc
offloading. This image also comes with cuda-aware MPI for multi-gpu deployment.devito:nvidia-clang-*
is intended to be used on NVIDIA GPUs. It comes with the configuration to use theclang
compiler foropenmp
offloading. This image also comes with cuda-aware MPI for multi-gpu deployment.devito:amd-*
is intended to be used on AMD GPUs. It comes with the configuration to use theaoompcc
compiler foropenmp
offloading. This image also comes with gpu-aware MPI for multi-gpu deployment. Additionally, this image can be used on AMD CPUs as well since the Rocm compiler are preinstalled. You will need to modifyDEVITO_PLATFORM
to `` at runtime to reflect this architecture.
To run the NVIDIA GPU version, you will need [nvidia-docker] installed and specify the gpu to be used at runtime. See for examples a few runtime commands for the NVIDIA nvc
images.
docker run --gpus all --rm -it -p 8888:8888 -p 8787:8787 -p 8786:8786 devitocodes/devito:nvidia-nvc-latest
docker run --gpus all --rm -it devitocodes/devito:nvidia-nvc-latest python examples/seismic/acoustic/acoustic_example.py
docker run --gpus all --rm -it -p 8888:8888 -p 8787:8787 -p 8786:8786 --device=/dev/infiniband/uverbs0 --device=/dev/infiniband/rdma_cm devitocodes/devito:nvidia-nvc-latest
or to run in user context on a cluster with shared filesystem, you can add the correct user config as docker options e.g.:
docker run --gpus all --rm -it -v `pwd`:`pwd` -w `pwd` -u $(id -u):$(id -g) devitocodes/devito:nvidia-nvc-latest python examples/seismic/acoustic/acoustic_example.py
Unlike NVIDIA, AMD does not require an additional docker setup and runs with the standard docker. You will however need to pass some flags so that the image is linked to the GPU devices. You can find a short walkthrough in these AMD notes for their tensorflow GPU docker image.
Notes: In addition, the following legacy tags are available:
devito:gpu-*
that corresponds todevito:nvidia-nvc-*
Build a Devito image
To build the images yourself, all you need is to run the standard build command using the provided Dockerfile. The main difference between the CPU and GPU images will be the base image that will be used.
To build the (default) CPU image, simply run:
docker build --network=host --file docker/Dockerfile.devito --tag devito .
And to build the GPU image with openacc
offloading and the nvc
compiler, simply run:
docker build --build-arg base=devitocodes/base:nvidia-nvc --network=host --file docker/Dockerfile.devito --tag devito .
or if you wish to use the llvm-15
(clang) compiler with openmp
offlaoding:
docker build --build-arg base=devitocodes/base:nvidia-clang --network=host --file docker/Dockerfile --tag devito .
and finally for amd architectures:
docker build --build-arg base=devitocodes/base:amd --network=host --file docker/Dockerfile --tag devito .