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

文章目录

  • 问题描述
  • 解决方法
  • 参考

问题描述

使用 docker run -it --gpus all 报错 Error response from daemon: could not select device driver ““ with capabilities: [[gpu]]

解决方法

安装nvidia-container-toolkit

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
      && curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
      && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
            sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
            sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker

参考

  • https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html

你可能感兴趣的:(linux,工具使用,爬坑记录,docker,容器,运维)