Discussion:
[theano-users] cudnn detected in cuda backend but not in gpuarray backend
Akshay Chaturvedi
2017-07-02 07:24:19 UTC
Permalink
I have installed theano-0.9.0. When I run the program gputest.py using cuda
backend. It gives the following output.

WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be
removed in the next release (v0.10). Please switch to the gpuarray
backend. You can get more information about how to switch at this URL:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

Using gpu device 0: GeForce GTX 960 (CNMeM is disabled, cuDNN 5110)
[GpuElemwise{exp,no_inplace}(<CudaNdarrayType(float32, vector)>),
HostFromGpu(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.377993 seconds
Result is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761
1.62323296]
Used the gpu

But if I run the program using gpuarray backend, it gives an error.

ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/theano/gpuarray/__init__.py", line
164, in <module>
use(config.device)
File "/usr/lib/python2.7/dist-packages/theano/gpuarray/__init__.py", line
151, in use
init_dev(device)
File "/usr/lib/python2.7/dist-packages/theano/gpuarray/__init__.py", line
68, in init_dev
context.cudnn_handle = dnn._make_handle(context)
File "/usr/lib/python2.7/dist-packages/theano/gpuarray/dnn.py", line 80,
in _make_handle
cudnn = _dnn_lib()
File "/usr/lib/python2.7/dist-packages/theano/gpuarray/dnn.py", line 67,
in _dnn_lib
raise RuntimeError('Could not find cudnn library (looked for v5[.1])')
RuntimeError: Could not find cudnn library (looked for v5[.1])
[Elemwise{exp,no_inplace}(<TensorType(float32, vector)>)]
Looping 1000 times took 1.907746 seconds
Result is [ 1.23178029 1.61879337 1.52278066 ..., 2.20771813 2.29967761
1.62323284]
Used the cpu

I have copied the cudnn files to the cuda root folder. I have also tried
ldconfig but it didn't work. Kindly help.

Thanks,
Akshay
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Akshay Chaturvedi
2017-07-02 08:10:14 UTC
Permalink
I also ran pygpu.test() setting device to cuda0. The only error it gives is
GpuArrayException: ('malloc: Resource temporarily unavailable', 6).
Otherwise, it runs fine.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Akshay Chaturvedi
2017-07-02 12:58:40 UTC
Permalink
I was able to solve the issue by setting CPLUS_INCLUDE_PATH. Now the output
looks like this
Using cuDNN version 5110 on context None
Mapped name None to device cuda0: GeForce GTX 960 (0000:01:00.0)
[GpuElemwise{exp,no_inplace}(<GpuArrayType(float32, (False,))>),
HostFromGpu(gpuarray)(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.196515 seconds
Result is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761
1.62323296]
Used the cpu

The file is unable to detect that the program ran on gpu but it's a
seperate issue. I am attaching the file gputest.py.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Pascal Lamblin
2017-07-03 22:04:41 UTC
Permalink
The test actually ran on GPU, as evidenced by it printing "GpuElemwise".
The issue is you are using a really old version of "gputest", which does
not correctly detect the new back-end. Please use the latest version at
http://deeplearning.net/software/theano/tutorial/using_gpu.html#testing-the-gpu
Post by Akshay Chaturvedi
I was able to solve the issue by setting CPLUS_INCLUDE_PATH. Now the
output looks like this
Using cuDNN version 5110 on context None
Mapped name None to device cuda0: GeForce GTX 960 (0000:01:00.0)
[GpuElemwise{exp,no_inplace}(<GpuArrayType(float32, (False,))>),
HostFromGpu(gpuarray)(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.196515 seconds
Result is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761
1.62323296]
Used the cpu
The file is unable to detect that the program ran on gpu but it's a
seperate issue. I am attaching the file gputest.py.
--
---
You received this message because you are subscribed to the Google Groups "theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to theano-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...