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.
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.
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?
“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.
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 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.