nvidia-docker: Unknown runtime specified nvidia

Deadly 提交于 2020-07-10 09:02:11

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/57957491/nvidia-docker-unknown-runtime-specified-nvidia

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!