CUDA 9.0 does not work with the latest VS 2017 update

Hi all,
I’ve recently updated my VS2017 (the current version is 15.5.0 according to the VS installer).
I am using the latest CUDA toolkit Cuda compilation tools, release 9.0, V9.0.176.

I am not able to build even a default project (the one with vector addition), as the following error shows up:

Severity    Code    Description Project File    Line    Suppression State
Error   C1189   #error:  -- unsupported Microsoft Visual Studio version! 
 Only the versions 2012, 2013, 2015 and 2017 are supported! ver2    
c:\program files\nvidia gpu computing 
toolkit\cuda\v9.0\include\crt\host_config.h 133 

I am aware of [url][/url] topic, and in the host_config.h file everything is fine.

I’ve tried to change the line in host_config.h file to the following: #if _MSC_VER < 1600 || _MSC_VER > 1912

As a result, there was no unsupported error, however, the new errors “expression must have a constant value” show up in the file type_trails.

Can someone help? Thanks

After some painful time, I was able to solve the problem. Here is the answer for those who have a similar problem:

  1. Make sure that you have VC++ 2015.3 v140 toolset (can be installed either from web or Visual Studio installer)

  2. In the project properties (general) choose Visual Studio 2015 (v140) option.

Just hit this problem also. Unfortunately your solution does not work for us due to our use of later C++ features it seems :-(

We need to compile with the VS2017 v141 toolset somehow.

Any ideas that aren’t rolling back VS?

I had the exact same issue and also could not go back to the 2105 (v140) option. You can add the 14.11 compiler back into visual studio 2017 update 5 without rolling back VS. I did the side-by-side version described at Side-by-side minor version MSVC toolsets in Visual Studio 2017 - C++ Team Blog and set the program back to using 14.11 following their instructions. This worked for me. Hope CUDA 9 has an update soon to use enable use of visual studio 14.12.

Thanks, that’s good to know. I will give that a try.

But I really hope we can have a Cuda9 update that works with the latest VS update soon - as compiling with the new update generates much better performing code!

Thank you! it works for me.

Thank you,

It works for me also.

It should be modify like the help in:


New update CUDA 9.1.85, but still does not support CL 14.12

confirmed that using VS2017 15.5.1 with the documented side by side installation of 14.11 and just adding the relevant 14.11 properties file to the solution and linking to projects as described works.


@travelhigh2838k: The workaround mentioned in the link is not a practical solution when one has to generate / compile a lot of projects (e.g. with CMAKE).

The possibility to download VS 2017 15.4 was mentioned here:

[url]CUDA 9 failed to support the latest Visual Studio 2017 version 15.5 - CUDA Setup and Installation - NVIDIA Developer Forums

I haven’t tried it, but someone else in that thread seemed to confirm that it worked. Furthermore, what Microsoft offers may be a moving target, so I don’t know if it is still offered or for how long.

@txbob: Yep, on the mentioned website [1] VS 2017 15.4 is available, thx. Lets see for how long.

With VS 15.4, after installing Cuda, I am getting this error message pop up:

“The ‘Nvda.Vsip.NvdaPackage, Nvda.Vsip.Net, Version=, Culture=Neutral,PublicKeyToken=xxxxxx’ package did not load correctly”…

Any tips?

Go to the following URL: Visual Studio 2017 Release History | Microsoft Docs
Select the Community version: - direct download link.
Download and save.
Remove your current installation of Visual 2017 (yes, it is said, but necessary). Once removed, remove Cuda and Nsight (these will have to be reinstalled anyway).
Once PC restarts, install from Visual 15.4.5 online installer. It will download the right version of packages. Install v140 and v141 compiler versions. Once done, install Cuda followed by NSight. Voila.

I managed to solve the problem keeping VS2017. The following helped:

Titan1432, that did it for me. Just trying to get a clean build out with the graphical/simulation samples.
@see: #2

the link provided by txbob worked for me (cuda 9.1 and vs2017 with v141/v140 Side by side) and resulted in successful builds of those projects to which I applied the edit. straightforward but pretty laborious
for all the dozens of samples one might wish to build. perhaps a fix is in the works to make this

Hello everyone

Dont know whether it was posted here already,
but there is fairly simple workaround to this issue.

Please see