Theano is the Deep learning python library running on GPGPU. This install instructions has worked for my machine, for details but please refer to http://deeplearning.net/software/theano/install_windows.html and http://deeplearning.net/software/theano/install.html#install
Machine : Windows 8.1(64 bit), Visual studio 2013 (currently CUDA 7.5 does not support VS2015), CUDA 7.5, Geforce GT650m
The windows installation which worked for me was as follows
- Install python 64bit
- Install precompiled whl from http://www.lfd.uci.edu/~gohlke/pythonlibs
- Numpy+MKL library
- scipy
- nose
- blas (cvxopt)
- pycuda
- Get GCC from http://tdm-gcc.tdragon.net/
- Download theano https://codeload.github.com/Theano/Theano/zip/master
- Also you can use pip install theano
- cd into the theano directory
- run python setup.py develop (other options are install, but I wanted a development environment)
- go to the python shell and import theano should work
- Check for GPU usage: Use the script from http://deeplearning.net/software/theano/tutorial/using_gpu.html#testing-theano-with-gpu
- if it is using cpu then create a .theanorc.txt and put in the C:\Users\UserName folder with following options
[global]
device = gpu
floatX = float32[nvcc]
fastmath = True
compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe - Run the test script and then it should be using the GPU
- if it is using cpu then create a .theanorc.txt and put in the C:\Users\UserName folder with following options
- Common errors faced while using the GPU (I faced them in order)
- nvcc cannot locate the location of cl.exe Solution: Set the cl.exe location in the environment path
- nvcc fatal : Microsoft Visual Studio configuration file ‘vcvars64.bat’ could not be found : Copied hte folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64 into C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64 (note the change in path) and create the file ‘vcvars64.bat’ with the following command ‘CALL setenv /x64’
- nvcc fatal : Some include missing or some lib missing : NVCC required some windows sdk includes and libraries. It might be needed to install MicrosoftSDk . Added these lines in the file “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin\nvcc.profile”INCLUDES += “-I$(TOP)/include” $(_SPACE_) “-IC:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/include” $(_SPACE_) “-IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include” $(_SPACE_)
LIBRARIES =+ $(_SPACE_) “/LIBPATH:$(TOP)/lib/$(_WIN_PLATFORM_)” $(_SPACE_) “/LIBPATH:C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/lib/amd64” $(_SPACE_) “/LIBPATH:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64” $(_SPACE_)
- Finally my GPU was being used by theano. This might be a bit dirty way to get the theano use my gpu, so please let me know if there are some better options.
Filed under: Uncategorized | 3 Comments »