Skip to content

Instantly share code, notes, and snippets.

@cloutsocks
Created December 11, 2018 13:34
Show Gist options
  • Save cloutsocks/21657de6f65c3e1903b5b0e374353610 to your computer and use it in GitHub Desktop.
Save cloutsocks/21657de6f65c3e1903b5b0e374353610 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Checking for CUDA and installing."
# Check for CUDA 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
# disable the autoboost feature for all GPUs on the instance
nvidia-smi --auto-boost-default=DISABLED
# optionally set all GPU clock speeds to their maximum frequency
# nvidia-smi -ac 2505,875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment