docker nvidia install

1. 创建用户组sudo groupadd docker
 
2.添加用户进入docker组,以便该用户可以使用dockersudo gpasswd -a ${USER} docker
 
3.重启服务sudo service docker restart
 
4.修改docker仓库和存放目录sudo vim /etc/docker/daemon.json
 
5.修改如下,其中https://cwoel6s9.mirror.aliyuncs.com 为从阿里服务器申请的镜像地址,/data/docker     为存放目录
{    "registry-mirrors": [        "https://cwoel6s9.mirror.aliyuncs.com"    ],    "graph":"/data/docker",    "storage-driver": "overlay",    "runtimes": {        "nvidia": {            "path": "nvidia-container-runtime",            "runtimeArgs": []        }    }}  
 
6.重启docker,并使用docker info查看修改信息systemctl daemon-reload systemctl restart dockerdocker info
 
7.nvidia-docker 安装,添加源curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \  sudo apt-key add -
 
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \  sudo tee /etc/apt/sources.list.d/nvidia-docker.list
 
sudo apt-get update
 
8.安装nvidia-docker2软件包并重新加载Docker守护程序配置sudo apt-get install nvidia-docker2sudo pkill -SIGHUP dockerd
 
安装完成后,当需要使用gpu时,使用nvidia-docker代替docker!
# 注意:执行这一步,如果没有安装nvidia驱动,会报错:# docker:ERROR response from Daemon....# 安装nvida驱动就可以了

Erro 1:

gpg: no valid OpenPGP data found. 解决办法?

sudo vim /etc/hosts ,Add the following at the end.

185.199.108.153 nvidia.github.io
185.199.109.153 nvidia.github.io
185.199.110.153 nvidia.github.io
185.199.111.153 nvidia.github.io

上一篇:nvidia-smi指令报错:Failed to initialize NVML: Driver解决


下一篇:[PyTorch] rnn,lstm,gru中输入输出维度