nvidia-docker2 安装记录(自用)

一.安装docker    (docker-ce)

可以直接脸上 download.docker.com  (如果不能连接上或者速度很慢,可以考虑使用ali的代理,方法后续再更新)

1. Update the apt package index and install packages to allow apt to use a repository over HTTPS

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

 2.Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

$ sudo apt-key fingerprint 0EBFCD88

pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) 
sub   rsa4096 2017-02-22 [S]

3 .Use the following command to set up the stable repository.

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

4.update and install

$ sudo apt-get update
 $ sudo apt-get install docker-ce

5.verify 

$ sudo docker run hello-world

二、安装nvidia-docker2

1.apt-get install

distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
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 install nvidia-docker2
sudo systemctl restart docker

 2.verify

docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

你可能感兴趣的:(工具)