INSTALLING CUDA 8 ON UBUNTU 16.04: In the last months I’ve been working and experimenting with deep learning using CUDA in different models of NVIDIA cards. The process of getting a NVIDIA card running in linux is somehow simple but you need to have the right commands. In this post, I’m going to summarize what worked for me in the servers I manage (always using Ubuntu 16.x).

This process has been tested on the next NVIDIA cards:

  • NVIDIA GTX 1080
  • NVIDIA GTX 970
  • NVIDIA GTX 765m

So, step by step:

Step 1: Update your dist:

Step 2: Install compilations tool

Step 3: We are going to use a PPA repository which has updated NVIDIA drivers for Ubuntu:

Step 4: Now, we install the driver (and some other dependencies)

When finished, you must reboot your system:

Step 5: Download CUDA 8.0 from NVIDIA website:

Step 6: To enable the use of CUDA to all users in your machine, create a file in /etc/profile.d (for example /etc/profile.d/ and paste the following:

Step 7: The command above, assumes that CUDA was installed into /usr/local (default of the CUDA installer). If not, you should change the path in both $PATH and $LD_LIBRARY_PATH vars.

Step 8: You can test if your installation worked by compiling the examples in the samples directory of the CUDA distribution. To compile one example you only need to execute ‘make’ inside the example folder.

BONUS: if you get the following error when compiling a file:

Then, go to the file /usr/local/cuda/include/host_config.h and search the string above, it should be something like:

Comment that line and the error will disappear.