Installing Cuda 8.0 on ubuntu 16.4

This post is depreciated, look a this:

Training deeplearning models in GPUs is faster than on CPUs, therefore GPU support is a good tool when we are training these models. I guess that Nvidia Cards are actually the market standard to this finality. In this way, it is necessary to install Cuda suport in the machine that we will compute our models using GPU.

When i was trying to install Cuda on my training server with an geforce 660 TI I had a lot of problems. In this “tutorial”  I  share the steeps that i fallowed to solve the problems that occurred while  I was installing CUDA in my training machine.

My first attempt was to install cuda 7.5 on 16.4, a complete failure.  I tried it on 14.4 too, fail again, beeeeeeeehhh =_____= …. On 15.4 it worked! However, 15.4 is not an LTS, have no updates anymore, and it SUX! In my delusion I figured out that the version 8.0 has been released, and, OK, let’s try IT, it worked in the end =).

Ok, let’s start.

  1. Download from NVidia website
  2. Download the path from NVidia website (It allows Cuda to work with gcc > 5 ) .
  3.  In my computer when I run, it says that nouveal is blocking the installation. Therefore I put that bad guy in a blacklist.
    1. sudo emacs /etc/modprobe.d/blacklist-nouveau.confc
    2. Then, add the following line in that file:
      blacklist nouveau option nouveau modeset=0d. sudo update-initramfs -u
    3. Reboot computer
  4. Go to a TTY (Ctrl+Alt+F1), and login to your user.
  5. The path to work with gcc 5 needs the Cuda driver installed and the Cuda driver needs the gcc < 5. Therefore, I installed gcc-4.9 and g++-4.9 and changed the link to them.
    1. sudo apt-get install gcc-4.9 g++-4.9
    2. sudo rm /usr/bin/gcc
    3. sudo rm /usr/bin/g++
    4. sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
    5. sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++
  6. Go to the directory where you have the CUDA driver, and change it permissions to run
    chmod a+x
  7. Kill the lightdm to install the new graphic's card dr
    sudo service lightdm stop
  8.  Run the cuda driver
  9. Follow the installation….
  10. Return the links to gcc-5.x (Same as the steep 5)
  11. Install the path ./
  12. Put the exports on your .bashrc file:
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
    export PATH=$PATH:/usr/local/cuda/bin
  13. Try to make the Cuda Examples
    if( it works)
    Drink a beer =), Prosit!


This entry was posted in Caffe, Cuda, DeepLearning, English. Bookmark the permalink.

Leave a Reply

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