Visual Studio 2017 not detecting changes in CUDA .cu files

Interestingly, it works correctly for the Samples_vs2017 solution, but not for File->New Project->CUDA 9.1 Runtime. I can’t spot the relevant difference in the configurations. I am using the 2016 (v140) Platform Toolset for both cases.

Anyway… I can edit the code, hit F5, and it will run the last build without recompiling. I am reduced to Rebuild All every time I want to compile anything.

There’s a Stack Overflow already for the same issue: Visual Studio 2017 not detecting change in .cu (CUDA) files - Stack Overflow

AFAICT, it only works if the project is under one of a few special, privileged directories including C:\ProgramData and C:\Users\userName\AppData\Local. If I move the whole solution directory tree in and out of these directories, F5 starts or stops working. But, random dirs such as C:\develop or even C:\Users\userName does not work. Notably, the default New Project location C:\Users\userName\Documents\Visual Studio 2017\Projects\projectName does not work.

I also have that problem, I can’t move the project to one of these directories.

Finally got it working by forcing a Compile instead of a build using Build -> Compile or Ctrl+F7 instead of just ‘F7’.
This fixed the issue for me, but also (it’s probably NOT necessary) when getting it to work the first time I tried a Build -> Run Code Analysis on File (which also worked). After that I tried the Compile was a much easier hotkey… so I’ve been doing that since.

I have the same experience. I can also confirm that putting the project under c:\users\USERNAME\AppData\PROJECT does NOT exhibit the problematic behavior.

What’s expected:
Pressing F5 should detect changes in all files of all types and rebuild as necessary. It should not matter what directory the project is located in.

What actually happens:
If the project is in certain folders (e.g. c:\users\USERNAME\AppData\PROJECT), ALL changes are detected in ALL files (.h, .cpp, .cu, etc.), and F5 works as expected.
If the project is NOT in some certain folders, and is instead in (for example) My Documents somewhere, pressing F5 detects changes in C/C++ files, but NOT .cu files.
A “Clean Solutions” followed by F5 correctly detects changes and builds as expected, even in My Documents. Cleaning should not be necessary.

Where are these special folders hard coded? Can “custom” folders (e.g. something under My Documents) be added to this special list of locations?

This still is a problem with Cuda 9.2 and VS2017 15.7.2 :-(

“I have the same experience. I can also confirm that putting the project under c:\users\USERNAME\AppData\PROJECT does NOT exhibit the problematic behavior.”

I tried doing this, but that did not seem to have any effect. The normal build still ignores whether my .cu file is up-to-date.

I am using Cuda 9.2 and VS2017 15.7.5 and still experiencing the same issues.

You shouldn’t have to force a rebuild when you do an edit to just a .cu file, but that seems to be the current solution. This often leads to believing you have an error when you don’t if you accidentally forget to rebuild.

Is there any chance this will get fixed any time soon?

Are all internal NVIDIA developers forced to use an old version of Visual Studio or something? How can this be?

I just can’t believe that this won’t get addressed. There have been two or three new versions of CUDA released since VS2017 was released, and still there is no official support for VS2017.

What is your advise? Should we purchase VS2015? I believe Microsoft stopped selling that version.

Hello NVidia? Anybody listening?

There have been zero responses to us struggling to maintain an old VS2017 version with continual problems.

You want CUDA and CUDA cards to sell, then HELP US!

We can’t develop software if the tools continually cause us problems.

I want to escalate this. Who do I contact?

This is still an issue with CUDA 10 inside VS 2017 15.8.5.

If I use a command line with msbuild.exe project.vcxproj, then the change in the .cu file is noticed.

Please fix this!

I’m also seeing this on a new install of CUDA 10.0 and VS 2017 15.8.5.

Same here. How do we escalate this?

Same here, see post from 08/29/2018.

What a joke.

file a bug at developer.nvidia.com

But where exactly do we file the bug? Forums takes us back here.

If you are logged in as a registered developer at developer.nvidia.com, click on your name in the upper right hand corner. Select “My Account”. Then click on “My Bugs” on the left hand side.

This CUDA stuff is really unstable and VERY poor, at least on Windows. I can only assume NVidia focus all their efforts on the Linux community.

They definitely don’t seem to care about Windows developers.

This issue is also affecting me. A new CUDA project will only compile the CUDA kernel with a Ctrl+F7 or solution rebuild. Making changes to the code and hitting F5 or F7 won’t compile the changes.

I have filled bug #2396234 for this issue.