CUDA 10 support for Visual Studio 2017 Update 8 and later

The release notes states support for:
Microsoft Visual Studio 2017* (RTW, Update 8 and later)
with this note
*Starting with CUDA 10.0, nvcc supports all versions of Visual Studio 2017 (past and upcoming updates)
https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html

The Installation Guide Windows only states Update 7:
Visual Studio 2017 (RTW and Update 7)
https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html

Please fix the installation guide, if Update 8 and later versions are supported

Also there was a VS2017 15.8.5 update today that I currently have working and installed with a hacked header file Cuda 9.2.

Would be great to know if people have 15.8.5 working ok with Cuda 10 before we look at updating.

I have VS2017 15.8.5 on win10 working with Cuda 10 out of the box - no hacks required

I am currently trying to install CUDA 10.0 on my windows 10 dell laptop which has a gtx 960M series of gpu.
However, my install of CUDA toolkit always stops at CUDA visual studio integration step.
The guide says I must have visual studio 2017 and visual c++ compiler 15.7 and 15.0.
I’ve tried a number of different combinations but nothing seems to work. I’ve downloaded 2017 community version of visual studio.

I am also having issues with CUDA 10.0 version for Microsoft visual studio 2017 latest version 15.8.7. I am getting compilation error for the nbody samples. If anyone gets solved this problem, please let me know.

Same problem as Kushalj… reinstalled visual… nothing!

I am facing the same problems as @khinmaunghtay4ah. I am getting compilation errors for the matrixmul sample that I tried to run. It says it cannot include header files and other (more than 400) errors.

@petru.nedelcu install the visual c++ compilers from the installer itself.I think you’ll need 15.4.3 and 15.8.7 compilers as well.

Are there some paths or environment variables we need to set for the visual c++ compilers?

I had the same problem. None of the examples work out of the box for me.

I noticed that the Cuda included marcos under the VC++ includes do not appear to to be complete. I see macros for CUDA 9.1 and 9.2 (both of which work fine for me out of the box) but none for 10.

What I did was right click on the project -> properties -> under the VC++ Directories -> Include Directories -> add the path to the Cuda tool kit. My case it was “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include”. Make sure to set it for both release and debug.

After that is done, clean and rebuild -> the number of errors should drop to one. “The CUDA Toolkit v10.0 directory ‘’ does not exist. Please verify the CUDA Toolkit is installed properly or define the CudaToolkitDir property to resolve this error.” This error is caused by the $(CudaToolkitDir) macro not being set; in my case it was empty.

To resolve this, under your project properties -> CUDA C/C++ -> under common -> add the path to the CUDA 10 directory to the CUDA Toolkit custom Dir field. In my case it was “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0”.

After that -> clean and rebuild -> should be good to go!
Annoyingly this has to be done for all Cuda Project.

I am going to open an issue with Nvidia to see if they can resolve this in the future.

Had the same issue… using VS 2017 15.7.4. with CUDA v10.0

When I ran VS in Run as Administrator. The error went away and I was able to build and run the sample code.

The solution came to be because I noticed that the sample code are in Program Data folder, and my VS running regularly was not able to save files.

Hope this helps

I can confirm that running VS2017 as administrator, at least once, and building, results with it fixing the cuda stuff. I don’t know why this worked, but it did. I was dubious, then impressed.

A better option is to move the sample code to somewhere accessible with standard privileges. You probably won’t develop with your code there (in \Program Data) so it makes more sense to me to move the samples to where you WILL develop so you can test out your development environment installation.