Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]

I saw similar treads but they are different because I am using WSL2 and docker and GPU aware docker.

I have windows 10 version 2004 (build 20161.1000) I have installed WSL 2 and have Docker Desktop 2.3.0.3 on my Windows System running. I have Ubuntu 18.04 LTS installed in WSL 2 too. I have installed the NVIDIA driver enter image description here

The linux version is 4.19.121-microsoft-standard. The NVIDIA driver version is 455.41 for my Laptop GPU QUADRO M2000M. Actually I followed all the steps described in https://ubuntu.com/blog/getting-started-with-cuda-on-ubuntu-on-wsl-2 until the step where I have to run "sudo service docker stop" in an Ubuntu terminal.

This results in a message docker: unrecognized service.

I have to restart docker desktop in WIndows 10 in order to get the deamon running.

I test then in the Ubuntu terminal : docker run hello-world ==> this runs fine Also the command docker run -it ubuntu bash ==> runs file in the Ubuntu terminal os WSL 2.

BUT when I run : docker run -u $(id -u):$(id -g) -it --gpus all -p 8888:8888 tensorflow/tensorflow:latest-gpu-py3-jupyter

then I get the error : docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]

This invoves microsoft,Ubuntu,NVIDIA. I have search the support sites but could not find anything that solves my prblem.

Can anyone help me here?

like image 664
gorkys Avatar asked Jul 05 '20 19:07

gorkys


People also ask

Why does Docker fail to select device driver?

docker: Error response from daemon: could not select device driver “” with capabilities: [ [gpu]]. NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver.

What is the error response from Docker daemon?

docker: Error response from daemon: could not select device driver “” with capabilities: [ [gpu]]. Docker: Error response from daemon: cgroups: cannot find cgroup mount destination: unknown.

What version of nvidia-smi does Docker run?

docker run --gpus all nvidia/cuda:9.0-base nvidia-smi 3. Information to attach (optional if deemed irrelevant)


1 Answers

There is this strange answer mentioned here and here:

sudo service docker start
sudo mkdir /sys/fs/cgroup/systemd
sudo mount -t cgroup -o none,name=systemd cgroup /sys/fs/cgroup/systemd

This worked for me on WSL (Ubuntu 20.04), so I added it to the ~/.bashrc script.
Note, the first part may need to be restarting docker!

like image 126
George Ogden Avatar answered Oct 17 '22 06:10

George Ogden