Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install CUDA Toolkit v9.0 and cuDNN v7.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v9.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb)
CUDA_REPO_PKG="cuda-repo-ubuntu1604-9-0-local_9.0.176-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-9-0
CUDA_PATCH1="cuda-repo-ubuntu1604-9-0-local-cublas-performance-update_1.0-1_amd64-deb"
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/patches/1/${CUDA_PATCH1}
sudo dpkg -i ${CUDA_PATCH1}
sudo apt-get update
# install cuDNN v7.0
CUDNN_PKG="libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb"
wget https://github.com/ashokpant/cudnn_archive/raw/master/v7.0/${CUDNN_PKG}
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
@grasool

This comment has been minimized.

grasool commented Mar 11, 2018

Thanks
I was able to set up Tensoflow using this.

@mfkenson

This comment has been minimized.

mfkenson commented Mar 19, 2018

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

@ianholing

This comment has been minimized.

ianholing commented Apr 12, 2018

Hi,
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

@ashokpant

This comment has been minimized.

Owner

ashokpant commented Apr 17, 2018

Thanks, @ianholing. I updated it.

@UmerImran

This comment has been minimized.

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

@a5tr1

This comment has been minimized.

a5tr1 commented May 15, 2018

thanks, i can use tensorflow in ubuntu 16.04 now

@ahundt

This comment has been minimized.

ahundt commented May 30, 2018

This worked for me, thanks!

@Ohmat-Robotics

This comment has been minimized.

Ohmat-Robotics commented Jun 11, 2018

Best!

@lychrel

This comment has been minimized.

lychrel commented Jun 15, 2018

bless this

@jkh911208

This comment has been minimized.

jkh911208 commented Jul 2, 2018

thanks

@amarv3142

This comment has been minimized.

amarv3142 commented Jul 22, 2018

This is great. Thanks.

@IAMLYCHEE

This comment has been minimized.

IAMLYCHEE commented Jul 23, 2018

really good post, thanks a lot

@FriedRonaldo

This comment has been minimized.

FriedRonaldo commented Aug 16, 2018

How surprise... really good. thx a lot

@waral

This comment has been minimized.

waral commented Sep 5, 2018

thanks

@dwleeKAIST

This comment has been minimized.

dwleeKAIST commented Sep 7, 2018

Awesome! Thanks.

@saber-zero

This comment has been minimized.

saber-zero commented Nov 2, 2018

Great! Thanks.

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