You are using the old back-end. I strongly recommand that you use the new
back-end:

https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29

It is much simpler to install on windows for the GPU.

Fred

On Sun, Apr 9, 2017 at 8:54 PM <[email protected]> wrote:

> Hi~Do you solve your problem? I also have some GPU configuration problem
> using theano.
>
> 在 2016年7月10日星期日 UTC+8上午11:18:54,[email protected]写道:
>
> Please help me!
> I finished installation of Theano
> http://deeplearning.net/software/theano/install_windows.html#gpu-windows ,
> the following step:
> import numpy as np
> import time
> import theano
> A = np.random.rand(1000,10000).astype(theano.config.floatX)
> B = np.random.rand(10000,1000).astype(theano.config.floatX)
> np_start = time.time()
> AB = A.dot(B)
> np_end = time.time()
> X,Y = theano.tensor.matrices('XY')
> mf = theano.function([X,Y],X.dot(Y))
> t_start = time.time()
> tAB = mf(A,B)
> t_end = time.time()
> print("NP time: %f[s], theano time: %f[s] (times should be close when run
> on CPU!)" %(
>                                            np_end-np_start, t_end-t_start))
> print("Result difference: %f" % (np.abs(AB-tAB).max(), ))
>
> i can get the correct result:
> NP time: 0.230000[s], theano time: 0.312000[s] (times should be close when
> run o
> n CPU!)
> Result difference: 0.000000
>
> Then I write the following configuration file in the name ".theanorc.txt"
> both in C:\SciSoft\ and C:\Users\Administrator\,
> [global]
> device = gpu
> floatX = float32
>
> [nvcc]
> flags = --use-local-env  --cl-version=2008
>
> However, the next step for GPU test,
> from theano import function, config, shared, sandbox
> import theano.tensor as T
> import numpy
> import time
>
> vlen = 10 * 30 * 768  # 10 x #cores x # threads per core
> iters = 1000
>
> rng = numpy.random.RandomState(22)
> x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
> f = function([], T.exp(x))
> print(f.maker.fgraph.toposort())
> t0 = time.time()
> for i in range(iters):
>     r = f()
> t1 = time.time()
> print("Looping %d times took %f seconds" % (iters, t1 - t0))
> print("Result is %s" % (r,))
> if numpy.any([isinstance(x.op, T.Elemwise) for x in
> f.maker.fgraph.toposort()]):
>     print('Used the cpu')
> else:
>     print('Used the gpu')
>
> I got wrong message:
> Problem occurred during compilation with the command line below:
>
> C:\SciSoft\WinPython-64bit-2.7.9.4\scripts\..\python-2.7.9.amd64\..\tools\mingw
> 2\bin\g++.exe -shared -g -O3 -fno-math-errno -Wno-unused-label
> -Wno-unused-vari
> ble -Wno-write-strings -march=ivybridge -mmmx -mno-3dnow -msse -msse2
> -msse3 -m
> sse3 -mno-sse4a -mcx16 -msahf -mno-movbe -maes -mno-sha -mpclmul -mpopcnt
> -mno-
> bm -mno-lwp -mno-fma -mno-fma4 -mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mavx
> -mno-
> vx2 -msse4.2 -msse4.1 -mno-lzcnt -mno-rtm -mno-hle -mrdrnd -mf16c
> -mfsgsbase -m
> o-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f
> -mno-avx51
> er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=32
> --para
>  l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=ivybridge
> -DNPY_NO_DEP
> ECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64
> -IC:\SciSoft\WinPython-64bit-2.7
> 9.4\python-2.7.9.amd64\lib\site-packages\numpy\core\include
> -IC:\SciSoft\WinPyt
> on-64bit-2.7.9.4\python-2.7.9.amd64\include
> -Ic:\users\administrator\theano\the
> no\gof -o
> C:\Users\Administrator\AppData\Local\Theano\compiledir_Windows-7-6.1.
>
> 601-SP1-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-2.7.9-64\tmpnlqphy\94
> dc2054b01246a130afd8566a709ba.pyd
> C:\Users\Administrator\AppData\Local\Theano\c
>
> mpiledir_Windows-7-6.1.7601-SP1-Intel64_Family_6_Model_58_Stepping_9_GenuineInt
> l-2.7.9-64\tmpnlqphy\mod.cpp
> -LC:\SciSoft\WinPython-64bit-2.7.9.4\python-2.7.9.
> md64\libs -LC:\SciSoft\WinPython-64bit-2.7.9.4\python-2.7.9.amd64
> -lpython27
>
> C:/SciSoft/WinPython-64bit-2.7.9.4/tools/mingw32/bin/../lib/gcc/x86_64-w64-ming
>
> 32/4.9.2/libstdc++.a(basic_file.o):(.text$_ZN12_GLOBAL__N_1L6xwriteEiPKcx+0x29)
>  undefined reference to `write'
>
> C:/SciSoft/WinPython-64bit-2.7.9.4/tools/mingw32/bin/../lib/gcc/x86_64-w64-ming
>
> 32/4.9.2/libstdc++.a(basic_file.o):(.text$_ZNSt12__basic_fileIcE8sys_openEiSt13
> Ios_Openmode+0x36): undefined reference to `fdopen'
>
> C:/SciSoft/WinPython-64bit-2.7.9.4/tools/mingw32/bin/../lib/gcc/x86_64-w64-ming
> 32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:/SciSoft/WinPython-64bit-
>
> .7.9.4/tools/mingw32/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/libstdc++.a(basic_
> ile.o): bad reloc address 0x36 in section
> `.text$_ZNSt12__basic_fileIcE8sys_ope
> EiSt13_Ios_Openmode'
> collect2.exe: error: ld returned 1 exit status
>
> Traceback (most recent call last):
>   File "test2.py", line 11, in <module>
>     f = function([], T.exp(x))
>   File "c:\users\administrator\theano\theano\compile\function.py", line
> 322, in
> function
>     output_keys=output_keys)
>   File "c:\users\administrator\theano\theano\compile\pfunc.py", line 480,
> in pf
> nc
>     output_keys=output_keys)
>   File "c:\users\administrator\theano\theano\compile\function_module.py",
> line
> 784, in orig_function
>     defaults)
>   File "c:\users\administrator\theano\theano\compile\function_module.py",
> line
> 648, in create
>     input_storage=input_storage_lists, storage_map=storage_map)
>   File "c:\users\administrator\theano\theano\gof\link.py", line 699, in
> make_th
> nk
>     storage_map=storage_map)[:3]
>   File "c:\users\administrator\theano\theano\gof\vm.py", line 1042, in
> make_all
>     no_recycling))
>   File "c:\users\administrator\theano\theano\gof\op.py", line 975, in
> make_thun
>
>     no_recycling)
>   File "c:\users\administrator\theano\theano\gof\op.py", line 875, in
> make_c_th
> nk
>     output_storage=node_output_storage)
>   File "c:\users\administrator\theano\theano\gof\cc.py", line 1189, in
> make_thu
> k
>     keep_lock=keep_lock)
>   File "c:\users\administrator\theano\theano\gof\cc.py", line 1130, in
> __compil
> __
>     keep_lock=keep_lock)
>   File "c:\users\administrator\theano\theano\gof\cc.py", line 1585, in
> cthunk_f
> ctory
>     key=key, lnk=self, keep_lock=keep_lock)
>   File "c:\users\administrator\theano\theano\gof\cmodule.py", line 1145,
> in mod
> le_from_key
>     module = lnk.compile_cmodule(location)
>   File "c:\users\administrator\theano\theano\gof\cc.py", line 1491, in
> compile_
> module
>     preargs=preargs)
>   File "c:\users\administrator\theano\theano\gof\cmodule.py", line 2299,
> in com
> ile_str
>     (status, compile_stderr.replace('\n', '. ')))
> Exception: ('The following error happened while compiling the node',
> Elemwise{e
> p,no_inplace}(<TensorType(float64, vector)>), '\n', "Compilation failed
> (return
> status=1):
> C:/SciSoft/WinPython-64bit-2.7.9.4/tools/mingw32/bin/../lib/gcc/x86_
>
> 4-w64-mingw32/4.9.2/libstdc++.a(basic_file.o):(.text$_ZN12_GLOBAL__N_1L6xwriteE
> PKcx+0x29): undefined reference to `write'\r.
> C:/SciSoft/WinPython-64bit-2.7.9.
>
> /tools/mingw32/bin/../lib/gcc/x86_64-w64-mingw32/4.9.2/libstdc++.a(basic_file.o
> :(.text$_ZNSt12__basic_fileIcE8sys_openEiSt13_Ios_Openmode+0x36):
> undefined ref
> rence to `fdopen'\r.
> C:/SciSoft/WinPython-64bit-2.7.9.4/tools/mingw32/bin/../li
> /gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld.exe:
> C:/Sci
>
> oft/WinPython-64bit-2.7.9.4/tools/mingw32/bin/../lib/gcc/x86_64-w64-mingw32/4.9
> 2/libstdc++.a(basic_file.o): bad reloc address 0x36 in section
> `.text$_ZNSt12__
> asic_fileIcE8sys_openEiSt13_Ios_Openmode'\r. collect2.exe: error: ld
> returned 1
> exit status\r. ", '[Elemwise{exp,no_inplace}(<TensorType(float64,
> vector)>)]')
>
> I think something wrong about the GUP configuration, but i dont know where
> is it, Who can help me, please!!
>
> --
>
> ---
> 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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to