Skip to content

Instantly share code, notes, and snippets.

@luizhenriquesoares
Forked from mjdietzx/waya-dl-setup.sh
Last active April 8, 2018 01:48
Show Gist options
  • Save luizhenriquesoares/6a23f948bac4e9b9ea19965f25d20e07 to your computer and use it in GitHub Desktop.
Save luizhenriquesoares/6a23f948bac4e9b9ea19965f25d20e07 to your computer and use it in GitHub Desktop.
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb"
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
# install cuDNN v5.1
CUDNN_TAR_FILE="cudnn-8.0-linux-x64-v5.1-tgz"
wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v5.1/prod_20161129/8.0/${CUDNN_TAR_FILE}
tar -xzvf ${CUDNN_TAR_FILE}
sudo cp cuda/include/* /usr/local/cuda/include
sudo cp cuda/lib64/* /usr/local/cuda/lib64/
# set environment variables
export CUDA_HOME=/usr/local/cuda-8.0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64
export PATH=$CUDA_HOME/bin:$PATH
#Necessary:
#sudo apt-get install libcupti-dev
#conda create -n tensorflow python=3.6
# wget https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.3.0-cp35-cp35m-linux_x86_64.whl
# pip install tensorflow_gpu-1.3.0-cp35-cp35m-linux_x86_64.whl
@luizhenriquesoares
Copy link
Author

@luizhenriquesoares
Copy link
Author

@luizhenriquesoares
Copy link
Author

Found the solution:

I reinstalled nvidia-381, CUDA-8.0 (using the runfile) and cuDNN 6.0. Then I added the following in my .bashrc:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/

@luizhenriquesoares
Copy link
Author

sudo apt install nvidia-cuda-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment