While trying out the NVIDIA CUDA development sample solutions in Visual Studio Community 2019, I encountered error messages about some CUDA11.2.props files not found. An example is shown in the screen shot below.
The solution to this is simple: simply do the following:
- Using the Windows Explorer, browse to the location of the NVIDIA CUDA Toolkit e.g. C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\extras\visual_studio_integration\MSBuildExtensions\.
- Select and copy all the files inside the folder: CUDA 11.2.props, CUDA 11.2.targets, CUDA 11.2.xml, and Nvda.Build.CudaTasks.v11.2.dll.
- Browse to the folder C:\Program Files(x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\.
- Paste the copied CUDA files inside.
Now, when compiling the CUDA sample solutions, the error messages no longer appear, as shown below.
Thank you very much for the instructions. My project suddenly stopped building after I downgraded my VS2019 version and your page has saved me a lot of time.
ReplyDeleteThank you very much, follow the same and my issue gone
ReplyDeleteThanks so much! This helped me a lot!
ReplyDeleteIn my case I forget to install "CUDA Toolkit 12.1", I followed the instruction
ReplyDeletehttps://github.com/nvidia/cuda-samples
Then it start working fine.
Thank you, this worked for VS2022
ReplyDelete