nvidia-docker 运行出错:

1 拉取镜像:

docker pull XXX

2 开启镜像:

nvidia-docker run -it -v `pwd`:/paddle XXX /bin/bash

3 报错:

docker: Error response from daemon: Unknown runtime specified nvidia.

4 找方法:原来是nvidia-docker 没有注册:docker: Error response from daemon: Unknown runtime specified nvidiawhile running nvidia docke 接着寻找如何注册: docker-engine-setup

具体的:

To register the nvidia runtime, use the method below that is best suited to your environment.
You might need to merge the new argument with your existing configuration.

Systemd drop-in file
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/override.conf <<EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --host=fd:// --add-runtime=nvidia=/usr/bin/nvidia-container-runtime
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
Daemon configuration file
sudo tee /etc/docker/daemon.json <<EOF
{
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}
EOF
sudo pkill -SIGHUP dockerd
5。 再去开启镜像,done。





Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐