From BlenderWiki

Jump to: navigation, search

xxx

Cycles And CUDA Binaries

Currently CUDA GPU Toolkit 6.0 is supported: https://developer.nvidia.com/cuda-downloads

Building with VS-2013

You can not build the CUDA libraries directly with the vs-2013 compiler. If you want to get vs-2013 to work then you have to prepare the environment as follows:

  • Download and install the CUDA Toolkit 6.0 (5.0 or 5.5 might also work, but are no longer officially supported by Blender)
  • Install the VS-2008 Pro or Express in parallel to VS-2013 (Actually you also can install VS-2010 if you prefer)
  • Locate the bin folder of the installed CUDA kit. That is something like
    c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin
  • Edit the file nvcc.profile and add the location of your compiler binaries at the end of the file. For VS-2008 this is typically:
    compiler-bindir = C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin

Building with vs-2008 (pro)

  • Download and install the CUDA Toolkit 6.0 (5.0 or 5.5 might also work, but are no longer officially supported by Blender)

Building with other Compilers

If you want to build with cycles and CUDA binaries you also need to install Microsoft Visual Studio (MSVC) 2008 as well and run the build process from a MSVC terminal. This is needed because the CUDA compiler needs to use the MSVC compiler.

For 64-bit builds(such as MinGW-w64) the CUDA compiler will need the 64bit toolset. It is possible to get this without MSVC professional by downloading the Windows SDK (version 7.1 has a very buggy installation but 7.0 iso should work) Additionally, there's one other thing to change for a 64-bit system. Apparently the cuda compiler has a "hard-coded" directory for 64-bit compilers. To make the fix, copy the needed file "vcvars64.bat" and rename it to "vcvarsamd64.bat" as follows:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat

to

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat

Similarly, for MinGW32, a copy is required from

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vsvars32.bat

(also needed on MSVC builds, see below)

(method copied from: http://stackoverflow.com/questions/2970493/cuda-linking-error-visual-express-2008-nvcc-fatal-due-to-null-configuratio ) Then you should be able to generate kernels.

nvcc fatal

When building via mingw and Windows SDK, Cuda compiler could fail with following message(even for 64bit building):

nvcc fatal : Visual Studio configuration file 'vsvars32.bat' could not be found for installation at 'C:/Program Files/Microsoft Visual Studio 9.0/VC/bin/../../..'

to solve that problem, you need to copy 'vcvars32.bat' and rename it to 'vsvars32.bat' as follows:

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat

to

C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat

(this workaround was taken from nvidia dev talk forum: https://devtalk.nvidia.com/default/topic/462599/vsvars32-bat-not-found-error-on-compiling-samples-with-vsvars32-bat/)