Sunday, March 3, 2019

Docker containers with NVIDIA GPUs using nvidia-docker


nvidia-gpu-docker

These are the installation instructions for Ubuntu:



Test the installation running
$ docker run --runtime=nvidia --rm nvidia/cuda:latest nvidia-smi
 or the equivalent nvidia-docker wrapper call
$ nvidia-docker run --rm nvidia/cuda:latest nvidia-smi

The wrapper allows to easily select which of the host's GPUs are visible from the docker instance, in this example only the first two GPUs
$ NV_GPU=0,1 nvidia-docker run --rm -v /home/foo/data:/data -it nvidia/cuda:latest bash

No comments:

Post a Comment