Theano / cuDNN 7.6.2 / CUDA 10.1 / Ubuntu 18.04 --> not found


I managed to install CUDA and Theano to the point where Theano would use my GPU, but cuDNN failed. After adding paths to .theanorc, Theano would break with this error:

(base) jan@jan-Blade:~$ python
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import theano
Traceback (most recent call last):
File “”, line 1, in
File “/home/jan/miniconda3/lib/python3.7/site-packages/theano/”, line 156, in
import theano.gpuarray
File “/home/jan/miniconda3/lib/python3.7/site-packages/theano/gpuarray/”, line 33, in

File “/home/jan/miniconda3/lib/python3.7/site-packages/theano/gof/”, line 317, in dlimport
rval = import(module_name, {}, {}, [module_name])
ImportError: cannot open shared object file: No such file or directory is in the lib64 directory. My .theanorc looks like that:

floatX = float32
device = cuda0

preallocate = 0.9

library_path = /usr/local/cuda-10.1/lib64
include_path = /usr/local/cuda-10.1/include

The NVIDIA-SMI shows:

| NVIDIA-SMI 430.26 Driver Version: 430.26 CUDA Version: 10.2 |

I could not find an useful tips elsewhere, I would heavily appreciate your help!


although I had tried this before, I did not properly add

export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:{LD_LIBRARY_PATH:+:{LD_LIBRARY_PATH}}

to .bashrc