-
Notifications
You must be signed in to change notification settings - Fork 12
Theano, CUDA, CuDNN on Win10
Also see philferrier/dlwin.
Works with a standard Python install (haven't tried Anaconda, or msys'). If you run into trouble pip install
ing packages with C extensions, try cgohlke's wheels.
-
If you don't have it already,
pip install Theano
. -
Download and install CUDA 8.0 into
/d/dev/cuda/v8.0
. -
Download the VS2015 network installer. Do a custom install. In features, you only need "Programming Languages > Visual C++ > Common Tools for Visual C++ 2015" and "Windows and Web Development > Universal Windows App Development Tools > Windows 10 SDK (10.0.10240)".
-
Download CuDNN 5.1. (cough bugmenot.com cough). Copy its
bin
,lib
, andinclude
folders to/d/dev/cuda/v8.0
. -
Add to
$PATH
:c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin
andd:/dev/cuda/v8.0/bin
. -
Add env var:
INCLUDE
->c:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt
-
Add env var:
LIB
->c:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/um/x64;c:/Program Files (x86)/Windows Kits/10/Lib/10.0.10240.0/ucrt/x64
-
(I think the proper way of doing 6 & 7 is using
vcvarsall.bat
, but I'm too lazy to try to figure it out.) -
In
$HOME/.theanorc
, I had to add this to work around an error:[gpu] cxxflags = -D_hypot=hypot
-
To use the new gpuarray backend, I had to add:
[gpu] # Append these flags cxxflags = -Id:/dev/libgpuarray/include -Ld:/dev/libgpuarray/lib [dnn] include_path = d:/dev/cuda/v8.0/include library_path = d:/dev/cuda/v8.0/lib
-
If you get a weird
nvcc
error aboutmod.cu
, clear your$HOME/AppData/Local/Theano
folder.
Here is the whole of my .theanorc
:
[global]
device = cuda
optimizer_including = cudnn
floatX = float32
[gcc]
cxxflags = -D_hypot=hypot -Id:/dev/libgpuarray/include -Ld:/dev/libgpuarray/lib
[dnn]
include_path = d:/dev/cuda/v8.0/include
library_path = d:/dev/cuda/v8.0/lib/x64
conv.algo_bwd_filter = deterministic
conv.algo_bwd_data = deterministic
[lib]
cnmem = 0.7
[nvcc]
fastmath = True
[blas]
# Only used for device = cpu
ldflags = -Ld:/dev/openblas -lopenblas