12

I wanna share my experience on installing CUDA 7.5 (in order to use with Theano) on Ubuntu 15.10.

  1. I installed Ubuntu 15.10 and the video driver (352.41) from the "Additional Drivers" tab;

  2. Installed few dependencies like nvidia-modprobe (fix permissions problems), and for the samples compiling freeglut3-dev libx11-dev libxmu-dev libxi-dev libglu1-mesa-dev

  3. And because it needs GCC 4.9: sudo apt-get install gcc-4.9 g++-4.9, then made symlinks in /opt/compiler_cuda(created the folder with an arbitrary name of my choice) as follows:

    $ ls -la /opt/compiler_cuda/
    lrwxrwxrwx 1 root root   22 Nov  2 16:14 cc -> /opt/compiler_cuda/gcc
    lrwxrwxrwx 1 root root   16 Nov  2 16:13 g++ -> /usr/bin/g++-4.9
    lrwxrwxrwx 1 root root   16 Nov  2 16:12 gcc -> /usr/bin/gcc-4.9
    

    Registered update-alternatives with:

    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
    
  4. Downloaded "runfile (local)" 15.04 version, from CUDA 7.5 Downloads; and installed with:

    sudo sh cuda_7.5.18_linux.run --silent --toolkit --override
    sudo sh cuda_7.5.18_linux.run --silent --samples --override
    

    and appended in .bash_aliases (.bashrc reads it):

    export PATH=/usr/local/cuda-7.5/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH
    
  5. Appended compiler-bindir = /opt/compiler_cuda in nvcc.profile, so nvcc can use it.

And possibly someone can tell me if I'm going to fry my card for using wrong toolkit version?!

muru
  • 193,181
  • 53
  • 473
  • 722
Guilherme Higashi
  • 343
  • 1
  • 2
  • 11
  • Where is the question? – Goddard Nov 02 '15 at 22:18
  • last line. I want to know if it's "dangerous" to use cuda toolkit for 15.04 version. I've used their deb package before, but it messes with the driver, and I couldn't boot sometimes... that's why i went thru this unorthodox process... – Guilherme Higashi Nov 02 '15 at 22:23
  • `sudo mkdir /opt/compiler_cuda` `sudo ln -s /usr/bin/gcc-4.9 gcc` `sudo ln -s /usr/bin/g++-4.9 g++` `sudo ln -s /opt/compiler_cuda/gcc cc` – Brian Low May 08 '16 at 07:25

2 Answers2

2

It isn't dangerous to use the CUDA toolkit from 15.04. The toolkit interfaces from the nvidia driver which is all the Nvidia stack and code base. That is why people use CUDA because it gets them closer to the hardware to get performance increases.

Goddard
  • 4,674
  • 2
  • 32
  • 51
  • From what I understand, all of Nvidia's drivers are backwards compatible with all versions of CUDA runtime libraries. This is so newer drivers do not break older CUDA code. – FizxMike Jan 07 '16 at 23:46
  • 1
    That may be, but we all know how well Nvidia and other companies support Linux. Last I checked they offered cuda 7.5 with 352. I wanted to spend time using cuda and not trying to get the perfect configuration with newer drivers. I usually go with what is reported as working by others and at the time that was 352 which is bundled with 7.5 from the nvidia site. Of course things are always moving and do what works for you. – Goddard Jan 08 '16 at 00:48
  • 1
    I did run into problems related to gcc versions. For example, CUDA 7.5: cuda_runtime.h complains that it is not compatible with gcc version > 4.9. Ubuntu 15.10 comes with gcc 5.0 stock, so you have to play games with symlinks in /usr/bin to get the cuda sample to compile (which I am used to) - however in your own compile script you can easily designate gcc-4.9. To your point, I agree that it is nice to have things just work... but the beauty of linux is that you can dig in and fix it yourself. – FizxMike Jan 08 '16 at 01:38
  • 1
    Yeah being able to dig into stuff and fix them is the best I love Linux, but some times you want to work on what you originally intended rather then getting side tracked. That is why 14.04 and cuda 7.5 with 352 is the easiest route to take. – Goddard Jan 08 '16 at 01:40
  • Right. I WAS sidetracked... there goes an afternoon that I will never get back! – FizxMike Jan 08 '16 at 01:41
0

This is a shady idea overall. You will be able to make your own .cu cuda files, compile them, and run them. But if you try to link against libcudart to do basic CUDA api calls, it will fail. (In other words, cpp files that include cuda libraries won't work). You have two difference driver sets in play, different versions. One is libcudart and other cuda libs from apt-get. Another version is from the run file.

Overall it should either be apt-get for all CUDA files, or build all cuda by hand. Not mix the two.

But the instructions on running the .run file were very helpful. Thanks.

  • Notice that he didn't install the driver from the CUDA 7.5 installer. As long as the driver from apt-get is NEWER than the driver from the toolkit, it will work. – FizxMike Jan 07 '16 at 23:52