Skip to content

Instantly share code, notes, and snippets.

@BohdanTkachenko
Last active January 2, 2020 01:48
Show Gist options
  • Save BohdanTkachenko/ce712410ddff53dad0fdcde1e35c9916 to your computer and use it in GitHub Desktop.
Save BohdanTkachenko/ce712410ddff53dad0fdcde1e35c9916 to your computer and use it in GitHub Desktop.
Install NVIDIA drivers and nvidia-docker on Ubuntu (if Docker is installed already)
add-apt-repository -y ppa:graphics-drivers/ppa
apt-get update -y
apt-get install -y build-essential
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/381.09/NVIDIA-Linux-x86_64-381.09.run
sh NVIDIA-Linux-x86_64-381.09.run -q -a --ui=none
rm NVIDIA-Linux-x86_64-381.09.run
apt-get install -y nvidia-384 nvidia-modprobe
nvidia-smi
wget https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb
dpkg -i nvidia-docker_1.0.1-1_amd64.deb
rm nvidia-docker_1.0.1-1_amd64.deb
nvidia-docker run --rm nvidia/cuda nvidia-smi
curl -s localhost:3476/docker/cli
@BohdanTkachenko
Copy link
Author

This script is supposed to be run on Rancher hosts to support GPU for Docker containers. After creating a host, just run this script (you can use shortcut wget -O - https://git.io/vdM98 | sudo bash). Also, make sure that for GPU containers you specified a volume nvidia_driver_384.90:/usr/local/nvidia:ro. See this issue rancher/rancher#4883 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment