My environment is win10 + python3.4+ theano 0.7+cuda7.5. when I import theano from teriminal , I get the error like:
I set log level as debug, get the folloing info :
INFO (theano.gof.cmodule): Call to 'g++ -march=native' failed,not setting -march flag
DEBUG (theano.gof.cmodule): Compiling for 64 bit architecture
DEBUG (theano.gof.cmodule): Writing module C++ code to C:\Users\liyi1\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\cutils_ext\mod.cpp
DEBUG (theano.gof.cmodule): Generating shared lib C:\Users\liyi1\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\cutils_ext\cutils_ext.pyd
DEBUG (theano.gof.cmodule): Running cmd: C:\Program Files\mingw-w64\x86_64-5.2.0-posix-seh-rt_v4-rev0\mingw64bin\g++.exe -shared -g -D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -m64 -DMS_WIN64 -ID:\Anaconda3\lib\site-packages\numpy\core\include -ID:\Anaconda3\include -o C:\Users\liyi1\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\cutils_ext\cutils_ext.pyd C:\Users\liyi1\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\cutils_ext\mod.cpp -LD:\Anaconda3\libs -LD:\Anaconda3 -lpython34
DEBUG (theano.gof.cmodule): WORKDIR C:\Users\liyi1\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64
DEBUG (theano.gof.cmodule): module_name cutils_ext.cutils_ext
DEBUG (theano.tensor.opt): enabling optimization fusion elemwise in fast_run
DEBUG (theano.sandbox.cuda.nvcc_compiler): Writing module C++ code to C:\Users\liyi1\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\cuda_ndarray\mod.cu
DEBUG (theano.sandbox.cuda.nvcc_compiler): Generating shared lib C:\Users\liyi1\AppData\Local\Theano\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-3.4.3-64\cuda_ndarray\cuda_ndarray.pyd
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: cuda unavilable)
my theanorc config is :
[global]
device = gpu
[nvcc]
compiler_bindir=D:\vs2010\VCbin
flags = -LD:\Anaconda3\libs
fastmath = True
I have same problem while using python 3 in winpython.
But python 2 in winpython is OK, so I suggest you should try it in python 2
Debugging long long time, I have solved this problem, somewhere like decode(because long time I have forget the concret place), must add decode('gbk').
Did you do a change in Theano? If so, where? Can you make a PR with the
diff?
thanks
On Sun, Nov 15, 2015 at 9:33 AM, liyi [email protected] wrote:
Debugging long long time, I have solved this problem, somewhere like
decode(because long time I have forget the concret place), must add
decode('gbk').—
Reply to this email directly or view it on GitHub
https://github.com/Theano/Theano/issues/3551#issuecomment-156815107.
@nouiz I've changed decode_iter function: yield x.decode('gbk') in compat.init.py, which works in my win python3.4

I encountered the same problem and found solutions by myself which was the same as those mentioned above.
It is because cl (VS compiler) will generate non-utf8 output if VS is installed in some non-English languages. Decoding by any specific encoding cannot solve the problem. We must find a way to get to know which encoding is cl using.
For Chinese guys: 设成gbk可以解决中文版VS的问题,但是用其他语言的怎么办……必须想办法知道VS用的是哪种编码
@nouiz Sorry for disturbing. I found this issue because I encountered the same problem, although the issue have been inactive for long, and I come up with a solution that should work for all encodings and compatible with both Python 2 and 3. See #4235 for detail.
We have hit a similar issue in https://github.com/ipython/ipython/issues/9768. At multiple places in nvcc_compiler you are printing nvcc_stdout, which should be a Unicode string by https://github.com/Theano/Theano/blob/master/theano/sandbox/cuda/nvcc_compiler.py#L365, but it seems that it is actually a byte string and our custom sys.stdout fails to decode it sometimes since it assumes UTF-8.
It seems to me that the definitions of decode, decode_iter, and decode_with for Python 2 / 3 are switched in theano.compat. In Python 2 the argument is a byte string and so should be decoded while in Python 3 it is already a Unicode string so no operation is needed, right?
There was many updates in Theano related to path. So I think it is fixed, so closing.
still have same problem in python 3.5(by anaconda), windows 10 64bit, visual studio 2015 community, theano 0.8.2.
If I add 'gbk' like above, I get
Failed to compile cuda_ndarray.cu: 'cp949' codec can't encode character 'u80f6' in position 258: illegal multibyte sequence.
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: 'utf-8' codec can't decode byte 0xb8 in position 106: invalid start byte,add 'gbk' is fail
Most helpful comment
@nouiz I've changed decode_iter function: yield x.decode('gbk') in compat.init.py, which works in my win python3.4
