theano with GPU support

368 views Asked by At

I installed cuda and cudnn following the instructions here: https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html

following that I set up a conda environment with python3.8 and installed theano 1.0.4. Then I createa a .theanorc in my home directory:

[global]
floatX = float32
device = cuda0
force_device = True
optimizer_including=cudnn

[blas]
ldflags = -L/usr/local/lib -lopenblas

[dnn]
include_path=/usr/local/cuda-11.3/include
library_path=/usr/local/cuda-11.3/lib64

[cuda]
root=/usr/local/cuda-11.3/

Since at first theano complained that it couldn't find cudnn.h, I linked all the cudnn stuff into the /usr/local/cuda-11.3/ directory.

Following that I tried import theano in my python session, but I got:

Can not use cuDNN on context None: cannot compile with cuDNN. We got this error:
b"/home/hadron/myutils/anaconda3/envs/myenv/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: /usr/local/cuda-11.3/lib64/libcudnn.so: undefined reference to `memcpy@GLIBC_2.14'\ncollect2: error: ld returned 1 exit status\n"

and now I'm stuck here. Anyone can help? This is the output of nvidia-smi:

(myenv) hadronmachine:~$ nvidia-smi 
Mon Apr 19 10:43:37 2021       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 465.19.01    Driver Version: 465.19.01    CUDA Version: 11.3     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
|  0%   38C    P8     7W / 210W |     72MiB /  8119MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1080      G   /usr/lib/xorg/Xorg                 70MiB |
+-----------------------------------------------------------------------------+

I am running ubuntu 20.04 and the output of uname -a is:

Linux hadron01 5.4.0-53-generic #59-Ubuntu SMP Wed Oct 21 09:38:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Ultimately I want to run Pymc3 w/ GPU support, which uses Theano as backend

0

There are 0 answers