title: Installing theano on Windows 8 with GPU enabled
body: <p>I understand that the Theano support for Windows 8.1 is at experimental stage only but I wonder if anyone had any luck with resolving my issues. Depending on my config, I get three distinct types of errors. I assume that the resolution of any of my errors would solve my problem.</p>
  
  <p>I have installed Python using WinPython 32-bit system, using MinGW as described <a href="http://deeplearning.net/software/theano/install.html">here</a>. The contents of my <code>.theanorc</code> file are as follows:</p>
  
  <pre><code>[global]
  openmp=False
  device = gpu
  
  [nvcc]
  flags=-LC:\TheanoPython\python-2.7.6\libs
  compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\
  
  [blas]
  ldflags = 
  </code></pre>
  
  <p>When I run <code>import theano</code> the error is as follows:</p>
  
  <pre><code>nvcc fatal   : nvcc cannot find a supported version of Microsoft Visual Studio.
  Only the versions 2010, 2012, and 2013 are supported
  
  ['nvcc', '-shared', '-g', '-O3', '--compiler-bindir', 'C:\\Program Files (x86)\\
  Microsoft Visual Studio 10.0\\VC\\bin# flags=-m32 # we have this hard coded for
  now', '-Xlinker', '/DEBUG', '-m32', '-Xcompiler', '-DCUDA_NDARRAY_CUH=d67f7c8a21
  306c67152a70a88a837011,/Zi,/MD', '-IC:\\TheanoPython\\python-2.7.6\\lib\\site-pa
  ckages\\theano\\sandbox\\cuda', '-IC:\\TheanoPython\\python-2.7.6\\lib\\site-pac
  kages\\numpy\\core\\include', '-IC:\\TheanoPython\\python-2.7.6\\include', '-o',
   'C:\\Users\\Matej\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel6
  4_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.6-32\\cuda_ndarray\\cuda_ndarray
  .pyd', 'mod.cu', '-LC:\\TheanoPython\\python-2.7.6\\libs', '-LNone\\lib', '-LNon
  e\\lib64', '-LC:\\TheanoPython\\python-2.7.6', '-lpython27', '-lcublas', '-lcuda
  rt']
  ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return st
  atus', 1, 'for cmd', 'nvcc -shared -g -O3 --compiler-bindir C:\\Program Files (x
  86)\\Microsoft Visual Studio 10.0\\VC\\bin# flags=-m32 # we have this hard coded
   for now -Xlinker /DEBUG -m32 -Xcompiler -DCUDA_NDARRAY_CUH=d67f7c8a21306c67152a
  70a88a837011,/Zi,/MD -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\thean
  o\\sandbox\\cuda -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\numpy\\co
  re\\include -IC:\\TheanoPython\\python-2.7.6\\include -o C:\\Users\\Matej\\AppDa
  ta\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepp
  ing_3_GenuineIntel-2.7.6-32\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LC:\\TheanoP
  ython\\python-2.7.6\\libs -LNone\\lib -LNone\\lib64 -LC:\\TheanoPython\\python-2
  .7.6 -lpython27 -lcublas -lcudart')
  WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not availabl
  e
  </code></pre>
  
  <p>I have also tested it using <code>Visual Studio 12.0</code> which is installed on my system with the following error:</p>
  
  <pre><code>mod.cu
  nvlink fatal   : Could not open input file 'C:/Users/Matej/AppData/Local/Temp/tm
  pxft_00001b70_00000000-28_mod.obj'
  
  ['nvcc', '-shared', '-g', '-O3', '--compiler-bindir', 'C:\\Program Files (x86)\\
  Microsoft Visual Studio 12.0\\VC\\bin\\', '-Xlinker', '/DEBUG', '-m32', '-Xcompi
  ler', '-LC:\\TheanoPython\\python-2.7.6\\libs,-DCUDA_NDARRAY_CUH=d67f7c8a21306c6
  7152a70a88a837011,/Zi,/MD', '-IC:\\TheanoPython\\python-2.7.6\\lib\\site-package
  s\\theano\\sandbox\\cuda', '-IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages
  \\numpy\\core\\include', '-IC:\\TheanoPython\\python-2.7.6\\include', '-o', 'C:\
  \Users\\Matej\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Fam
  ily_6_Model_60_Stepping_3_GenuineIntel-2.7.6-32\\cuda_ndarray\\cuda_ndarray.pyd'
  , 'mod.cu', '-LC:\\TheanoPython\\python-2.7.6\\libs', '-LNone\\lib', '-LNone\\li
  b64', '-LC:\\TheanoPython\\python-2.7.6', '-lpython27', '-lcublas', '-lcudart']
  ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: ('nvcc return st
  atus', 1, 'for cmd', 'nvcc -shared -g -O3 --compiler-bindir C:\\Program Files (x
  86)\\Microsoft Visual Studio 12.0\\VC\\bin\\ -Xlinker /DEBUG -m32 -Xcompiler -LC
  :\\TheanoPython\\python-2.7.6\\libs,-DCUDA_NDARRAY_CUH=d67f7c8a21306c67152a70a88
  a837011,/Zi,/MD -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\theano\\sa
  ndbox\\cuda -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\numpy\\core\\i
  nclude -IC:\\TheanoPython\\python-2.7.6\\include -o C:\\Users\\Matej\\AppData\\L
  ocal\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3
  _GenuineIntel-2.7.6-32\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LC:\\TheanoPython
  \\python-2.7.6\\libs -LNone\\lib -LNone\\lib64 -LC:\\TheanoPython\\python-2.7.6
  -lpython27 -lcublas -lcudart')
  WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not availabl
  e
  </code></pre>
  
  <p>In the latter error, several pop-up windows ask me how would I like to open (.res) file before error is thrown.</p>
  
  <p><code>cl.exe</code> is present in both folders (i.e. VS 2010 and VS 2013). </p>
  
  <p>Finally, if I set VS 2013 in the environment path and set <code>.theanorc</code> contents as follows:</p>
  
  <pre><code>[global]
  base_compiledir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin
  openmp=False
  floatX = float32
  device = gpu
  
  [nvcc]
  flags=-LC:\TheanoPython\python-2.7.6\libs
  compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\
  
  [blas]
  ldflags = 
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>c:\theanopython\python-2.7.6\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"
  
  mod.cu(1145): error: namespace "std" has no member "min"
  
  mod.cu(1173): error: namespace "std" has no member "min"
  
  mod.cu(1174): error: namespace "std" has no member "min"
  
  mod.cu(1317): error: namespace "std" has no member "min"
  
  mod.cu(1318): error: namespace "std" has no member "min"
  
  mod.cu(1442): error: namespace "std" has no member "min"
  
  mod.cu(1443): error: namespace "std" has no member "min"
  
  mod.cu(1742): error: namespace "std" has no member "min"
  
  mod.cu(1777): error: namespace "std" has no member "min"
  
  mod.cu(1781): error: namespace "std" has no member "min"
  
  mod.cu(1814): error: namespace "std" has no member "min"
  
  mod.cu(1821): error: namespace "std" has no member "min"
  
  mod.cu(1853): error: namespace "std" has no member "min"
  
  mod.cu(1861): error: namespace "std" has no member "min"
  
  mod.cu(1898): error: namespace "std" has no member "min"
  
  mod.cu(1905): error: namespace "std" has no member "min"
  
  mod.cu(1946): error: namespace "std" has no member "min"
  
  mod.cu(1960): error: namespace "std" has no member "min"
  
  mod.cu(3750): error: namespace "std" has no member "min"
  
  mod.cu(3752): error: namespace "std" has no member "min"
  
  mod.cu(3784): error: namespace "std" has no member "min"
  
  mod.cu(3786): error: namespace "std" has no member "min"
  
  mod.cu(3789): error: namespace "std" has no member "min"
  
  mod.cu(3791): error: namespace "std" has no member "min"
  
  mod.cu(3794): error: namespace "std" has no member "min"
  
  mod.cu(3795): error: namespace "std" has no member "min"
  
  mod.cu(3836): error: namespace "std" has no member "min"
  
  mod.cu(3838): error: namespace "std" has no member "min"
  
  mod.cu(4602): error: namespace "std" has no member "min"
  
  mod.cu(4604): error: namespace "std" has no member "min"
  
  31 errors detected in the compilation of "C:/Users/Matej/AppData/Local/Temp/tmpxft_00001d84_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 -Xlinker /DEBUG -m32 -Xcompiler -DCUDA_NDARRAY_CUH=d67f7c8a21306c67152a70a88a837011,/Zi,/MD -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\theano\\sandbox\\cuda -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\numpy\\core\\include -IC:\\TheanoPython\\python-2.7.6\\include -o C:\\Users\\Matej\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.6-32\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LC:\\TheanoPython\\python-2.7.6\\libs -LNone\\lib -LNone\\lib64 -LC:\\TheanoPython\\python-2.7.6 -lpython27 -lcublas -lcudart')
  ERROR:theano.sandbox.cuda:Failed to compile cuda_ndarray.cu: ('nvcc return status', 2, 'for cmd', 'nvcc -shared -g -O3 -Xlinker /DEBUG -m32 -Xcompiler -DCUDA_NDARRAY_CUH=d67f7c8a21306c67152a70a88a837011,/Zi,/MD -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\theano\\sandbox\\cuda -IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\numpy\\core\\include -IC:\\TheanoPython\\python-2.7.6\\include -o C:\\Users\\Matej\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.6-32\\cuda_ndarray\\cuda_ndarray.pyd mod.cu -LC:\\TheanoPython\\python-2.7.6\\libs -LNone\\lib -LNone\\lib64 -LC:\\TheanoPython\\python-2.7.6 -lpython27 -lcublas -lcudart')
  mod.cu
  
  ['nvcc', '-shared', '-g', '-O3', '-Xlinker', '/DEBUG', '-m32', '-Xcompiler', '-DCUDA_NDARRAY_CUH=d67f7c8a21306c67152a70a88a837011,/Zi,/MD', '-IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\theano\\sandbox\\cuda', '-IC:\\TheanoPython\\python-2.7.6\\lib\\site-packages\\numpy\\core\\include', '-IC:\\TheanoPython\\python-2.7.6\\include', '-o', 'C:\\Users\\Matej\\AppData\\Local\\Theano\\compiledir_Windows-8-6.2.9200-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.6-32\\cuda_ndarray\\cuda_ndarray.pyd', 'mod.cu', '-LC:\\TheanoPython\\python-2.7.6\\libs', '-LNone\\lib', '-LNone\\lib64', '-LC:\\TheanoPython\\python-2.7.6', '-lpython27', '-lcublas', '-lcudart']
  </code></pre>
  
  <p>If I run <code>import theano</code> without the GPU option on, it runs without a problem. Also CUDA samples run without a problem. </p>