Cent OS Docker运行的时候could not select device driver ““ with capabilities: [[gpu]] 原创
解决方法 :
systemctl restart docker
yum install nvidia-container-runtime
docker start your_container
systemctl restart docker
nvidia-container-runtime 安装失败
执行下面命令再安装
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.repo | \
sudo tee /etc/yum.repos.d/nvidia-container-runtime.repo
sudo yum-config-manager --enable libnvidia-container-experimental
sudo yum-config-manager --enable nvidia-container-experimental
参考:
https://nvidia.github.io/nvidia-container-runtime/
https://github.com/NVIDIA/nvidia-docker/issues/1416
https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
RHEL-based distributions
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.repo | \
sudo tee /etc/yum.repos.d/nvidia-container-runtime.repo
For pre-releases, you need to enable the experimental repos of all dependencies:
sudo yum-config-manager --enable libnvidia-container-experimental
sudo yum-config-manager --enable nvidia-container-experimental
To later disable the experimental repos of all dependencies, you can run:
sudo yum-config-manager --disable libnvidia-container-experimental
sudo yum-config-manager --disable nvidia-container-runtime-experimental