Centos7安装nvidia Dcoker
安装NVIDIA-docker前最好先将已有的docker卸载掉
# 查看已经安装的
yum list installed |grep docker
# 删除掉对应的docker
yum -y remove ***
安装 NVIDIA-docker 2
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 install -y nvidia-container-toolkit nvidia-docker2
systemctl restart docker
第二步 install 安装的时候可能下载的很慢,可以先设定成阿里源
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
安装后,配置 /etc/docker/daemon.json
{
"insecure-registries":[],
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"],
"max-concurrent-downloads": 10,
"max-concurrent-uploads": 20,
"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "nvidia-container-runtime",
"runtimeArgs": []
}
}
}