在docker中配置deepo時出現了錯誤:
在出現這個錯誤之前,我是先用如下命令查看NVIDIA-docker是否安裝成功。
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
出現如下顯示:
在網上查看原因,顯示是nvidia-docker 沒有注冊,具體查看https://blog.csdn.net/weixin_32820767/article/details/80538510
然后按照博客提示進行注冊,通過下面的步驟:
#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
這里主要是在/etc/systemd/system/docker.service.d目錄下新建文件override.conf,並寫入ExecStart啟動的路徑。
完成后就出現了如上錯誤,docker無法啟動了。
於是我又刪除了override.conf文件后又可以啟動了,但是NVIDIA-DOCKER還是無法啟動。