docker: Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:495: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: nvidia-container-cli: mount error: mount operation failed:
-
报错原因
- 系统内核更新,或显卡驱动更新导致版本不一致
- 误删除了某些依赖文件
-
解决方法
Ubuntu系统:sudo apt-get update && sudo apt install nvidia-container-toolkit sudo systemctl restart docker
Centos系统:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo yum update yum install -y nvidia-container-toolkit sudo systemctl restart docker
-
docker创建容器共享宿主机显卡
sudo docker run -it --gpus all --shm-size 20g nvidia/cuda:11.4.0-cudnn8-devel-ubuntu18.04 /bin/bash