Discussion:
[theano-users] Theano 0.9.0rc1 on Windows 10 x64 and Ubuntu 16.04 have same pygpu errors
侠贵族
2017-02-26 14:24:16 UTC
Permalink
For now, the latest cuda 8.0 has supported VS2015 under windows and gcc 5.3
under ubuntu according to their online document. And Ray Donnelly has
kindly uploaded his theano 0.9.0rc1 version onto anaconda cloud. To install
this package with conda run:conda install -c rdonnelly theano=0.9.0rc1.
This package has Integrate libgpuarray and pygpu.
For me, I under windows 10 x64 and miniconda3(python 3.6), I only installed
numpy (auto mkl), scipy, Vs2015 pro, CUDA 8.0 (the latest), set VS and CUDA
path Variable, set .theanorc file.

-

With cpu, it goes fine.
-

But with "device = cuda", the check_blas.py (
https://github.com/Theano/Theano/issues/5348) will throw error:
ERROR (theano.gpuarray): pygpu was configured but could not be imported
or is too old (version 0.6 or higher required).
If add import pygpu, the error changes: ERROR (theano.gpuarray): Could
not initialize pygpu, support disabled.
If change to "device = gpu", it works with warning and result:
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 670 (CNMeM is disabled, cuDNN not
available)......
Total execution time: 2.01s on GPU.

It's same on Ubuntu 16.04 (miniconda3, python 3.6, CUDA 8.0 latest, theano=0.9.0rc1,
set ~/.bashrc and ~/.theanorc). I have tested the cuda sample without
theano like deviceQuery, it worked successfully.
--
---
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.
Ramana Subramanyam
2017-02-26 23:39:59 UTC
Permalink
Hi,
Your system did not recognize cudnn. Check with the installation once
again, whether the header file is at the correct directory.

Ramana


For now, the latest cuda 8.0 has supported VS2015 under windows and gcc 5.3
Post by 侠贵族
under ubuntu according to their online document. And Ray Donnelly has
kindly uploaded his theano 0.9.0rc1 version onto anaconda cloud. To
install this package with conda run:conda install -c rdonnelly
theano=0.9.0rc1. This package has Integrate libgpuarray and pygpu.
For me, I under windows 10 x64 and miniconda3(python 3.6), I only
installed numpy (auto mkl), scipy, Vs2015 pro, CUDA 8.0 (the latest), set
VS and CUDA path Variable, set .theanorc file.
-
With cpu, it goes fine.
-
But with "device = cuda", the check_blas.py (
ERROR (theano.gpuarray): pygpu was configured but could not be
imported or is too old (version 0.6 or higher required).
If add import pygpu, the error changes: ERROR (theano.gpuarray): Could
not initialize pygpu, support disabled.
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will
be removed in the next release (v0.10). Please switch to the gpuarray
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
.....
Using gpu device 0: GeForce GTX 670 (CNMeM is disabled, cuDNN not
available)......
Total execution time: 2.01s on GPU.
It's same on Ubuntu 16.04 (miniconda3, python 3.6, CUDA 8.0 latest, theano=0.9.0rc1,
set ~/.bashrc and ~/.theanorc). I have tested the cuda sample without
theano like deviceQuery, it worked successfully.
--
---
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.
侠贵族
2017-02-27 09:36:41 UTC
Permalink
I did not install cuDnn. Dose the new cuda backend must need it?
--
---
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.
Kiuhnm Mnhuik
2017-02-27 12:42:31 UTC
Permalink
You can try disabling cuDnn:
http://deeplearning.net/software/theano_versions/0.9.X/library/config.html#config.config.dnn.enabled
Basically, add
[dnn]
enabled=False
to .theanorc.
Post by 侠贵族
I did not install cuDnn. Dose the new cuda backend must need it?
--
---
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.
侠贵族
2017-02-28 07:18:56 UTC
Permalink
It's not useful. I have copied cuDNN lib include and bin files to CUDA-8.0.
And set [dnn] enabled=True, [lib] cnmem=0.70.

With "device = gpu", It's successfully showing
Using gpu device 0: GeForce GTX 670 (CNMeM is enabled with initial size:
70.0% of memory, cuDNN 5110)
With "device =cuda", the error is same.


圚 2017幎2月27日星期䞀 UTC+8䞋午8:42:31Kiuhnm Mnhuik写道
Post by Kiuhnm Mnhuik
http://deeplearning.net/software/theano_versions/0.9.X/library/config.html#config.config.dnn.enabled
Basically, add
[dnn]
enabled=False
to .theanorc.
Post by 侠贵族
I did not install cuDnn. Dose the new cuda backend must need it?
--
---
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.
Gábor Borbély
2017-03-09 20:18:07 UTC
Permalink
Dear 䟠莵族 ,

Maybe you can try to set the cuda root:
http://deeplearning.net/software/theano/library/config.html#config.config.cuda.root

cheers
gaebor
Post by 侠贵族
It's not useful. I have copied cuDNN lib include and bin files to
CUDA-8.0. And set [dnn] enabled=True, [lib] cnmem=0.70.
With "device = gpu", It's successfully showing
70.0% of memory, cuDNN 5110)
With "device =cuda", the error is same.
圚 2017幎2月27日星期䞀 UTC+8䞋午8:42:31Kiuhnm Mnhuik写道
Post by Kiuhnm Mnhuik
http://deeplearning.net/software/theano_versions/0.9.X/library/config.html#config.config.dnn.enabled
Basically, add
[dnn]
enabled=False
to .theanorc.
Post by 侠贵族
I did not install cuDnn. Dose the new cuda backend must need it?
--
---
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.
侠贵族
2017-03-13 13:00:39 UTC
Permalink
No, it's not useful. My .theanorc file is
[global]
floatx = float32
cxx = C:\Users\Song\Miniconda3\Library\mingw-w64\bin\g++.exe
mode = FAST_RUN
device = cuda

[blas]
ldflags = -LC:\Users\Song\Miniconda3\Library\bin -lmkl_rt

[gcc]
cxxflags = -LC:\Users\Song\Miniconda3\Library\mingw-w64\include
-LC:\Users\Song\Miniconda3\Library\mingw-w64\lib -lm

[cuda]
root = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0

[nvcc]
flags=--cl-version=2015

[dnn]
enabled=True

[lib]
cnmem=0.70

the error is:

ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File
"C:\Users\Song\Miniconda3\lib\site-packages\theano\gpuarray\__init__.py",
line 164, in <module>
use(config.device)
File
"C:\Users\Song\Miniconda3\lib\site-packages\theano\gpuarray\__init__.py",
line 151, in use
init_dev(device)
File
"C:\Users\Song\Miniconda3\lib\site-packages\theano\gpuarray\__init__.py",
line 60, in init_dev
sched=config.gpuarray.sched)
File "pygpu\gpuarray.pyx", line 614, in pygpu.gpuarray.init
(pygpu/gpuarray.c:9211)
File "pygpu\gpuarray.pyx", line 566, in pygpu.gpuarray.pygpu_init
(pygpu/gpuarray.c:8902)
File "pygpu\gpuarray.pyx", line 1021, in
pygpu.gpuarray.GpuContext.__cinit__ (pygpu/gpuarray.c:13264)
pygpu.gpuarray.GpuArrayException: Error loading library: -1



圚 2017幎3月10日星期五 UTC+8䞊午4:18:07Gábor Borbély写道
Post by Gábor Borbély
Dear 䟠莵族 ,
http://deeplearning.net/software/theano/library/config.html#config.config.cuda.root
cheers
gaebor
Post by 侠贵族
It's not useful. I have copied cuDNN lib include and bin files to
CUDA-8.0. And set [dnn] enabled=True, [lib] cnmem=0.70.
With "device = gpu", It's successfully showing
70.0% of memory, cuDNN 5110)
With "device =cuda", the error is same.
圚 2017幎2月27日星期䞀 UTC+8䞋午8:42:31Kiuhnm Mnhuik写道
Post by Kiuhnm Mnhuik
http://deeplearning.net/software/theano_versions/0.9.X/library/config.html#config.config.dnn.enabled
Basically, add
[dnn]
enabled=False
to .theanorc.
Post by 侠贵族
I did not install cuDnn. Dose the new cuda backend must need it?
--
---
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.
Michael Klachko
2017-03-24 01:56:04 UTC
Permalink
I have the same error. I did both conda commands to install libgpuarray and
pygpu, and both seemed to be installed successfully. However, I get this:

In [8]: import theano

ERROR:theano.gpuarray:Could not initialize pygpu, support disabled

Traceback (most recent call last):
File "c:\Theano\theano\gpuarray\__init__.py", line 164, in <module>
use(config.device)
File "c:\Theano\theano\gpuarray\__init__.py", line 151, in use
init_dev(device)
File "c:\Theano\theano\gpuarray\__init__.py", line 60, in init_dev
sched=config.gpuarray.sched)
File "pygpu\gpuarray.pyx", line 614, in pygpu.gpuarray.init (pygpu/gpuarray
.c:9415)
File "pygpu\gpuarray.pyx", line 566, in pygpu.gpuarray.pygpu_init (pygpu/
gpuarray.c:9106)
File "pygpu\gpuarray.pyx", line 1021, in pygpu.gpuarray.GpuContext.__cinit__
(pygpu/gpuarray.c:13468)
GpuArrayException: Error loading library: -1


Also, I can import pygpu, but when I run tests, I get this:

In [1]: import pygpu

In [2]: pygpu.test()

pygpu is installed in C:\Anaconda\lib\site-packages\pygpu
NumPy version 1.12.1
NumPy relaxed strides checking option: True
NumPy is installed in C:\Anaconda\lib\site-packages\numpy
Python version 2.7.13 |Anaconda 2.2.0 (64-bit)| (default, Dec 19 2016, 13:29
:36) [MSC v.1500 64 bit (AMD64)]
nose version 1.3.7
EEEEEE
======================================================================
ERROR: Failure: RuntimeError (No test device specified. Specify one using
the DEVICE or GPUARRAY_TEST_DEVICE environment variables.)


I'm using Theano 0.9.0 on Windows 10, and here's my theanorc file:

[cuda]
root=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin

[nvcc]
flags=-LC:\Anaconda\libs
fastmath=True
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

[global]
device = cuda
floatX = float32
warn_float64=warn
int_division=raise
print_active_device = True
optimizer_including = cudnn
allow_gc = False
assert_no_cpu_op=warn
warn.round=False

[lib]
cnmem = 0.4

[dnn]
enabled = True
Post by 侠贵族
No, it's not useful. My .theanorc file is
[global]
floatx = float32
cxx = C:\Users\Song\Miniconda3\Library\mingw-w64\bin\g++.exe
mode = FAST_RUN
device = cuda
[blas]
ldflags = -LC:\Users\Song\Miniconda3\Library\bin -lmkl_rt
[gcc]
cxxflags = -LC:\Users\Song\Miniconda3\Library\mingw-w64\include
-LC:\Users\Song\Miniconda3\Library\mingw-w64\lib -lm
[cuda]
root = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0
[nvcc]
flags=--cl-version=2015
[dnn]
enabled=True
[lib]
cnmem=0.70
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
File
"C:\Users\Song\Miniconda3\lib\site-packages\theano\gpuarray\__init__.py",
line 164, in <module>
use(config.device)
File
"C:\Users\Song\Miniconda3\lib\site-packages\theano\gpuarray\__init__.py",
line 151, in use
init_dev(device)
File
"C:\Users\Song\Miniconda3\lib\site-packages\theano\gpuarray\__init__.py",
line 60, in init_dev
sched=config.gpuarray.sched)
File "pygpu\gpuarray.pyx", line 614, in pygpu.gpuarray.init
(pygpu/gpuarray.c:9211)
File "pygpu\gpuarray.pyx", line 566, in pygpu.gpuarray.pygpu_init
(pygpu/gpuarray.c:8902)
File "pygpu\gpuarray.pyx", line 1021, in
pygpu.gpuarray.GpuContext.__cinit__ (pygpu/gpuarray.c:13264)
pygpu.gpuarray.GpuArrayException: Error loading library: -1
圚 2017幎3月10日星期五 UTC+8䞊午4:18:07Gábor Borbély写道
Post by Gábor Borbély
Dear 䟠莵族 ,
http://deeplearning.net/software/theano/library/config.html#config.config.cuda.root
cheers
gaebor
Post by 侠贵族
It's not useful. I have copied cuDNN lib include and bin files to
CUDA-8.0. And set [dnn] enabled=True, [lib] cnmem=0.70.
With "device = gpu", It's successfully showing
70.0% of memory, cuDNN 5110)
With "device =cuda", the error is same.
圚 2017幎2月27日星期䞀 UTC+8䞋午8:42:31Kiuhnm Mnhuik写道
Post by Kiuhnm Mnhuik
http://deeplearning.net/software/theano_versions/0.9.X/library/config.html#config.config.dnn.enabled
Basically, add
[dnn]
enabled=False
to .theanorc.
Post by 侠贵族
I did not install cuDnn. Dose the new cuda backend must need it?
--
---
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.
Michael Klachko
2017-03-24 03:35:04 UTC
Permalink
I updated my CUDA from 7.5 to 8.0, and the error changed to:


In [1]: import theano
ERROR:theano.gpuarray:Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "c:\Theano\theano\gpuarray\__init__.py", line 164, in <module>
use(config.device)
File "c:\Theano\theano\gpuarray\__init__.py", line 151, in use
init_dev(device)
File "c:\Theano\theano\gpuarray\__init__.py", line 66, in init_dev
avail = dnn.dnn_available(name)
File "c:\Theano\theano\gpuarray\dnn.py", line 177, in dnn_available
if not dnn_present():
File "c:\Theano\theano\gpuarray\dnn.py", line 168, in dnn_present
dnn_present.msg)
RuntimeError: You enabled cuDNN, but we aren't able to use it: cannot compile with cuDNN. We got this error:
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcudnn
collect2.exe: error: ld returned 1 exit status



It looks like it cannot find cudnn, but nothing has changed, when I use
device=gpu0, cudnn works 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.
Michael Klachko
2017-03-28 17:20:44 UTC
Permalink
In my case, the problem was related to the old version of mingw64 that I
installed in the past. I removed it, installed mingw toolchain with conda,
and updated the path to it in theanorc, now everything works.
Post by Michael Klachko
In [1]: import theano
ERROR:theano.gpuarray:Could not initialize pygpu, support disabled
File "c:\Theano\theano\gpuarray\__init__.py", line 164, in <module>
use(config.device)
File "c:\Theano\theano\gpuarray\__init__.py", line 151, in use
init_dev(device)
File "c:\Theano\theano\gpuarray\__init__.py", line 66, in init_dev
avail = dnn.dnn_available(name)
File "c:\Theano\theano\gpuarray\dnn.py", line 177, in dnn_available
File "c:\Theano\theano\gpuarray\dnn.py", line 168, in dnn_present
dnn_present.msg)
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcudnn
collect2.exe: error: ld returned 1 exit status
It looks like it cannot find cudnn, but nothing has changed, when I use
device=gpu0, cudnn works 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.
yuzhen lu
2017-06-04 11:29:35 UTC
Permalink
Hi, Michael:

I probably got the same issue as you . I use conda install theano, pygpu.
Both theano and pygpu can be imported successfully, but implementing
pygpu.test() results in those errors.

Can you post you workable .theanorc file?
Post by Michael Klachko
In my case, the problem was related to the old version of mingw64 that I
installed in the past. I removed it, installed mingw toolchain with conda,
and updated the path to it in theanorc, now everything works.
Post by Michael Klachko
In [1]: import theano
ERROR:theano.gpuarray:Could not initialize pygpu, support disabled
File "c:\Theano\theano\gpuarray\__init__.py", line 164, in <module>
use(config.device)
File "c:\Theano\theano\gpuarray\__init__.py", line 151, in use
init_dev(device)
File "c:\Theano\theano\gpuarray\__init__.py", line 66, in init_dev
avail = dnn.dnn_available(name)
File "c:\Theano\theano\gpuarray\dnn.py", line 177, in dnn_available
File "c:\Theano\theano\gpuarray\dnn.py", line 168, in dnn_present
dnn_present.msg)
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcudnn
collect2.exe: error: ld returned 1 exit status
It looks like it cannot find cudnn, but nothing has changed, when I use
device=gpu0, cudnn works 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.
Michael Klachko
2017-06-05 16:50:56 UTC
Permalink
Sure, please take a look at this thread:
https://github.com/Theano/libgpuarray/issues/264#issuecomment-306239789
Post by yuzhen lu
I probably got the same issue as you . I use conda install theano, pygpu.
Both theano and pygpu can be imported successfully, but implementing
pygpu.test() results in those errors.
Can you post you workable .theanorc file?
Post by Michael Klachko
In my case, the problem was related to the old version of mingw64 that I
installed in the past. I removed it, installed mingw toolchain with conda,
and updated the path to it in theanorc, now everything works.
Post by Michael Klachko
In [1]: import theano
ERROR:theano.gpuarray:Could not initialize pygpu, support disabled
File "c:\Theano\theano\gpuarray\__init__.py", line 164, in <module>
use(config.device)
File "c:\Theano\theano\gpuarray\__init__.py", line 151, in use
init_dev(device)
File "c:\Theano\theano\gpuarray\__init__.py", line 66, in init_dev
avail = dnn.dnn_available(name)
File "c:\Theano\theano\gpuarray\dnn.py", line 177, in dnn_available
File "c:\Theano\theano\gpuarray\dnn.py", line 168, in dnn_present
dnn_present.msg)
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lcudnn
collect2.exe: error: ld returned 1 exit status
It looks like it cannot find cudnn, but nothing has changed, when I use
device=gpu0, cudnn works fine.
--
---
You received this message because you are subscribed to a topic in the
Google Groups "theano-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/theano-users/8tm-8Zlk4gI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
For more options, visit https://groups.google.com/d/optout.
--
---
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.
Frédéric Bastien
2017-02-27 13:46:39 UTC
Permalink
It is optional. But to get the fastest convolution, it is better to have
it. If you don't use convolution then you don't need it.

Free
Post by 侠贵族
I did not install cuDnn. Dose the new cuda backend must need it?
--
---
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
For more options, visit https://groups.google.com/d/optout.
--
---
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...