Class05 Answer:

Install Nvidia CUDA Toolkit 9.1 Software

I followed the steps in this page on my Ubuntu 16 laptop.

Why do we want CUDA Toolkit 9.1 ?

I want to install Nvidia CUDA Toolkit 9.1 Software because TensorFlow r1.7 asks for that.

As of 2018-04-03, TensorFlow shows these instructions:

I found the above instructions at this URL:

Next I studied the content at this URL:

I saw this:

In the above page I completed the pre-installation actions:

lspci | grep -i nvidia
uname -m && cat /etc/*release
gcc --version
sudo apt install linux-headers-$(uname -r)

The above page asked me to choose an installation method.

It asked me to specify my choice at this URL:

At the above URL, after a bit of thought, I made my choice.

Then, I captured a screen-shot of my choices:

I downloaded the base installer via the button at the bottom.

The link of that button is listed below:

Next I studied the content at this URL:

I summarize that content into shell commands listed below:

sudo dpkg -i ~/Downloads/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-1-local/
sudo apt update
sudo apt install cuda

I ran the above shell commands.

Next I studied the content at this URL:

I enhanced ~/.bashrc with a CUDA_HOME variable:

echo 'export CUDA_HOME=/usr/local/cuda' >> ~/.bashrc

I enhanced ~/.bashrc so that PATH contains:


With this shell command:

echo 'export PATH=/usr/local/cuda/bin:$PATH' >> ~/.bashrc

Then, I made another enhancement to .bashrc:

echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}' >> ~/.bashrc

Class05 Lab About Blog Contact Class01 Class02 Class03 Class04 Class05 Class06 Class07 Class08 Class09 Class10 dan101 Forum Google Hangout Vboxen