Last active
November 3, 2018 19:28
-
-
Save istepanov/458a0c6ceb1a54cbef8b6d19ad3f09ae to your computer and use it in GitHub Desktop.
Nvidia Docker
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
# make sure you have Ubuntu 18.04 and Docker >= 1.12 installed | |
# nvidia drivers (Ubuntu-based distros) | |
sudo add-apt-repository ppa:graphics-drivers/ppa | |
sudo apt-get update | |
sudo apt-get install ubuntu-drivers-common | |
# show list of drivers to install | |
sudo ubuntu-drivers devices | |
# install recommended drivers | |
sudo ubuntu-drivers autoinstall | |
# add nvidia repos | |
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 | |
# install nvidia-docker2 | |
sudo apt-get install nvidia-docker2 | |
sudo pkill -SIGHUP dockerd | |
# test | |
docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment