Updated to rel-0.9.0 and subsequently to development. Both has the following error after I change device = gpu0 to device = cuda0. I've tried uninstall and reinstall latest pygpu and libgpuarray as well. Issue goes away when I revert back to rel-0.8.2. Running Windows 7 / Python 2.7 on GTX980 TI / Cuda 7.5. Any advice would be appreciated. Thanks!
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 175, in <module>
use(config.device)
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 162, in use
init_dev(device, preallocate=preallocate)
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 65, 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
Reverting back to rel-0.8.2.
Using gpu device 0: GeForce GTX 980 Ti (CNMeM is enabled with initial size: 80.0% of memory, cuDNN 5005)
[GpuElemwise{exp,no_inplace}(<CudaNdarrayType(float32, vector)>), HostFromGpu(GpuElemwise{exp,no_inplace}.0)]
Looping 1000 times took 0.268000 seconds
Result is [ 1.23178029 1.61879349 1.52278066 ..., 2.20771813 2.29967761
1.62323296]
Used the gpu
Updating to rel-0.9.0 actually results in a different error:
ImportError Traceback (most recent call last)
<ipython-input-2-1bbe90691023> in <module>()
----> 1 from theano import function, config, shared, tensor
2 import numpy
3 import time
C:\Anaconda2\lib\site-packages\theano\__init__.py in <module>()
64 object2, utils)
65
---> 66 from theano.compile import (
67 SymbolicInput, In,
68 SymbolicOutput, Out,
C:\Anaconda2\lib\site-packages\theano\compile\__init__.py in <module>()
8 SpecifyShape, specify_shape, register_specify_shape_c_code)
9
---> 10 from theano.compile.function_module import *
11
12 from theano.compile.mode import *
C:\Anaconda2\lib\site-packages\theano\compile\function_module.py in <module>()
16
17 import theano
---> 18 from theano import config, gof
19 from theano.compat import izip
20 from theano.gof import graph
ImportError: cannot import name gof
Updating to development version will have the same "GpuArrayException: Error loading library: -1"
Updating Nvidia driver from 375.95 => 382.33 the error code changes to 0.
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 175, in <module>
use(config.device)
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 162, in use
init_dev(device, preallocate=preallocate)
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 65, 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: 0**
Can you try with the latest development version of libgpuarray?
It should print a more informative error message.
Thanks. I was able to compile the libgpuarray (gpuarray.lib, gpuarray-static.lib, gpuarray.dll, gpuarray.exp under \libgpuarray\lib\Release using VC2012 but run into the following error message when I tried to run python setup.py build.
running build
running build_py
copying pygpu\version.py -> build\lib.win-amd64-2.7\pygpu
running egg_info
writing requirements to pygpu.egg-info\requires.txt
writing pygpu.egg-info\PKG-INFO
writing top-level names to pygpu.egg-info\top_level.txt
writing dependency_links to pygpu.egg-info\dependency_links.txt
reading manifest file 'pygpu.egg-info\SOURCES.txt'
writing manifest file 'pygpu.egg-info\SOURCES.txt'
running build_ext
building 'pygpu.gpuarray' extension
c:\mingw-w64\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -DGPUARRAY_SHARED -IC
\include -IC:\libgpuarray\src -IC:\Anaconda2\include -IC:\Anaconda2\PC -c pygpu/
elease\pygpu\gpuarray.o
In file included from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/nd
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/nd
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ar
from pygpu/gpuarray.c:472:
C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h
a2\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h(12) : War
sable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#pragma message(_WARN___LOC__"Using deprecated NumPy API, disable it by " \
^
pygpu/gpuarray.c: In function '__pyx_pf_5pygpu_8gpuarray_10GpuContext_4__cinit__
pygpu/gpuarray.c:13461:17: warning: assignment discards 'const' qualifier from p
rs]
__pyx_t_1 = gpucontext_error(NULL, __pyx_v_err);
^
pygpu/gpuarray.c: In function '__pyx_f_5pygpu_8gpuarray_8GpuArray___index_helper
pygpu/gpuarray.c:20561:38: warning: passing argument 1 of 'PySlice_GetIndicesEx'
patible-pointer-types]
__pyx_t_9 = PySlice_GetIndicesEx(__pyx_v_key, (__pyx_v_self->ga.dimensions[
t), ((Py_ssize_t *)__pyx_v_stop), ((Py_ssize_t *)__pyx_v_step), (&__pyx_v_dummy)
ERR(0, 1609, __pyx_L1_error)
^
In file included from C:\Anaconda2\include/Python.h:112:0,
from pygpu/gpuarray.c:40:
C:\Anaconda2\include/sliceobject.h:37:17: note: expected 'PySliceObject * {aka s
type 'PyObject * {aka struct _object *}'
PyAPI_FUNC(int) PySlice_GetIndicesEx(PySliceObject *r, Py_ssize_t length,
^
pygpu/gpuarray.c: In function '__Pyx_RaiseNeedMoreValuesError':
pygpu/gpuarray.c:39091:18: warning: unknown conversion type character 'z' in for
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpac
^
pygpu/gpuarray.c:39091:18: warning: format '%s' expects argument of type 'char *
aka long long int}' [-Wformat=]
pygpu/gpuarray.c:39091:18: warning: too many arguments for format [-Wformat-extr
pygpu/gpuarray.c: In function '__Pyx_RaiseTooManyValuesError':
pygpu/gpuarray.c:39098:18: warning: unknown conversion type character 'z' in for
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
^
pygpu/gpuarray.c:39098:18: warning: too many arguments for format [-Wformat-extr
pygpu/gpuarray.c: In function '__Pyx_RaiseArgtupleInvalid':
pygpu/gpuarray.c:39508:18: warning: unknown conversion type character 'z' in for
"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional ar
given)",
^
pygpu/gpuarray.c:39508:18: warning: format '%s' expects argument of type 'char *
aka long long int}' [-Wformat=]
pygpu/gpuarray.c:39508:18: warning: unknown conversion type character 'z' in for
pygpu/gpuarray.c:39508:18: warning: too many arguments for format [-Wformat-extr
pygpu/gpuarray.c: In function '__Pyx_ImportType':
pygpu/gpuarray.c:44239:13: warning: unknown conversion type character 'z' in for
"%s.%s size changed, may indicate binary incompatibility. Expected
^
pygpu/gpuarray.c:44239:13: warning: unknown conversion type character 'z' in for
pygpu/gpuarray.c:44239:13: warning: too many arguments for format [-Wformat-extr
pygpu/gpuarray.c:44245:13: warning: unknown conversion type character 'z' in for
"%.200s.%.200s has the wrong size, try recompiling. Expected %zd, g
^
pygpu/gpuarray.c:44245:13: warning: unknown conversion type character 'z' in for
pygpu/gpuarray.c:44245:13: warning: too many arguments for format [-Wformat-extr
pygpu/gpuarray.c: At top level:
pygpu/gpuarray.c:21664:12: warning: '__pyx_pw_5pygpu_8gpuarray_8GpuArray_17__boo
tion]
static int __pyx_pw_5pygpu_8gpuarray_8GpuArray_17__bool__(PyObject *__pyx_v_sel
^
writing build\temp.win-amd64-2.7\Release\pygpu\gpuarray.def
c:\mingw-w64\mingw64\bin\gcc.exe -shared -s build\temp.win-amd64-2.7\Release\pyg
elease\pygpu\gpuarray.def -LC:\libgpuarray\lib -LC:\Anaconda2\libs -LC:\Anaconda
amd64 -lgpuarray -lpython27 -lmsvcr90 -o build\lib.win-amd64-2.7\pygpu\gpuarray.
c:/mingw-w64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-
uarray
collect2.exe: error: ld returned 1 exit status
error: command 'c:\\mingw-w64\\mingw64\\bin\\gcc.exe' failed with exit status 1
set:
device = cuda0
works fine for me
Thanks. That's what I've set to. Also tried device=cuda. Only device=gpu0 works on the earlier release.
Hi, I have also encountered the same problem. Have you already solved this problem?
hi,i also meet this error,when i install the libgpuarray and try to set device = cuda0, it does't work.
Then i run the python -c "import pygpu;pygpu.test()"
it show me that

my os is 14.04, and the cuda is 7.0
If the nvidia driver version is greater than 373.06, then in addition to setting DEVICE=cuda0, set GPUARRAY_FORCE_CUDA_DRIVER_LOAD=1 and try. This worked for me (The libgpuarray version I am using is 0.6.1.)
@yilisg I suspect there is a linking error because libgpuarray was compiled with VS2012, but the Python module is getting compiled with mingw.
Ping @abergeron
Yes, you need to compile the library with the same compiler as your python binary.
The easiest way to do this is to use conda and is also the only configuration we support on Windows.
@deepali-c GPUARRAY_FORCE_CUDA_DRIVER_LOAD does nothing in 0.6.4 and 0.6.5 and should not be used unless you get a message telling you that it is required.
@alyato device=cuda0 it a Theano setting not a pygpu one. Please read and follow the instructions at the bottom of the output you posted.
Still can't link after compiling everything with VS9...
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 75%] Building C object src/CMakeFiles/gpuarray-static.dir/gpuarray_buffer_opencl.c.obj
gpuarray_buffer_opencl.c
C:\libgpuarray\src\gpuarray_buffer_opencl.c(880) : warning C4090: 'function' : different 'const' qualifiers
C:\libgpuarray\src\gpuarray_buffer_opencl.c(881) : warning C4090: 'function' : different 'const' qualifiers
C:\libgpuarray\src\gpuarray_buffer_opencl.c(887) : warning C4090: 'function' : different 'const' qualifiers
C:\libgpuarray\src\gpuarray_buffer_opencl.c(901) : warning C4090: 'function' : different 'const' qualifiers
C:\libgpuarray\src\gpuarray_buffer_opencl.c(944) : warning C4090: 'function' : different 'const' qualifiers
C:\libgpuarray\src\gpuarray_buffer_opencl.c(952) : warning C4090: 'function' : different 'const' qualifiers
[ 76%] Building C object src/CMakeFiles/gpuarray-static.dir/gpuarray_blas_opencl_clblas.c.obj
gpuarray_blas_opencl_clblas.c
c:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 78%] Building C object src/CMakeFiles/gpuarray-static.dir/gpuarray_blas_opencl_clblast.c.obj
gpuarray_blas_opencl_clblast.c
c:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 79%] Building C object src/CMakeFiles/gpuarray-static.dir/gpuarray_strl.c.obj
gpuarray_strl.c
[ 80%] Building C object src/CMakeFiles/gpuarray-static.dir/gpuarray_mkstemp.c.obj
gpuarray_mkstemp.c
[ 82%] Building C object src/CMakeFiles/gpuarray-static.dir/util/strb.c.obj
strb.c
[ 83%] Building C object src/CMakeFiles/gpuarray-static.dir/util/error.c.obj
error.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
C:\libgpuarray\src\util\error.c(37) : warning C4996: 'vsnprintf': This function or variable may be unsafe. Consider usin
g vsnprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\stdio.h(350) : see d
eclaration of 'vsnprintf'
[ 84%] Building C object src/CMakeFiles/gpuarray-static.dir/util/xxhash.c.obj
xxhash.c
[ 85%] Building C object src/CMakeFiles/gpuarray-static.dir/util/integerfactoring.c.obj
integerfactoring.c
C:\libgpuarray\src\util\integerfactoring.c : warning C4819: The file contains a character that cannot be represented in
the current code page (936). Save the file in Unicode format to prevent data loss
C:\libgpuarray\src\util\integerfactoring.c(850) : warning C4244: 'function' : conversion from 'uint64_t' to 'int', possi
ble loss of data
C:\libgpuarray\src\util\integerfactoring.c(963) : warning C4244: 'function' : conversion from 'uint64_t' to 'int', possi
ble loss of data
C:\libgpuarray\src\util\integerfactoring.c(1084) : warning C4244: 'function' : conversion from 'uint64_t' to 'int', poss
ible loss of data
C:\libgpuarray\src\util\integerfactoring.c(1085) : warning C4244: 'function' : conversion from 'uint64_t' to 'int', poss
ible loss of data
C:\libgpuarray\src\util\integerfactoring.c(1287) : warning C4996: 'sprintf': This function or variable may be unsafe. Co
nsider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\stdio.h(366) : see d
eclaration of 'sprintf'
C:\libgpuarray\src\util\integerfactoring.c(1296) : warning C4996: 'sprintf': This function or variable may be unsafe. Co
nsider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\stdio.h(366) : see d
eclaration of 'sprintf'
[ 87%] Building C object src/CMakeFiles/gpuarray-static.dir/util/skein.c.obj
skein.c
C:\libgpuarray\src\util\skein.c(55) : warning C4244: '=' : conversion from 'u64b_t' to 'u08b_t', possible loss of data
C:\libgpuarray\src\util\skein.c(56) : warning C4244: '=' : conversion from 'u64b_t' to 'u08b_t', possible loss of data
C:\libgpuarray\src\util\skein.c(57) : warning C4244: '=' : conversion from 'u64b_t' to 'u08b_t', possible loss of data
C:\libgpuarray\src\util\skein.c(58) : warning C4244: '=' : conversion from 'u64b_t' to 'u08b_t', possible loss of data
C:\libgpuarray\src\util\skein.c(59) : warning C4244: '=' : conversion from 'u64b_t' to 'u08b_t', possible loss of data
C:\libgpuarray\src\util\skein.c(60) : warning C4244: '=' : conversion from 'u64b_t' to 'u08b_t', possible loss of data
C:\libgpuarray\src\util\skein.c(61) : warning C4244: '=' : conversion from 'u64b_t' to 'u08b_t', possible loss of data
[ 88%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/dyn_load.c.obj
dyn_load.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 89%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/libcuda.c.obj
libcuda.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 91%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/libnvrtc.c.obj
libnvrtc.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 92%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/libcublas.c.obj
libcublas.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 93%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/libnccl.c.obj
libnccl.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 94%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/libopencl.c.obj
libopencl.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 96%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/libclblas.c.obj
libclblas.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 97%] Building C object src/CMakeFiles/gpuarray-static.dir/loaders/libclblast.c.obj
libclblast.c
C:\libgpuarray\src\util/error.h(32) : warning C4996: 'strerror': This function or variable may be unsafe. Consider using
strerror_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\string.h(126) : see
declaration of 'strerror'
[ 98%] Linking C static library ..\..\lib\gpuarray-static.lib
[100%] Built target gpuarray-static
C:\libgpuarray>python setup.py build
Compiling pygpu/gpuarray.pyx because it changed.
Compiling pygpu/blas.pyx because it changed.
Compiling pygpu/_elemwise.pyx because it changed.
Compiling pygpu/collectives.pyx because it changed.
[1/4] Cythonizing pygpu/_elemwise.pyx
[2/4] Cythonizing pygpu/blas.pyx
[3/4] Cythonizing pygpu/collectives.pyx
[4/4] Cythonizing pygpu/gpuarray.pyx
running build
running build_py
creating build\lib.win-amd64-2.7
creating build\lib.win-amd64-2.7\pygpu
copying pygpu\basic.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\dtypes.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\elemwise.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\operations.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\reduction.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\tools.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\version.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\_array.py -> build\lib.win-amd64-2.7\pygpu
copying pygpu\__init__.py -> build\lib.win-amd64-2.7\pygpu
creating build\lib.win-amd64-2.7\pygpu\tests
copying pygpu/tests\main.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\support.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\test_basic.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\test_blas.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\test_elemwise.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\test_gpu_ndarray.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\test_operations.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\test_reduction.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\test_tools.py -> build\lib.win-amd64-2.7\pygpu/tests
copying pygpu/tests\__init__.py -> build\lib.win-amd64-2.7\pygpu/tests
running egg_info
creating pygpu.egg-info
writing requirements to pygpu.egg-info\requires.txt
writing pygpu.egg-info\PKG-INFO
writing top-level names to pygpu.egg-info\top_level.txt
writing dependency_links to pygpu.egg-info\dependency_links.txt
writing manifest file 'pygpu.egg-info\SOURCES.txt'
reading manifest file 'pygpu.egg-info\SOURCES.txt'
writing manifest file 'pygpu.egg-info\SOURCES.txt'
copying pygpu\_elemwise.c -> build\lib.win-amd64-2.7\pygpu
copying pygpu\blas.c -> build\lib.win-amd64-2.7\pygpu
copying pygpu\collectives.c -> build\lib.win-amd64-2.7\pygpu
copying pygpu\gpuarray.c -> build\lib.win-amd64-2.7\pygpu
copying pygpu\gpuarray.h -> build\lib.win-amd64-2.7\pygpu
copying pygpu\gpuarray_api.h -> build\lib.win-amd64-2.7\pygpu
copying pygpu\blas_api.h -> build\lib.win-amd64-2.7\pygpu
copying pygpu\numpy_compat.h -> build\lib.win-amd64-2.7\pygpu
copying pygpu\collectives.h -> build\lib.win-amd64-2.7\pygpu
copying pygpu\collectives_api.h -> build\lib.win-amd64-2.7\pygpu
running build_ext
building 'pygpu.gpuarray' extension
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\pygpu
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD
/W3 /GS- /DNDEBUG -DGPUARRAY_SHARED -IC:\Anaconda2\lib\site-packages\numpy\core\include -IC:\libgpuarray\src -IC:\Anacon
da2\include -IC:\Anaconda2\PC /Tcpygpu/gpuarray.c /Fobuild\temp.win-amd64-2.7\Release\pygpu/gpuarray.obj
gpuarray.c
c:\anaconda2\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(12) : Warning Msg: Using deprecated Num
Py API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
pygpu/gpuarray.c(13461) : warning C4090: '=' : different 'const' qualifiers
pygpu/gpuarray.c(14309) : warning C4090: 'function' : different 'const' qualifiers
pygpu/gpuarray.c(19861) : warning C4090: 'function' : different 'const' qualifiers
pygpu/gpuarray.c(19881) : warning C4090: 'function' : different 'const' qualifiers
pygpu/gpuarray.c(20561) : warning C4133: 'function' : incompatible types - from 'PyObject *' to 'PySliceObject *'
pygpu/gpuarray.c(30513) : warning C4244: '=' : conversion from 'Py_ssize_t' to 'unsigned int', possible loss of data
pygpu/gpuarray.c(31025) : warning C4090: 'function' : different 'const' qualifiers
pygpu/gpuarray.c(41331) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
pygpu/gpuarray.c(41337) : warning C4244: 'initializing' : conversion from 'double' to 'float', possible loss of data
C:\Users\Yi Li\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INC
REMENTAL:NO /LIBPATH:C:\libgpuarray\lib /LIBPATH:C:\Anaconda2\libs /LIBPATH:C:\Anaconda2\PCbuild\amd64 /LIBPATH:C:\Anaco
nda2\PC\VS9.0\amd64 gpuarray.lib /EXPORT:initgpuarray build\temp.win-amd64-2.7\Release\pygpu/gpuarray.obj /OUT:build\lib
.win-amd64-2.7\pygpu\gpuarray.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\pygpu\gpuarray.lib /MANIFESTFILE:build\temp.w
in-amd64-2.7\Release\pygpu\gpuarray.pyd.manifest
gpuarray.obj : warning LNK4197: export 'initgpuarray' specified multiple times; using first specification
Creating library build\temp.win-amd64-2.7\Release\pygpu\gpuarray.lib and object build\temp.win-amd64-2.7\Release\pygp
u\gpuarray.exp
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_fix_flags referenced in function __pyx_f_5pygpu_
8gpuarray_array_fix_flags
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_clear referenced in function __pyx_f_5pygpu_8gpu
array_array_clear
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_share referenced in function __pyx_f_5pygpu_8gpu
array_array_share
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpucontext_error referenced in function __pyx_f_5pygpu_8g
puarray_kernel_error
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpukernel_context referenced in function __pyx_f_5pygpu_8
gpuarray_kernel_error
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuKernel_clear referenced in function __pyx_f_5pygpu_8gp
uarray_kernel_clear
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpucontext_deref referenced in function __pyx_pf_5pygpu_8
gpuarray_10GpuContext___dealloc__
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpudata_property referenced in function __pyx_f_5pygpu_8g
puarray_strides_ok
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpuarray_get_elsize referenced in function __pyx_f_5pygpu
_8gpuarray_strides_ok
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_empty referenced in function __pyx_f_5pygpu_8gpu
array_array_empty
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpudata_context referenced in function __pyx_f_5pygpu_8gp
uarray_array_fromdata
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_fromdata referenced in function __pyx_f_5pygpu_8
gpuarray_array_fromdata
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_copy_from_host referenced in function __pyx_f_5p
ygpu_8gpuarray_array_copy_from_host
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_error referenced in function __pyx_f_5pygpu_8gpu
array_array_view
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_view referenced in function __pyx_f_5pygpu_8gpua
rray_array_view
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_sync referenced in function __pyx_f_5pygpu_8gpua
rray_array_sync
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_index referenced in function __pyx_f_5pygpu_8gpu
array_array_index
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_take1 referenced in function __pyx_f_5pygpu_8gpu
array_array_take1
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_setarray referenced in function __pyx_f_5pygpu_8
gpuarray_array_setarray
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_reshape referenced in function __pyx_f_5pygpu_8g
puarray_array_reshape
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_transpose referenced in function __pyx_f_5pygpu_
8gpuarray_array_transpose
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_context referenced in function __pyx_f_5pygpu_8g
puarray_array_context
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_move referenced in function __pyx_f_5pygpu_8gpua
rray_array_move
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_write referenced in function __pyx_f_5pygpu_8gpu
array_array_write
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_read referenced in function __pyx_f_5pygpu_8gpua
rray_array_read
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_memset referenced in function __pyx_f_5pygpu_8gp
uarray_array_memset
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_copy referenced in function __pyx_f_5pygpu_8gpua
rray_array_copy
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_transfer referenced in function __pyx_f_5pygpu_8
gpuarray_array_transfer
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_split referenced in function __pyx_f_5pygpu_8gpu
array_array_split
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuArray_concatenate referenced in function __pyx_f_5pygp
u_8gpuarray_array_concatenate
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuKernel_init referenced in function __pyx_f_5pygpu_8gpu
array_kernel_init
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuKernel_context referenced in function __pyx_f_5pygpu_8
gpuarray_kernel_context
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuKernel_sched referenced in function __pyx_f_5pygpu_8gp
uarray_kernel_sched
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuKernel_call referenced in function __pyx_f_5pygpu_8gpu
array_kernel_call
gpuarray.obj : error LNK2019: unresolved external symbol __imp_GpuKernel_binary referenced in function __pyx_f_5pygpu_8g
puarray_kernel_binary
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpukernel_property referenced in function __pyx_f_5pygpu_
8gpuarray_kernel_property
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpucontext_property referenced in function __pyx_f_5pygpu
_8gpuarray_ctx_property
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpuarray_register_type referenced in function __pyx_pf_5p
ygpu_8gpuarray_8register_dtype
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpuarray_get_type referenced in function __pyx_pf_5pygpu_
8gpuarray_12dtype_to_ctype
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpu_get_platform_count referenced in function __pyx_pf_5p
ygpu_8gpuarray_18count_platforms
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpu_get_device_count referenced in function __pyx_pf_5pyg
pu_8gpuarray_20count_devices
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpucontext_init referenced in function __pyx_pf_5pygpu_8g
puarray_10GpuContext_4__cinit__
gpuarray.obj : error LNK2019: unresolved external symbol __imp_gpuarray_get_extension referenced in function __pyx_pf_5p
ygpu_8gpuarray_4cl_wrap_ctx
build\lib.win-amd64-2.7\pygpu\gpuarray.pyd : fatal error LNK1120: 43 unresolved externals
error: command 'C:\\Users\\Yi Li\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd6
4\\link.exe' failed with exit status 1120
Please use the conda packages to run on windows. We don't support manual compile.
Thanks @abergeron but sorry I am not understanding you. I've pygpu/libgpuarray 0.6.4 installed via conda, which causes the original error "Could not initialize pygpu, support disabled". A few threads earlier @lamblin suggested installing the latest development version of libgpuarray (0.6.5). How should I install the latest development version via conda without manual compiling?
I have no issue running Theano rel-0.8.2 and the problem only started when I updated to rel-0.9.0 and was forced to change device = gpu0 to device = cuda0 in my configuration.
Fetching package metadata ...........
Solving package specifications: .
# All requested packages already installed.
# packages in environment at C:\Anaconda2:
#
pygpu 0.6.4 py27_0
I just updated Theano-0.10.0.dev1 but still get the same error below.
>>> import theano
ERROR (theano.gpuarray): Could not initialize pygpu, support disabled
Traceback (most recent call last):
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 179, in <module>
use(config.device)
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 166, in use
init_dev(device, preallocate=preallocate)
File "C:\Anaconda2\lib\site-packages\theano\gpuarray\__init__.py", line 65, 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: 0
If I were to manually set the device to "gpu0", "cuda0" or "cuda" and run pygpu.test(), I get the same error of "Unknown device format". For example,
>>>import pygpu
>>> pygpu.__version__
'0.6.4'
>>> pygpu.test()
======================================================================
ERROR: Failure: ValueError (Unknown device format:"cuda")
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Anaconda2\lib\site-packages\nose\loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "C:\Anaconda2\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Anaconda2\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Anaconda2\lib\site-packages\pygpu\tests\test_basic.py", line 5, in <module>
from .support import (gen_gpuarray, context)
File "C:\Anaconda2\lib\site-packages\pygpu\tests\support.py", line 32, in <module>
context = gpuarray.init(get_env_dev())
File "pygpu\gpuarray.pyx", line 614, in pygpu.gpuarray.init (pygpu/gpuarray.c:9415)
File "pygpu\gpuarray.pyx", line 565, in pygpu.gpuarray.pygpu_init (pygpu/gpuarray.c:9081)
ValueError: Unknown device format:"cuda"
Ok, I figured I need to set DEVICE=cuda instead of set DEVICE="cuda", but I get back the exactly same error as that when importing theano...
>>> import pygpu
>>> pygpu.test()
pygpu is installed in C:\Anaconda2\lib\site-packages\pygpu
NumPy version 1.12.1
NumPy relaxed strides checking option: True
NumPy is installed in C:\Anaconda2\lib\site-packages\numpy
Python version 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, May 11 2017, 13:17:26) [MSC v.1500 64 bit (AMD64)]
nose version 1.3.7
EEEEEEE
======================================================================
ERROR: Failure: GpuArrayException (Error loading library: -1)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Anaconda2\lib\site-packages\nose\loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "C:\Anaconda2\lib\site-packages\nose\importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "C:\Anaconda2\lib\site-packages\nose\importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "C:\Anaconda2\lib\site-packages\pygpu\tests\test_basic.py", line 5, in <module>
from .support import (gen_gpuarray, context)
File "C:\Anaconda2\lib\site-packages\pygpu\tests\support.py", line 32, in <module>
context = gpuarray.init(get_env_dev())
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
If I set DEVICE=cuda0, I get "GpuArrayException: Error loading library: 0" (instead of the -1).
Any advice is appreciated.
Indeed, you need DEVICE=cuda0, not DEVICE=cuda, which will never work.
Regarding using the development version, I'll check with @abergeron which would be the easiest way of doing that.
You can try to use conda-forge, which has a more recent package for libgpuarray.
I think you would need to do that in a separate conda environment, and use the Python (and all packages) from conda-forge instead of the regular conda source.
FYI, packages for version 0.6.8 are out.
should be fixed with last release, so closing.
Thanks. I can confirm that upgrading to 0.6.8 fixed my original error. I was having some issue with Cuda 7.5 as "nvrtc64_80.dll" was missing but it worked after I updated to Cuda 8.0. Maybe Cuda 8.0 should be listed as a requirement.
Separately, I had the following warning:
Can not use cuDNN on context None: cannot compile with cuDNN. We got this error:
c:\users\xxxxx\appdata\local\temp\try_flags_kjorlv.c:4:19: fatal error: cudnn.h: No such file or directory
compilation terminated.
Mapped name None to device cuda0: GeForce GTX 980 Ti (0000:01:00.0)
But my code seems to run fine. Any idea what could be the trigger of the warning? Thanks!
Answering my own question, I was able to get rid of the warning but explicitly setting the cuDNN path in theanorc. Everything works now :-)
Using cuDNN version 6021 on context None
Mapped name None to device cuda0: GeForce GTX 980 Ti (0000:01:00.0)
[cuda]
root=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/bin
[dnn]
include_path = C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include
library_path = C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/x64
pygpu works with cuda 7.5 and 7.0. However it needs to load libraries all from the same version and so it asks the driver what the version is. The problem is that the driver will just reply with the latest version of cuda that it knows about and if you have a recent driver this will be 8.0.
There is a way to override that choice with an environment variable called GPUARRAY_CUDA_VERSION (you can set it to something like '75' to select cuda 7.5). This can probably be better documented.
Most helpful comment
Answering my own question, I was able to get rid of the warning but explicitly setting the cuDNN path in theanorc. Everything works now :-)
Using cuDNN version 6021 on context None
Mapped name None to device cuda0: GeForce GTX 980 Ti (0000:01:00.0)