NVIDIA / cuda-samples

Samples for CUDA Developers which demonstrates features in CUDA Toolkit
Other
5.75k stars 1.69k forks source link

All samples fail to load with VS2022 #281

Open tksharpless opened 3 days ago

tksharpless commented 3 days ago

Just cloned and tried to load project "Samples_VS2022.sln". Every single project load fails with the same error message. Example: C:\Users\tksha\cuda-samples\Samples\6_Performance\UnifiedMemoryPerf\UnifiedMemoryPerf_vs2022.vcxproj : error : The imported project "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.4.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations\CUDA 12.4.props" is correct, and that the file exists on disk. C:\Users\tksha\cuda-samples\Samples\6_Performance\UnifiedMemoryPerf\UnifiedMemoryPerf_vs2022.vcxproj The same message appeared in a popup: image

tksharpless commented 3 days ago

My Cuda Toolkit version is 12.5. Evidently the problem is that the vcxproj files all import projects named "CUDA 12.4.xxxx", which don't exist on my system. The corresponding CUDA 12.5 ones do. Unfortunately it is not possible to correct this via the VS IDE; it simply refuses to load the projects.

tksharpless commented 3 days ago

As a quick and dirty workaround I made copies of the 3 files "CUDA 12.5.props", "CUDA 12.5.targets" and "CUDA 12.5.xml" with ".4" in place of ".5". This allowed VS 2022 to load (veerrry slllooowly) and eventually to build the test projects. I strongly suggest you start using cmake to create correct MS projects on the fly. Many benefits would accrue.