-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
56 lines (44 loc) · 1.82 KB
/
install.sh
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
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get upgrade
# Install Docker
# https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce
sudo apt-get install -y curl \
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 -y docker-ce docker-ce-cli containerd.io
# https://marmelab.com/blog/2018/03/21/using-nvidia-gpu-within-docker-container.html
# Install NVIDIA repo metadata
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo dpkg --install cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
# Install CUDA GPG key
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install -y -o Dpkg::Options::="--force-overwrite" nvidia-418
sudo apt-get install -y -o Dpkg::Options::="--force-overwrite" --fix-broken
# Install NVidia Docker
# https://nvidia.github.io/nvidia-docker/
# https://github.com/nvidia/nvidia-docker/wiki/Installation-(version-2.0)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
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
sudo apt-get install -y nvidia-docker2
sudo pkill -SIGHUP dockerd
sudo groupadd docker
# Postinstall - to be run as user
# https://docs.docker.com/install/linux/linux-postinstall/
#
sudo usermod -aG docker $USER
#sudo reboot now