Created
November 23, 2017 21:09
-
-
Save trungkak/3d9d0c1b9dda91623488a5e4a3373053 to your computer and use it in GitHub Desktop.
Tensorflow GPU installation on Ubuntu 16.04
This file contains 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
# 1. Install CUDA | |
# Preparation | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install tmux build-essential gcc g++ make binutils | |
sudo apt-get install software-properties-common | |
# Download Cuda toolkit (Nvidia driver included) | |
cd ~/Downloads | |
# Download CUDA 8.0 from this https://developer.nvidia.com/cuda-80-ga2-download-archive, not 9.0 | |
# Installation | |
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb | |
sudo apt-get update | |
sudo apt-get -y install cuda-8-0 | |
# Setting up enviroment variables | |
vi ~/.bashrc | |
# Add these line to the end of bashrc | |
export CUDA_HOME="/usr/local/cuda/" | |
export PATH="$PATH:$CUDA_HOME/bin" | |
source ~/.bashrc | |
# Reboot then check the installation | |
nvidia-smi | |
nvcc --version | |
# 2. Install CuDNN | |
wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v6/prod/8.0_20170307/cudnn-8.0-linux-x64-v6.0-tgz | |
tar -zxvf cudnn-8.0-linux-x64-v6.0.tgz | |
cd cuda/lib64/ | |
sudo cp libcudnn.so.6.0.21 libcudnn_static.a /usr/local/cuda/lib64 | |
# Make symbolic link | |
cd /usr/local/cuda/lib64/ | |
sudo ln -s libcudnn.so.6.0.21 libcudnn.so.6 | |
sudo ln -s libcudnn.so.6 libcudnn.so | |
cd ~/Downloads/cuda/include | |
sudo cp cudnn.h /usr/local/cuda/include/ | |
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/ | |
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64/ | |
# 3. Install tensorflow from https://www.tensorflow.org/install/install_linux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment