-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_nvidia_ubuntu.txt
72 lines (45 loc) · 2.11 KB
/
docker_nvidia_ubuntu.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
https://github.com/NVIDIA/nvidia-docker
Make sure you have installed the NVIDIA driver and Docker 19.03 for your Linux distribution
!!! Note that with the release of Docker 19.03, usage of nvidia-docker2 packages are deprecated since NVIDIA GPUs are now natively supported
as devices in the Docker runtime.
https://docs.docker.com/install/linux/docker-ce/ubuntu/
## >>> docker install
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
# docker test
sudo docker run hello-world
## install NVIDIA Container Toolkit
https://www.tensorflow.org/install/docker
https://github.com/NVIDIA/nvidia-docker/blob/master/README.md#quickstart
https://github.com/NVIDIA/nvidia-docker/issues/971
# original für ubuntu18.04
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
# >>> angepasst für 19.04
distribution="ubuntu18.04"
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
# allgemein
sudo apt-get update
# Install nvidia-docker2 and reload the Docker daemon configuration
sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
# docker NVIDIA test
sudo docker run --gpus all nvidia/cuda:9.0-base nvidia-smi
## NVIDIA Containers
https://hub.docker.com/r/nvidia/cuda/
The NVIDIA Container Runtime for Docker is required to run CUDA images.
For CUDA 10.0, nvida-docker2 or greater is required. Older versions of the NVIDIA runtime work but an un-supported.