Support for Visual Studio 2017

Hello,

an recurrent question comes up: Does CUDA 8 support Visual Studio 2017?

Thanks
Martin

The supported environments for CUDA 8 on windows are listed in the CUDA 8 windows install guide.

[url]Installation Guide Windows :: CUDA Toolkit Documentation

Hi Bob, I know this list. But since the list was written, VS2017 was not released and still not really is released. The question is nevertheless: will it run on VS2017 or is there still/again a tight bond between CUDA and VS.

I just want to make that nvidia knows that CUDA is not a CORE technology, it is an add on to an environment. Currerntly I cannot change the environment to a newer version when there is always a bond to CUDA.

By design, the CUDA tool chain is tightly integrated with the host tool chain. This has advantages and disadvantages. Since this general setup has not changed in ten years of CUDA’s public availability, one might safely, and conservatively, assume that it is unlikely to change.

The list of supported host platforms and host tool chains is fixed at the time of each CUDA release, it does not change when newer host tool chains become subsequently available (in general; from what I read NVIDIA may be working on an update to CUDA 8 that makes it compatible with a newer version of Xcode on Mac OS X; if that comes to pass, it would be the first exception I am aware of).

Hi!

I’ve written a blog post about building your CUDA projects on Visual Studio 2017: Archived content . Unfortunately, NVidia extensions don’t work, so we’ll have to wait for the official release from NVidia.

I have installed cuda_9.1.85_win10.exe and VisualStudio 2017 Community version 15.5.2. When I compile the sample “addKernal” I get 3 errors:

  1. E0029 expected an expression
    addKernel<<<1, size>>>(dev_c, dev_a, dev_b);
    there is red underline under the third <

  2. C1189 Only the versions …
    goes to line 135 of host_config.h
    #if _MSC_VER < 1600 || _MSC_VER > 1911

#error – unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!

  1. MSB3721
    goes to line 707 of CUDA 9.1targets
    <CudaCompile

Any help would be greatly appreciated!

Hi Johnybinp,

the problem is currently not solved and also no one from nvidia is able to give an appropriate solution. Since VS2017 is now updated more frequently and some stupid guy at nvidia hardcoded the version number, every new update of VS2017 will give the next problem. Event if a new update/release of CUDA is available, the next release of VS2017 will have the same problem again.

One solution would be to install the VS2015 build tools which you either download seperately or download via the VS2017 installer. Then you have to retarget the compiler-bin directory (a commandline option I currently cannot remember exactly) and then it shoudl work. This is how we do it currently.

The stupid thing about and - and sorry nvidia but thats a fact since years - nvidia is to stupid to allow the nvcc to attach to a multitude of compilers and hooks in directly to Visual Studio this problem will last for each VS version.

I personally would go with LLVM/clang but since we are creating PTX code and no cubin code there is also no clear answer if PTX can be created with clang and there’s also no answer if the PTX code from clang (if available) is the same to the NVCC code.

can do this:]
Remove the MSVC version number checks from NVIDIA files. See how far you get with that approach, then ponder how “stupid” “that guy” at NVIDIA was.

Yes of course you can remove some checks from the nvidia files, but as it is an official version, and I want to use the toolkit as is, I see no reason why I should look like into these files. nVidia knows this problems for a long time. And in my company a whole department is struggling with this problems. And because of these problems they cannot upgrade to a newer VS version (ONLY because of CUDA). All the rest works perfectly.