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:

https://www.tensorflow.org/install/install_linux

Next I studied the content at this URL:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#axzz4VZnqTJ2A

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-get 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:

https://developer.nvidia.com/cuda-downloads

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:

https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64

Next I studied the content at this URL:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#ubuntu-installation

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/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

I ran the above shell commands.

Next I studied the content at this URL:

http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#post-installation-actions

I enhanced ~/.bashrc with a CUDA_HOME variable:

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

I enhanced ~/.bashrc so that PATH contains:

/usr/local/cuda/bin

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


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