All samples fail to load with VS2022
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:
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.
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.
I had to uninstall 12.5 and install 12.4, and then it worked for me
Another solution, you can open *.vcxproj, change "12.4" to "12.5". Then open .sln and build as usual.
Another solution, you can open *.vcxproj, change "12.4" to "12.5". Then open .sln and build as usual.
I tried that. It then complained about not being able to find helper_cuda.h. Cannot open include file: 'helper_cuda.h': No such file or directory
I'm trying to use the 11.8 version.
Thanks for any help b
Here is my build info, and now the exe fps so slow. But cuda installation's .exe is 170+ fps
Build started at 10:31... 1>------ Build started: Project: nbody, Configuration: Debug x64 ------ 1>Compiling CUDA source file bodysystemcuda.cu... 1> 1>E:\workSpace\sources\cuda_samples\cuda-samples\John-zhan\cuda-samples\Samples\5_Domain_Specific\nbody>"D:\Program Files\Cuda\bin\nvcc.exe" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" -gencode=arch=compute_86,code=\"sm_86,compute_86\" -gencode=arch=compute_89,code=\"sm_89,compute_89\" -gencode=arch=compute_90,code=\"sm_90,compute_90\" --use-local-env -ccbin "D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.42.34433\bin\HostX64\x64" -x cu -I./ -I../../../Common -I./ -I"D:\Program Files\Cuda\/include" -I../../../Common -I"D:\Program Files\Cuda\include" -G --keep-dir nbody\x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" --threads 0 -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /FS /Zi /RTC1 /MTd " -Xcompiler "/Fdx64/Debug/vc143.pdb" -o E:\workSpace\sources\cuda_samples\cuda-samples\John-zhan\cuda-samples\Samples\5_Domain_Specific\nbody\nbody\x64\Debug\bodysystemcuda.cu.obj "E:\workSpace\sources\cuda_samples\cuda-samples\John-zhan\cuda-samples\Samples\5_Domain_Specific\nbody\bodysystemcuda.cu" 1>CUDACOMPILE : nvcc warning : Support for offline compilation for architectures prior to '<compute/sm/lto>_75' will be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning). 1>bodysystemcuda.cu 1>tmpxft_00005b04_00000000-7_bodysystemcuda.compute_90.cudafe1.cpp 1>Done building project "nbody_vs2022.vcxproj". 1>nbody.cpp 1>render_particles.cpp 1>Generating Code... 1> Creating library ../../../bin/win64/Debug/nbody.lib and object ../../../bin/win64/Debug/nbody.exp 1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library 1>nbody_vs2022.vcxproj -> E:\workSpace\sources\cuda_samples\cuda-samples\John-zhan\cuda-samples\bin\win64\Debug\nbody.exe 1>Done building project "nbody_vs2022.vcxproj". ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Build completed at 10:31 and took 09.790 seconds ==========
This VS solution issue should be resolved now, so I'll go ahead and mark this issue resolved. If you have any subsequent issues with the CUDA samples please feel free to open a new issue.