Upgrade CUDA Toolkit 7.5 to 8.0 & cuDNN v5.1 On Ubuntu 14.04

Reference: http://dhaneshr.net/2016/11/09/upgrading-to-cuda-8-0-on-ubuntu-16-04/
https://developer.nvidia.com/cuda-downloads
https://developer.nvidia.com/rdp/cudnn-download
http://www.pyimagesearch.com/2016/07/04/how-to-install-cuda-toolkit-and-cudnn-for-deep-learning/

The NVIDIA CUDA Toolkit: A development environment for building GPU-accelerated applications. This toolkit includes a compiler specifically designed for NVIDIA GPUs and associated math libraries + optimization routines.
The cuDNN library: A GPU-accelerated library of primitives for deep neural networks. Using the cuDNN package, you can increase training speeds by upwards of 44%, with over 6x speedups in Torch and Caffe.

Currently My system Ubuntu 14.04 installed CUDA toolkit 7.5

Now I want to upgrade it to CUDA toolkit 8.0:

  1. Download the .deb file of CUDA Toolkit 8 (I prefer local here to make the installation smooth) from https://developer.nvidia.com/cuda-downloads.
    I need to select the correct file according to my systemThe file (https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda-repo-ubuntu1404-8-0-local-ga2_8.0.61-1_amd64-deb) is BIG (1.9 GB)!!! IT TOOK ALMOST ONE HOUR TO COMPLETE THE DOWNLOADED FILE
  2. Download cuDNN (NVIDIA CUDA Deep Neural Network library) from https://developer.nvidia.com/rdp/cudnn-download (You need to be a member first)Download the ‘cuDNN v5.1 Library for Linux’ (https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v5.1/prod_20161129/8.0/cudnn-8.0-linux-x64-v5.1-tgz). File size is just 98MB.
  3. Remove CUDA 7.5 package first (NO???)
    This is not working ‘sudo apt-get remove nvidia-cuda-toolkit’

    This is also no make sense ‘sudo apt-get purge cuda-7.5’

    HOW THIS ‘purge’ ONLY REMOVE 16,4kB DATA???
  4. Install the .deb file (THIS INSTALLATION WOULD NOT REMOVE THE OLDER 7.5 VERSION. IT’D BE INSTALLED SIDE BY SIDE)
    Then ‘sudo apt-get update’
    Then

    OK. THEN RESTART YOUR COMPUTER TO SEE ANY WRONG HAPPENED!
  5. The CUDA toolkit 8 is installed in /usr/local/cuda-8.0 (next to ‘cuda-7.5’ and the symlink ‘cuda’)Then we need to modify the environment variables:

    Modify this line

    to

    Save and Close. Then make sure the system use the new changes

    Read also: https://devtalk.nvidia.com/default/topic/971478/installing-cuda-7-5-next-to-cuda-8-0-on-ubuntu-14-04-so-i-can-keep-using-zed-driver-v1-1-0-/
  6. Check CUDA version and the driver


    Now I already use CUDA Toolkit 8.0. I CAN CHANGE ‘.bashrc’ TO BACK TO THE 7.5 VERSION IF IT’S NEEDED!

TRY THE CUDA 8.0 SAMPLES:

  1. Copy the samples into /home/teddy/Documents/

    the samples directory in /home/teddy/Documents/NVIDIA_CUDA-8.0_Samples/
  2. Go into the samples directory
  3. Go into the deviceQuery directory THEN make:


     
  4. run the deviceQuery script to test if we can communicate with the GPU:

     
  5. Go into the bandwidthTest (/NVIDIA_CUDA-8.0_Samples/1_Utilities/bandwidthTest) directory THEN make:

     
  6. run bandwidthTest:

     

INSTALL cuDNN:
Installing cuDNN is quite simple — all we need to do is extract the .tgz file then copy the files in the lib64  and include directories to their appropriate locations on our machine:

Check cuDNN version (http://stackoverflow.com/questions/31326015/how-to-verify-cudnn-installation):

 

Leave a Reply

Your email address will not be published. Required fields are marked *