cuDNN not available

I want to use my macBook Pro mid-2012 to run notebooks on samples. It is cheaper then running p2 instance and does not depend on network connection. But I can’t make Theano work with cuDNN.

I have installed Theano, Keras and all of their dependencies as install-gpu.sh says. Also I installed CUDA driver, CUDA toolkit from NVidia site. Downloaded and unzipped cuDNN from the platform.fast.ai.

from theano.sandbox.cuda.dnn import *
print(dnn_available())
print(dnn_available.msg)

False
CUDA not available


$ ls /usr/local/cuda/lib/libcudnn*
/usr/local/cuda/lib/libcudnn.so /usr/local/cuda/lib/libcudnn.so.5.1.3
/usr/local/cuda/lib/libcudnn.so.5 /usr/local/cuda/lib/libcudnn_static.a

$ ls /usr/local/cuda/include/cudnn.h
/usr/local/cuda/include/cudnn.h

How to fix this?

Are you sure an NVIDIA GPU is inside your MacBook Pro? Many MacBooks have the Intel Iris GPU. If you do indeed have an NVIDIA GPU, you may have to download the MacOS version of cuDNN from NVIDIA’s web site as well. The cuDNN on platform.fast.ai is for Linux.

  1. GTX 650M is in the list of CUDA enabled cards
  2. I was able to compile CUDA sample in C and run deviceQuery. Here is output
  3. It looks like I need to sign up to some NVidia developer program before I can download cuDNN. But maybe it is the case…

I have downloaded cuDNN version for macOS, installed it instead of the Linux one and cleared theano cache - still have message that cuDNN is unavailable.

I don’t have a Mac to test on so can’t be of much help… Any Mac users here?

You may want to check that your CuDNN and CUDA versions match. You may be able to get more help on Stackoverflow with this question, since there might not be others here who have used this setup.

Have you set your paths correctly? I didn’t work on my Mac Pro until did that and set “device = gpu0” in the .theanorc file.

Yes, I have set DYLB_LIBRARY_PATH as it was recommended in the docs.

I have figured out the problem was due to System Integrity Protection blocking this variable. See #111 for example. Maybe there is more elegant solution, but I have just linked all the libraries in /usr/local/cuda/lib directory to /usr/local/lib and unset DYLB_LIBRARY_PATH.

unset DYLD_LIBRARY_PATH
ln -s /usr/local/cuda/lib/* /usr/local/lib/

Now I have cuDNN up and running on my laptop! :slight_smile: Thanks everybody for help!

P.S. This issues looks specific for macOS El Capitan.

2 Likes

Thanks, this also works for me on a mid-2012 MBP.

So in another thread I read that VGG requires more than 1GB GPU memory to run, which is not available on these old macbooks, so I’m going to switch to either AWS or running on a CPU.

1 Like