Cannot run samples on MS Visual Studi 2019

Same trouble. Did you solve this problem?

Not yet, I canā€™t find any information on the web, frustratingā€¦

thanks

Same happened to me with version ā€œcuda_11.2.0_460.89_win10ā€
Fixed it with rerunning the installer, under Installation option choose Custom(Advanced) make sure ā€œVisual studio integrationā€ is checked.
Screenshot 2021-01-22 003808

2 Likes

where is place for change the path? iam newbie in gpu processing

Hello every one,
I have the same problem. I have tried all the solutions mentioned here. Unfortunately, it did not work for me. I really need help.

halloā€¦
after that ,when i build the project these errors come out :
Severity Code Description Project File Line Suppression State
Error MSB3721 The command ā€œā€œC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc.exeā€ -gencode=arch=compute_35,code="sm_35,compute_35" -gencode=arch=compute_86,code="sm_86,compute_86" --use-local-env -ccbin ā€œC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\bin\HostX86\x64ā€ -x cu -IC:\opencv_3.0\opencv\build\include -IC:\opencv_3.0\opencv\build\include -Iā€¦..\include -Iā€¦..\3rdparty\stb\include -Iā€¦..\3rdparty\pthreads\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\includeā€ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -DOPENCV -DCUDNN_HALF -DCUDNN -D_TIMESPEC_DEFINED -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_CRT_RAND_S -DGPU -DWIN32 -D_CONSOLE -D_LIB -D_MBCS -Xcompiler ā€œ/EHsc /W3 /nologo /O2 /Fdx64\Release\vc142.pdb /Zi /MD " -o x64\Release\avgpool_layer_kernels.cu.obj ā€œC:\Users\at\darknet\src\avgpool_layer_kernels.cuā€ā€ exited with code 1. darknet C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.0.targets 712

1 Like

thank you

did you resolve??

Thank you so much! Youā€™re a life saver!

Error MSB4019 The imported project ā€œC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.2.propsā€ was not found. Confirm that the expression in the Import declaration ā€œC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.2.propsā€ is correct, and that the file exists on disk. deviceQuery C:\ProgramData\NVIDIA Corporation\CUDA Samples\v11.2\1_Utilities\deviceQuery\deviceQuery_vs2019.vcxproj 37

Hi @s.ken I know this is an old thread but thanks a lot for helping us newbies out. Could you please tell what was the error we were encountering and how your solution solved it?

you can search on your machine where CUDA 11.2.props then copy to this directory and last but not least, you reinstall cuda toolkit.

For me, it continually failedā€¦ so I watched the extractor and tried to figure out what was happening in my instance.
What I discovered was ā€˜Visual Studio Integrationsā€™ was failing it for meā€¦ (in my case for the 10.2 toolkit NVIDIA_Nsight_Visual_Studio_Edition_Win64_2019.4.0.19274.msi )
If you have multiple installs of Visual Studio, I believe you have to have the Visual C++ package (Desktop development with C++) installed for each of your version environmentsā€¦
This creates the proper folder structures so the integrations msi installation can complete cleanly.
Hope this head-wrecker helps someone.

i dont have the visual_studio_integration\MSBuildExtensions path, what do i do?

same problem

In my case, the Cuda Toolkit in my Windows 11 was 11.7 version. The Cuda Samples in Github run in Cuda Toolkit version 11.6. I do reinstall Cuda Toolkit for this version and it runs! But, is necessary copy files with mencioned above.

For the latest version (11.7 Jul 2022) you just need to change the version in the cuda example project. Itā€™s in the vcxproj file type. Just search for 11.6 and change to 11.7 .

Thank you

Just copy all files from this path (depends on the path you installed CUDA in)

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\visual_studio_integration\MSBuildExtensions

to this path:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations