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-toolkit
or 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 normallycurl -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.04sudo apt-get update
This step must ensure that there is no problem. My display has several sources that are repeatedly configured, and then Isudo vim nvidia-docker.list
comment 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 update
for a normal execution, a error.
Similar Posts:
- [How to Solve] Driver/library version mismatch
- [Solved] NVIDIA SMI instruction error: failed to initialize nvml: Driver
- How to deal with high CPU consumption of win10 NVIDIA container
- [Solved] nvidia-smi Error: Failed to initialize NVML: Driver/library version mismatch
- Solutions to the phenomena of / dev / sda2 clean and / dev / sda2 recovering journal when starting Ubuntu
- [Solved] dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
- [Solved] RuntimeError: DataLoader worker (pid 463) is killed by signal: Bus error. It is possible that datalo
- Solution to NVIDIA driver problem: failed to initialize nvml: Driver / library version mismatch
- [Solved] Ubuntu gnome 17.04 error: kernel BUG at /build/linux-7LGLH_/linux-4.10.0/include/linux/swapops.h:129