Skip to content

Instantly share code, notes, and snippets.

@bitnom
Created February 26, 2021 00:51
Show Gist options
  • Save bitnom/f1b871f75e326c76397daa14c302eb02 to your computer and use it in GitHub Desktop.
Save bitnom/f1b871f75e326c76397daa14c302eb02 to your computer and use it in GitHub Desktop.
install nvidia docker on Linux
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
curl -s -L https://nvidia.github.io/nvidia-container-runtime/experimental/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment