linuxcudatheanotheano-cuda

Theano search for CUDA 7.5 files but I have CUDA 8 installed. How to tell it to use CUDA 8?


I use theano 0.9.0, CUDA 8.0.61, gcc version 4.9.3, NVIDIA UNIX x86_64 Kernel Module 375.39, Ubuntu 16.04.2 LTS and I have a geforce 1060. CUDA works as I have done the tests.

But whenever I do the gpu test with theano (http://deeplearning.net/software/theano/tutorial/using_gpu.html) I get this error : ImportError: ('The following error happened while compiling the node', GpuElemwise{exp,no_inplace}((float64, vector)>), '\n', 'libnvrtc.so.7.5: cannot open shared object file: No such file or directory', '[GpuElemwise{exp,no_inplace}((float64, vector)>)]')

Which is really silly as I have CUDA 8, not CUDA 7.5 so of course it cannot find libnvrtc.so.7.5. How can I tell theano that I'm using CUDA 8 and not CUDA 7.5 ?

I have this overly complicated setup to my .bashrc :

and my .theanorc is :

[nvcc]

flags=-D_FORCE_INLINES

[global]

device = cuda0

[cuda]

root = /usr/local/cuda-8.0/


Solution

  • Edit: You should perhaps not insist on trying to make this work, given that your card is Pascal-generation and CUDA 7.5 is pre-Pascal. With that in mind...


    While @talonmies' answer is correct, at least one (and probably more) of the following things should actually get Theano working for you:

    1. Add a package repository for newer versions of CUDA targetted at *buntu 16.04 Xenial:

      deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial main
      deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial main
      

      put these file named, say /etc/apt/sources.list.d/graphics-drivers-ppa-xenial.list - but remember to remove/update it if you upgrade to newer version of *buntu. This should give you access to CUDA 7.5. Make sure not to install an older nVIDIA driver version, though.

    2. Manually install CUDA 7.5. You can download it from here. Adjust the settings mentioned in your question to point at /usr/local/cuda-7.5. Again, make sure you don't also install an older nVIDIA driver.

    3. Follow the installation instructions here. I'm not sure there's much more in there other than using pip, but maybe there is.

    Caveat: I've never used Theano myself.