Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
# install CUDA Toolkit v9.0
# instructions from (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys
sudo apt-get update
sudo apt-get -y install cuda-9-0
sudo dpkg -i ${CUDA_PATCH1}
sudo apt-get update
# install cuDNN v7.0
sudo dpkg -i ${CUDNN_PKG}
sudo apt-get update
# install NVIDIA CUDA Profile Tools Interface ( libcupti-dev v9.0)
sudo apt-get install cuda-command-line-tools-9-0
# set environment variables
export PATH=${PATH}:/usr/local/cuda-9.0/bin
export CUDA_HOME=${CUDA_HOME}:/usr/local/cuda:/usr/local/cuda-9.0
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/cuda-9.0/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64
Copy link

grasool commented Mar 11, 2018

I was able to set up Tensoflow using this.

Copy link

mfkenson commented Mar 19, 2018

going to try this on dell vostro 7570 with gtx1060 @ubuntu 16.04

Copy link

ianholing commented Apr 12, 2018

Great script and helpful thanks!
Only a thing:
sudo apt-get -y install cuda <-- Isn't this going to install cuda 9.1?
Better use this directly: sudo apt-get install cuda-9.0

Copy link

ashokpant commented Apr 17, 2018

Thanks, @ianholing. I updated it.

Copy link

UmerImran commented May 7, 2018

I have set the Environment variables correct but still nvcc --version is giving the result that it is not installed

Copy link

a5tr1 commented May 15, 2018

thanks, i can use tensorflow in ubuntu 16.04 now

Copy link

ahundt commented May 30, 2018

This worked for me, thanks!

Copy link

Ohmat-Robotics commented Jun 11, 2018


Copy link

lychrel commented Jun 15, 2018

bless this

Copy link

jkh911208 commented Jul 2, 2018


Copy link

amarv3142 commented Jul 22, 2018

This is great. Thanks.

Copy link

IAMLYCHEE commented Jul 23, 2018

really good post, thanks a lot

Copy link

FriedRonaldo commented Aug 16, 2018

How surprise... really good. thx a lot

Copy link

waral commented Sep 5, 2018


Copy link

dwleeKAIST commented Sep 7, 2018

Awesome! Thanks.

Copy link

saber-zero commented Nov 2, 2018

Great! Thanks.

Copy link

Abdelrahman995 commented Dec 16, 2018


Copy link

Pluckypan commented Dec 27, 2018

good job!

Copy link

Ferch42 commented Apr 4, 2019

Thanks! It worked

Copy link

husnejahan commented Jun 13, 2019

The following packages have unmet dependencies:
cuda-9-0 : Depends: cuda-runtime-9-0 (>= 9.0.176) but it is not going to be installed
Depends: cuda-demo-suite-9-0 (>= 9.0.176) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I m getting error

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