{"action":"created","issue":{"url":"https://api.github.com/repos/Theano/Theano/issues/3551","repository_url":"https://api.github.com/repos/Theano/Theano","labels_url":"https://api.github.com/repos/Theano/Theano/issues/3551/labels{/name}","comments_url":"https://api.github.com/repos/Theano/Theano/issues/3551/comments","events_url":"https://api.github.com/repos/Theano/Theano/issues/3551/events","html_url":"https://github.com/Theano/Theano/issues/3551","id":113156825,"number":3551,"title":"Please help! ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: 'utf-8' codec can't decode....","user":{"login":"liyi193328","id":6782974,"avatar_url":"https://avatars.githubusercontent.com/u/6782974?v=3","gravatar_id":"","url":"https://api.github.com/users/liyi193328","html_url":"https://github.com/liyi193328","followers_url":"https://api.github.com/users/liyi193328/followers","following_url":"https://api.github.com/users/liyi193328/following{/other_user}","gists_url":"https://api.github.com/users/liyi193328/gists{/gist_id}","starred_url":"https://api.github.com/users/liyi193328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liyi193328/subscriptions","organizations_url":"https://api.github.com/users/liyi193328/orgs","repos_url":"https://api.github.com/users/liyi193328/repos","events_url":"https://api.github.com/users/liyi193328/events{/privacy}","received_events_url":"https://api.github.com/users/liyi193328/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Theano/Theano/labels/Crash","name":"Crash","color":"ededed"},{"url":"https://api.github.com/repos/Theano/Theano/labels/Windows","name":"Windows","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2015-10-24T12:16:59Z","updated_at":"2016-07-18T21:32:28Z","closed_at":null,"body":"My environment is win10 + python3.4+ theano 0.7+cuda7.5. when I import theano from teriminal , I get the error like:\r\n\r\n### ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: 'utf-8' codec can't decode......\r\n\r\nI set log level as debug, get the folloing info : \r\nINFO (theano.gof.cmodule): Call to 'g++ -march=native' failed,not setting -march flag\r\nDEBUG (theano.gof.cmodule): Compiling for 64 bit architecture\r\nDEBUG (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\r\nDEBUG (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\r\nDEBUG (theano.gof.cmodule): Running cmd: C:\\Program Files\\mingw-w64\\x86_64-5.2.0-posix-seh-rt_v4-rev0\\mingw64\\bin\\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\r\nDEBUG (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\r\nDEBUG (theano.gof.cmodule): module_name cutils_ext.cutils_ext\r\nDEBUG (theano.tensor.opt): enabling optimization fusion elemwise in fast_run\r\nDEBUG (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\r\nDEBUG (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\r\n\r\n##### DEBUG (theano.sandbox.cuda.nvcc_compiler): Running cmd nvcc -shared -O3 -use_fast_math -Xlinker /DEBUG -D HAVE_ROUND -m64 -Xcompiler -DCUDA_NDARRAY_CUH=m11b90075e2397c684f9dc0f7276eab8f,-D NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION,/Zi,/MD -ID:\\Anaconda3\\lib\\site-packages\\theano\\sandbox\\cuda -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\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LD:\\Anaconda3\\libs -LD:\\Anaconda3 -lpython34 -lcublas -lcudart --ptxas-options=-v\r\n\r\n#### ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: 'utf-8' codec can't decode byte 0xd5 in position 5319: invalid continuation byte\r\n\r\nWARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: cuda unavilable)\r\n\r\nmy theanorc config is : \r\n#!sh\r\n[global]\r\ndevice = gpu\r\n[nvcc]\r\ncompiler_bindir=D:\\vs2010\\VC\\bin\r\nflags = -LD:\\Anaconda3\\libs\r\nfastmath = True\r\n\r\n#### I debug the nvcc_compile.py and theano.sandbox.cuda.init.py a long time, but don't know what's wrong, please help me. Thanks very much!"},"comment":{"url":"https://api.github.com/repos/Theano/Theano/issues/comments/233465642","html_url":"https://github.com/Theano/Theano/issues/3551#issuecomment-233465642","issue_url":"https://api.github.com/repos/Theano/Theano/issues/3551","id":233465642,"user":{"login":"Drekin","id":7892803,"avatar_url":"https://avatars.githubusercontent.com/u/7892803?v=3","gravatar_id":"","url":"https://api.github.com/users/Drekin","html_url":"https://github.com/Drekin","followers_url":"https://api.github.com/users/Drekin/followers","following_url":"https://api.github.com/users/Drekin/following{/other_user}","gists_url":"https://api.github.com/users/Drekin/gists{/gist_id}","starred_url":"https://api.github.com/users/Drekin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Drekin/subscriptions","organizations_url":"https://api.github.com/users/Drekin/orgs","repos_url":"https://api.github.com/users/Drekin/repos","events_url":"https://api.github.com/users/Drekin/events{/privacy}","received_events_url":"https://api.github.com/users/Drekin/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T21:32:28Z","updated_at":"2016-07-18T21:32:28Z","body":"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.\r\n\r\nIt 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?\r\n"}}
{"actor":{"display_login":"Drekin"}}