Using CUDA with Visual Studio 2017

2019-01-07 05:29发布

I'm trying to install CUDA, but I get a message saying "No supported version of visual studio was found". I think that this is because I am using Visual Studio 2017 (Community), and CUDA currently only supports up to Visual Studio 2015. Unfortunately, Microsoft will not allow me to download old versions of Visual Studio without paying a subscription fee.

Is there a way I can get around the compatibility issue with VS 2017, or can I not use CUDA?

8条回答
地球回转人心会变
2楼-- · 2019-01-07 06:25

Thank you everyone for your help. I just wanted to supplement this post with the last pieces of the puzzle. CUDA v9.0 RC is looking for VS2017 to identify as 1910 but the latest update actually identifies as 1911. To fix open .../CUDA/v9.0/include/crt/host_config.h and change this line:
#if _MSC_VER < 1600 || _MSC_VER > 1910
to this:
#if _MSC_VER < 1600 || _MSC_VER > 1911

You may also have to add the following to your CMakeLists:
list(APPEND CUDA_NVCC_FLAGS --cl-version=2017)

查看更多
Evening l夕情丶
3楼-- · 2019-01-07 06:28

In order to get working Cuda compiler nvcc in windows shell you need to do following

  1. install proper toolset version from individual component for VS 2017 - VC++ 2017 version 15.4 v.14.11 toolset

  2. Run in windows shell following "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.11

  3. You can compile nvcc code without errors from windows shell

查看更多
登录 后发表回答