当前位置:   article > 正文

解决docker启动容器报错 docker: Error response from daemon: Unknown runtime specified nvidia._docker: error response from daemon: unknown or inv

docker: error response from daemon: unknown or invalid runtime name: nvidia.

报错信息:

Error response from daemon: Unknown runtime specified nvidia.

1.加key

docker环境安装Nvidia-container-runtime

2.对于已经安装好docker的Ubuntu系统

(1). 首先配置nvidia源

curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \
  sudo apt-key add -

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)

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

(2). 参考https://gitee.com/wuxler/nvidia-container-runtime?_from=gitee_search 安装nvidia-container-runtime

sudo apt-get install nvidia-container-runtime

一键安装docker

wget -qO- https://get.docker.com/ | sh /dev/stdin --mirror Aliyun

2.cd /etc/docker

看看有没有daemon.json,没有就新建 touch daemon.json;

sudo vim daemon.json写入文件

  1. {
  2. "runtimes": {
  3. "nvidia": {
  4. "path": "/usr/bin/nvidia-container-runtime",
  5. "runtimeArgs": []
  6. }
  7. }
  8. }

3.最重要的重启:!

重启前:sudo docker info

sudo 

  1. root@crist:/etc/docker# sudo service docker stop
  2. root@crist:/etc/docker# sudo service docker start

重启后:Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux nvidia runc

就可以了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/105830
推荐阅读
相关标签
  

闽ICP备14008679号