Theano: Cannot import theano with CNMeM enabled and cuDNN cannot be found.

Created on 3 May 2016  Â·  6Comments  Â·  Source: Theano/Theano

Hi, I don't know if it belongs here, but I don't know who else can help me.

I'm trying to import a theano with the CNMeM enabled, but I always get this error:

>>> import theano
ERROR (theano.sandbox.cuda): ERROR: Not using GPU. Initialisation of device gpu failed:
initCnmem: cnmemInit call failed! Reason=CNMEM_STATUS_OUT_OF_MEMORY. numdev=1

My theano configuration file .theanorc looks like this:

[global]
floatX = float32
device = gpu
optimizer = fast_run

[lib]
cnmem = 0.9

[nvcc]
fastmath = True

[blas]
ldflags = -llapack -lblas

[cmodule]
mac_framework_link=True

I've also tried running the python with specifying theano flags and I've also tried many different values:

$ THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32,lib.cnmem=0.9 python3

But I got same error.

I found here one similar issue (Initialisation of device gpu failed!), but I've already tried everything what is described there.

What I'm running it on:

  • Mac OS X 10.11.4
  • Xcode 7.2 (I had to downgrade it from 7.3)
  • Cuda 7.5.19
  • Python 3.5.1

Anyway I was able to at least import theano when I disable the CNMeM option (cnmem=0), it appears it is able to find my GPU device, but I've noticed the cuDNN is not available, which is really weird, because I copied all necessary files to the CUDA folder, so it should be ready to use.

>>> import theano
Using gpu device 0: GeForce GT 750M (CNMeM is disabled, cuDNN not available)

Apparently this is much more deeper problem then I thought. It's quite an issue for me, because I need to finish my thesis and running the NN on CPU takes really long time.

Thanks for any help.

Most helpful comment

Use a lower value then 0.9 for cnmem. If you share the GPU with the
monitor, as in your case, you can't take all the memory. This is the % of
total GPU memory, not the free GPU memory. Try 0.7 or 0.5 for example.

On Tue, May 3, 2016 at 3:20 AM, Vojtech Micka [email protected]
wrote:

Hi, I don't know if it belongs here, but I don't know who else can help me.

I'm trying to import a theano with the CNMeM enabled, but I always get
this error:

import theano
ERROR (theano.sandbox.cuda): ERROR: Not using GPU. Initialisation of device gpu failed:
initCnmem: cnmemInit call failed! Reason=CNMEM_STATUS_OUT_OF_MEMORY. numdev=1

My theano configuration file _.theanorc_ looks like this:

[global]
floatX = float32
device = gpu
optimizer = fast_run

[lib]
cnmem = 0.9

[nvcc]
fastmath = True

[blas]
ldflags = -llapack -lblas

[cmodule]
mac_framework_link=True

I've also tried running the python with specifying theano flags and I've
also tried many different values:

$ THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32,lib.cnmem=0.9 python3

But I got same error.

I found here one similar issue (Initialisation of device gpu failed!
https://github.com/Theano/Theano/issues/4302), but I've already tried
everything what is described there.

What I'm running it on:

  • Mac OS X 10.11.4
  • Xcode 7.2 (I had to downgrade it from 7.3)
  • Cuda 7.5.19
  • Python 3.5.1

Anyway I was able to at least import theano when I disable the CNMeM
option (cnmem=0), it appears it is able to find my GPU device, but I've
noticed the cuDNN is not available, which is really weird, because I copied
all necessary files to the CUDA folder, so it should be ready to use.

import theano
Using gpu device 0: GeForce GT 750M (CNMeM is disabled, cuDNN not available)

Apparently this is much more deeper problem then I thought. It's quite an
issue for me, because I need to finish my thesis and running the NN on CPU
takes really long time.

Thanks for any help.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/Theano/Theano/issues/4460

All 6 comments

Use a lower value then 0.9 for cnmem. If you share the GPU with the
monitor, as in your case, you can't take all the memory. This is the % of
total GPU memory, not the free GPU memory. Try 0.7 or 0.5 for example.

On Tue, May 3, 2016 at 3:20 AM, Vojtech Micka [email protected]
wrote:

Hi, I don't know if it belongs here, but I don't know who else can help me.

I'm trying to import a theano with the CNMeM enabled, but I always get
this error:

import theano
ERROR (theano.sandbox.cuda): ERROR: Not using GPU. Initialisation of device gpu failed:
initCnmem: cnmemInit call failed! Reason=CNMEM_STATUS_OUT_OF_MEMORY. numdev=1

My theano configuration file _.theanorc_ looks like this:

[global]
floatX = float32
device = gpu
optimizer = fast_run

[lib]
cnmem = 0.9

[nvcc]
fastmath = True

[blas]
ldflags = -llapack -lblas

[cmodule]
mac_framework_link=True

I've also tried running the python with specifying theano flags and I've
also tried many different values:

$ THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatX=float32,lib.cnmem=0.9 python3

But I got same error.

I found here one similar issue (Initialisation of device gpu failed!
https://github.com/Theano/Theano/issues/4302), but I've already tried
everything what is described there.

What I'm running it on:

  • Mac OS X 10.11.4
  • Xcode 7.2 (I had to downgrade it from 7.3)
  • Cuda 7.5.19
  • Python 3.5.1

Anyway I was able to at least import theano when I disable the CNMeM
option (cnmem=0), it appears it is able to find my GPU device, but I've
noticed the cuDNN is not available, which is really weird, because I copied
all necessary files to the CUDA folder, so it should be ready to use.

import theano
Using gpu device 0: GeForce GT 750M (CNMeM is disabled, cuDNN not available)

Apparently this is much more deeper problem then I thought. It's quite an
issue for me, because I need to finish my thesis and running the NN on CPU
takes really long time.

Thanks for any help.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/Theano/Theano/issues/4460

I'm getting same error with value 0.5 or 0.7.

Oh, okay, I've tried 10% and it works. Still no cuDNN available, but at least the CNMeM is now enabled.

But thanks @nouiz it makes more sense now. I thought it's % of free GPU memory, I was actually using two displays, so I guess I did't have any more memory to spare.

for cudnn, see this doc section:

http://deeplearning.net/software/theano/library/sandbox/cuda/dnn.html

On Tue, May 3, 2016 at 10:08 AM, Vojtech Micka [email protected]
wrote:

But thanks @nouiz https://github.com/nouiz it makes more sense now. I
thought it's % of free GPU memory, I was actually using two displays, so I
guess I did't have any more memory to spare.

—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/Theano/Theano/issues/4460#issuecomment-216539405

@nouiz Thanks a lot for help, everything is working now.

Was this page helpful?
0 / 5 - 0 ratings