Installing TensorFlow w GPU Support on Ubuntu 16.04 for Pascal architecture

Thomas Quintana edited this page Apr 13, 2017 · 8 revisions

Getting Started on Ubuntu 16.04

The instructions in this section will help new developers get their Ubuntu 16.04 environment properly setup.

Install CUDA:

Install the NVidia 375.39 Driver

$] sudo add-apt-repository ppa:graphics-drivers/ppa
$] sudo apt-get update
$] sudo apt-get install nvidia-375

Then reboot :)

Download the CUDA SDK from NVidia

Navigate to the CUDA SDK Download page and click download under CUDA Tookit 8 RC. Once you login click on Linux -> x86_64 -> Ubuntu -> 16.04 -> runfile (local)

Make Sure To Download Both The Base Installer And Patch 1

Install the CUDA SDK

Do NOT INSTALL the driver and Create a symbolic link when prompted!

$] cd ~/Downloads
$] sudo chmod +x cuda_8.0.27*
$] sudo ./ --override
$] sudo ./
$] cd /usr/local/cuda/samples
$] sudo make
$] 1_Utilities/deviceQuery/deviceQuery
$] cd ~

Install CuDNN

Navigate to the CuDNN Download page and click download. Once you login click on Download cuDNN v5.1 (August 10, 2016), for CUDA 8.0 RC -> cuDNN v5.1 Library for Linux

$] cd ~/Downloads
$] tar -xzvf cudnn-8.0-linux-x64-v5.1.tgz
$] sudo cp -P cuda/include/* /usr/local/cuda/include/
$] sudo cp -P cuda/lib64/* /usr/local/cuda/lib64
$] sudo ldconfig

Post Install Configuration

Open ~/.bashrc with your favorite editor and append the following BASH snippet to the end of the file.

# set cuda paths.
if [ -d "/usr/local/cuda" ] ; then
    export CUDA_HOME="/usr/local/cuda"
    export LD_LIBRARY_PATH="$CUDA_HOME/lib64"
    export PATH="$CUDA_HOME/bin:$PATH"

Install TensorFlow