nvdocker is library built on top of the docker-py python sdk to build and run docker containers using nvidia-docker.
pip install nvdocker
These variables are already set in NVIDIA's official CUDA images.
This variable controls which GPUs will be made accessible inside the container.
- Possible values:
GPU-fef8089b…: a comma-separated list of GPU UUID(s) or index(es),
all: all GPUs will be accessible, this is the default value in our container images,
none: no GPU will be accessible, but driver capabilities will be enabled.
voidor empty or unset:
nvidia-container-runtimewill have the same behavior as
This option controls which driver libraries/binaries will be mounted inside the container.
- Possible values
compute,video,graphics,utility…: a comma-separated list of driver features the container needs,
all: enable all available driver capabilities.
empty or unset: use default driver capability:
- Supported driver capabilities
compute: required for CUDA and OpenCL applications,
compat32: required for running 32-bit applications,
graphics: required for running OpenGL and Vulkan applications,
utility: required for using
video: required for using the Video Codec SDK.
A logical expression to define constraints on the configurations supported by the container.
- Supported constraints
cuda: constraint on the CUDA driver version,
driver: constraint on the driver version,
arch: constraint on the compute architectures of the selected GPUs.
reware ANDed together.
The version of the CUDA toolkit used by the container. If the version of the NVIDIA driver is insufficient to run this version of CUDA, the container will not be started.
cuda>=9.0…: any valid CUDA version in the form
NVIDIA_REQUIRE_CUDA, for legacy CUDA images.
NVIDIA_REQUIRE_CUDAis not set,
NVIDIA_DRIVER_CAPABILITIESwill default to
Single switch to disable all the constraints of the form
Copyright and License
This project is released under the UIUC/NCSA License.
docker-py is licensed under the Apache License
nvidia-docker and nvidia-container-runtime are licensed under the BSD 3-clause license.