当我尝试在GPU设备上使用Theano时,我遇到了编译问题(它在CPU中工作得很好)。对于已经报告的这里,我遇到了几乎完全相同的问题,但是,按照所提供的解决方案对我不起作用。按照最初的解决方案,我可以验证pycuda是否已成功安装,但导入theano仍然引发相同的错误:
c:\python\python27\include\pymath.h(22): warning: dllexport/dllimport conflict with "round"
c:\program files\nvidia gpu computing toolkit\cuda\v6.5\include\math_functions.h(2455): here; dllimport/dllexport dropped
mod.cu(954): warning: statement is unreachable
mod.cu(1114): error: namespace "std" has no member "min"
... *lots more of the same error at different lines* ...
mod.cu(4604): error: namespace "std" has no member "min"
31 errors detected in the compilation of "C:/Users/Zehan/AppData/Local/Temp/tmpxft_0000317c_00000000-10_mod.cpp1.ii".
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return status', 2, 'for cmd', 'nvcc -shared -g -O3 --compiler-bindir C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin -Xlinker /DEBUG -m32 -Xcompiler -LC:\\Python\\Python27\\libs,-DCUDA_NDARRAY_CUH=d67f7c8a21306c67152a70a88a837011,/Zi,/MD -IC:\\Python\\Python27\\lib\\site-packages\\theano\\sandbox\\cuda -IC:\\Python\\Python27\\lib\\site-packages\\numpy\\core\\include -IC:\\Python\\Python27\\include -o C:\\Users\\Zehan\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.8-32\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LC:\\Python\\Python27\\libs -LNone\\lib -LNone\\lib64 -LC:\\Python\\Python27 -lpython27 -lcublas -lcudart')
我有Python2.7.8 32位和MinGW设置和CUDA6.5。我使用以下.theanorc配置:
[global]
device = gpu
floatX = float32
[nvcc]
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
为了使pycuda示例正常工作,我不得不将VisualStudio12.0 C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
添加到用户路径中。尽管使用visual studio 10命令提示符来构建pycuda,但由于某种原因,它不适用于visual studio 10.0。
顺便说一句,如果我尝试compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
,就会发现一个错误,即visual的版本没有好处:
nvcc fatal: nvcc cannot find a supported version of Microsoft Visual Studio. Only the versions 2010, 2012, and 2013 are supported
(我安装了visual studio express 2010和2013 )
据我所知,Theano+GPU对Windows的支持还有些实验性,但似乎对某些人确实有效。对接下来的尝试有什么建议吗?
发布于 2015-01-28 10:04:27
https://stackoverflow.com/questions/28120712
复制