A step by Step Guide to Install Tensorflow GPU on Ubuntu 18.04 LTS

1.Install / check Nvidia driver

The driver version we have installed is near the top left next to “NVIDIA-SMI”. I’ve got nvidia-390.48installed.

2.CUDA Toolkit 9.0

It ll be something like this. download the file from the Base Installer link.
sudo chmod +x cuda_9.0.176_384.81_linux.run
./cuda_9.0.176_384.81_linux.run --override

3.CUDA post-install actions

export PATH=/usr/local/cuda-9.0/bin${PATH:+${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}

4.CUDNN 7.0

Get the Library for Linux file for CUDA 9.0.
# Unpack the archive
tar -zxvf cudnn-9.0-linux-x64-v7.tgz
# Move the unpacked contents to your CUDA directory
sudo cp -P cuda/lib64/* /usr/local/cuda-9.0/lib64/
sudo cp cuda/include/* /usr/local/cuda-9.0/include/
# Give read access to all users
sudo chmod a+r /usr/local/cuda-9.0/include/cudnn.h

5.Install libcupti

sudo apt-get install libcupti-dev

6.Installing Anaconda

bash Anaconda3-5.0.1-Linux-x86_64.sh
...
installation finished.
Do you wish the installer to prepend the Anaconda3 install location
to PATH in your /home/kekayan/.bashrc ? [yes|no]
[no] >>>
source ~/.bashrc
conda list
conda create --name tf
source activate tf
easy_install -U pip
pip3 install --upgrade tensorflow-gpu

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store