Skip to content

Instantly share code, notes, and snippets.

@adityathiru
Created May 7, 2019 11:55
Show Gist options
  • Save adityathiru/1eb4ee50bfe0f773380c7584ac095652 to your computer and use it in GitHub Desktop.
Save adityathiru/1eb4ee50bfe0f773380c7584ac095652 to your computer and use it in GitHub Desktop.
Install CUDA 9 (works best on AWS/GCP)
#!/bin/bash
echo "Checking for CUDA9 and installing."
# Check for CUDA9 and try to install.
if ! dpkg-query -W cuda-9-0; then
# The 16.04 installer works with 16.10.
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
apt-get update
apt-get install cuda-9-0 -y
fi
# Enable persistence mode
nvidia-smi -pm 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment