0

I've looked up older answers on this which did not help (#1, #2)

I'm getting this error when trying to launch a docker-compose projcet with a container that has the runtime: nvidia flag.

Following the latest instructions, I installed docker (version 19.03) and the latest nvidia-docker per the repository for Ubuntu. I did not register the runtime anywhere, as the documentation clearly states that it is not necessary now.

Running a single container works, e.g. docker run --gpus all nvidia/cuda:10.0-base nvidia-smi this works perfectly - but when I try to launch the docker-compose project, it fails with the following error

ERROR: for MY_SERVICE Cannot create container for service MY_SERVICE: Unknown runtime specified nvidia

I don't know if it has anything to do with this, but I'm running on GCP Compute Engine, Ubuntu 18.04

bluesummers
  • 11,365
  • 8
  • 72
  • 108
  • I could run the [docker-compose example](https://github.com/NVIDIA/gpu-monitoring-tools/blob/master/exporters/prometheus-dcgm/docker/) in [nvidia-docker FAQ](https://github.com/NVIDIA/nvidia-docker/wiki/Frequently-Asked-Questions#do-you-support-docker-compose) Could you try that docker-compose file to confirm it isn't you compose file? Or could you share an extract of your docker-compose? One detail, what doc says is that nvidia-docker2 doesn't requiere to manually configure the runtime, but that config has to be present in order to work. – Gabriel Miretti aka gmiretti Sep 17 '19 at 20:29

1 Answers1

0

The newest version of nvidia-docker does not have a docker-compose support yet. From a discussion with a contributor, it has made clear to me that in order to work with docker-compose one must change a specific step in the installation process to install the previous version of nvidia-docker, as said per the contributor:

One the README (about installation)

-L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - $ curl -s -L
https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list
| sudo tee /etc/apt/sources.list.d/nvidia-docker.list

$ sudo apt-get update && sudo apt-get install -y
nvidia-container-toolkit $ sudo systemctl restart docker 

Replace the line:

nvidia-container-toolkit 

By:

$ sudo apt-get update && sudo apt-get install -y nvidia-docker2
bluesummers
  • 11,365
  • 8
  • 72
  • 108