Last active
July 25, 2018 09:44
-
-
Save innovia/85431fd54f2a3b79d415e37b94b7c506 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ | |
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 | |
apt-get update && sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg2 \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | apt-key add - | |
apt-key fingerprint 0EBFCD88 | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \ | |
$(lsb_release -cs) \ | |
stable" | |
apt-get update && sudo apt-get install -y \ | |
nvidia-docker2 \ | |
docker-ce | |
sed -i 's|ExecStart=/usr/bin/dockerd -H fd://|ExecStart=/usr/bin/dockerd -H fd:// -s=overlay2|g' /lib/systemd/system/docker.service | |
systemctl daemon-reload | |
tee /etc/docker/daemon.json <<EOF | |
{ | |
"default-runtime": "nvidia", | |
"runtimes": { | |
"nvidia": { | |
"path": "/usr/bin/nvidia-container-runtime", | |
"runtimeArgs": [] | |
} | |
} | |
} | |
EOF | |
pkill -SIGHUP dockerd | |
systemctl restart kubelet | |
// Verify | |
docker run --rm nvidia/cuda nvidia-smi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment