Exited with code 1 - CUDA 11.2 and VS2019

I got this error while building with CUDA 11.2 and Visual studio 2019.

Severity Code Description Project File Line Suppression State
Error MSB3721 The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\bin\nvcc.exe” -gencode=arch=compute_30,code=“sm_30,compute_30” -gencode=arch=compute_75,code=“sm_75,compute_75” -gencode=arch=compute_20,code=“sm_21,compute_20” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64” -x cu -rdc=true -I\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\v11.2\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include" -I\include -I\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2\include" -G --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -g -DCUDNN_HALF -DCUDNN -DGPU -DLIB_EXPORTS -D_TIMESPEC_DEFINED -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -DWIN32 -DNDEBUG -D_CONSOLE -D_LIB -D_WINDLL -D_MBCS -Xcompiler “/EHsc /W3 /nologo /O2 /Fdx64\DLL_Release\vc142.pdb /FS /MD " -o x64\DLL_Release\im2col_kernels.cu.obj “D:\Yolo_v4\darknet\src\im2col_kernels.cu”” exited with code 1. yolo_cpp_dll C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.2.targets 785

File: CUDA 11.2.targets
Line 785
Code: MSB3721
Appreciate any helps
Thanks alot

HI, did you ever find a solution? I am having the same issue.

Hi there, passed this step. The reason caused this error was that I missed some files (forgot to copy them to folder x64). Please carefully check all previous steps again. Since I’ve done this half month ago, I didn’t exactly remember which files I imported.

Ok, will do. Thanks for the reply!