Last active
July 9, 2018 19:39
-
-
Save donigian/68b7a29c05891ae206c989b72d0d8c02 to your computer and use it in GitHub Desktop.
Install CUDA Ubuntu for Google Cloud Platform
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
#!/bin/bash | |
echo "Checking for CUDA and installing." | |
# Check for CUDA and try to install. | |
if ! dpkg-query -W cuda; 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_8.0.61-1_amd64.deb | |
dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb | |
apt-get update | |
apt-get install cuda -y | |
fi | |
echo 'export CUDA_HOME=/usr/local/cuda' >> ~/.bashrc | |
echo 'export PATH=$PATH:$CUDA_HOME/bin' >> ~/.bashrc | |
echo 'export LD_LIBRARY_PATH=$CUDA_HOME/lib64' >> ~/.bashrc | |
source ~/.bashrc | |
cd $HOME | |
tar xzvf cudnn-8.0-linux-x64-v5.1.tgz | |
sudo cp cuda/lib64/* /usr/local/cuda/lib64/ | |
sudo cp cuda/include/cudnn.h /usr/local/cuda/include/ | |
rm -rf ~/cuda | |
rm cudnn-8.0-linux-x64-v5.1.tgz | |
sudo apt-get install python-dev python-pip libcupti-dev | |
sudo pip install tensorflow-gpu | |
sudo nvidia-docker run --rm --name tf1 -p 8888:8888 -p 6006:6006 -v /home/donigian:/notebooks gcr.io/tensorflow/tensorflow:latest-gpu jupyter notebook --allow-root —NotebookApp.token='' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment