[Solved] docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].

docker uses –gpus all to report an error:

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

I have searched many articles on the Internet. In summary, it is necessary to install nvidia-container-toolkitor nvidia-container-runtime(including nvidia-container-toolkit),
but the embarrassing thing is that I can’t install nvidia-container-toolkit, and it keeps showing ** E: Unable to locate package nvidia-container-toolkit **

Online solutions:

  • distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
  • curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
    Everyone should be familiar with this. Old versions of docker installation will use this to add GPG key.
  • curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
    orcurl -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

I have tried all of the above methods. Here we should pay attention to the third step. Centos and Ubuntu commands are not the same!

I still can’t install using the above command, and the final resolution process is recorded as follows:

  • Change the system source to Ali’s mirror source
  • distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
  • curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - OK will be displayed normally
  • curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list My system is Ubuntu 18.04
  • sudo apt-get updateThis step must ensure that there is no problem. My display has several sources that are repeatedly configured, and then I sudo vim nvidia-docker.listcomment it out ( )
  • sudo apt-get install nvidia-container-toolkit

Summarize

The implementation path is the same, is it as simple as updating the source? In fact the company’s network is very poor is very unstable, resulting in many steps can not be executed properly, such as sudo apt-get updatefor a normal execution, a error.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *