UCL / scikit-surgerydocker

This repo describes with a simple example how to use docker to containerise your project/algorithm
https://scikit-surgerydocker.readthedocs.io/en/latest/
Other
1 stars 2 forks source link

docker: Error response from daemon: #37

Closed mianasbat closed 3 years ago

mianasbat commented 3 years ago

I was following the GPU example and on running the command

docker run -p 5000:5000 --gpus all my-project-2

I got the error

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled

NVIDIA driver 450
Cuda driver 10.0

mianasbat commented 3 years ago

To solve the issue we need to install the nvidia-docker-toolkit on the docker host machine.

Here are the steps

First check if nvidia-container-toolkit is installed on the host machine or not by

nvidia-container-cli info

If it is not installed then run the following commands and try to run your docker again

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -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