-
-
Save kastnerkyle/d468eac51517bd4229dc08694143e385 to your computer and use it in GitHub Desktop.
Provision GPU for Ubuntu 18.04
This file contains hidden or 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
#!/usr/bin/env bash | |
# First download cudnn to a directory /tmp/binaries. | |
# The filename should be cudnn-9.2-linux-x64-v7.1.tgz | |
set -e | |
# Install driver | |
sudo add-apt-repository ppa:graphics-drivers/ppa | |
sudo apt-get update | |
sudo apt-get install -y nvidia-driver-396 libnvidia-compute-396 libnvidia-common-396 nvidia-utils-396 | |
# Download toolkit and patch | |
wget -O cuda_9.2.88_396.26_linux.run -c https://developer.nvidia.com/compute/cuda/9.2/Prod/local_installers/cuda_9.2.88_396.26_linux --quiet | |
sudo mv cuda_9.2.88_396.26_linux.run /etc/install-cuda-9.2 | |
wget https://developer.nvidia.com/compute/cuda/9.2/Prod/patches/1/cuda_9.2.88.1_linux --quiet | |
sudo mv cuda_9.2.88.1_linux /etc/patch-cuda-9.2 | |
sudo chmod a+rx /etc/install-cuda-9.2 | |
sudo chmod a+rx /etc/patch-cuda-9.2 | |
sudo /etc/install-cuda-9.2 --toolkit --silent --verbose | |
sudo /etc/patch-cuda-9.2 --silent --accept-eula | |
sudo cp /tmp/binaries/cudnn-9.2-linux-x64-v7.1.tgz /etc/cudnn.tgz | |
sudo cp /tmp/runtime/cuda_bashrc /home/ubuntu/.bashrc | |
sudo chmod a+rwx /home/ubuntu/.bashrc | |
cd /tmp/binaries | |
tar -xzf cudnn-9.2-linux-x64-v7.1.tgz | |
sudo cp -r cuda/include/* /usr/local/cuda/include | |
sudo cp -r cuda/lib64/* /usr/local/cuda/lib64 | |
sudo chmod -R a+rx /usr/local/cuda/include/* | |
sudo chmod -R a+rx /usr/local/cuda/lib64/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment