docker: Error response from daemon: could not select device driver “” with capabilities: [[gpu]].
意思是关联不上宿主机的GPU,因为要用GPU,就要启用nvidia英伟达运行时环境,安装即可:
sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey
sudo apt-key add -distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
sudo curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list
sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update
sudo apt-get install nvidia-container-runtime
systemctl restart docker
然后重新执行docker容器运行命令即可:
sudo docker run -itd --gpus=all --network=host --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --name=stable-diffusion gpulab.tencentcloudcr.com/ai/stable-diffusion:1.0.8 | xargs sudo docker logs --follow文章来源:https://www.toymoban.com/news/detail-753210.html
如果提示已经存在了(之前未成功但占用了名字的),docker rm 容器ID
删除即可文章来源地址https://www.toymoban.com/news/detail-753210.html
到了这里,关于docker跑gpu报错Error response from daemon: could not select device driver ““ with capabilities: [[gpu]]的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!