CUDA Build Error

This is a question similar to some others, but after extensive search I have yet to find a solution:

I am attempting to compile my code in VS 2019 and getting the following error:

Severity Code Description Project File Line Suppression State
Error MSB3721 The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MDd " -o x64\Debug\kde_cuda_kdtr.cu.obj “C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_cuda_kdtr.cu”” exited with code 1. MultiGPUParallelSpatialAdaptiveKDE C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.1.targets 764

This issue is specifically perplexing because I have no issues compiling and running the CUDA Samples included with the toolkit, it is only the project I am working on. If anyone could point me in the correct direction, I would greatly appreciate the help.

1>------ Rebuild All started: Project: MultiGPUParallelSpatialAdaptiveKDE, Configuration: Debug x64 ------
1>Build started 7/17/2020 10:37:42 AM.
1>Target _PrepareForClean:
1> Deleting file “x64\Debug\MultiGPU.d4d9fdb1.tlog\MultiGPUParallelSpatialAdaptiveKDE.lastbuildstate”.
1>Target CudaClean:
1> Target CudaCleanCore:
1> Deleting file “x64\Debug\CUDA_KDtree.cu1911139392.deps”.
1> Target CudaCleanCore:
1> Deleting file “x64\Debug\kde_cuda_kdtr.cu-459596588.deps”.
1> Target CudaCleanCore:
1> Deleting file “x64\Debug\kde_kernel_kdtr.cu1000621098.deps”.
1> Target CudaCleanCore:
1> Deleting file “x64\Debug\KDtree.cu973808304.deps”.
1>Target InitializeBuildStatus:
1> Touching “x64\Debug\MultiGPU.d4d9fdb1.tlog\unsuccessfulbuild”.
1>Target CudaBuild:
1> Target PrepareForCudaBuild:
1> Target PrepareForCudaBuild:
1> Target PrepareForCudaBuild:
1> Target CudaBuildCore:
1> Compiling CUDA source file KDtree.cu…
1> Target CudaBuildCore:
1> Compiling CUDA source file kde_cuda_kdtr.cu…
1> Compiling CUDA source file kde_kernel_kdtr.cu…
1> Target CudaBuildCore:
1> Compiling CUDA source file CUDA_KDtree.cu…
1>
1> C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MTd " -o x64\Debug\kde_cuda_kdtr.cu.obj “C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_cuda_kdtr.cu”
1>
1> C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MTd " -o x64\Debug\KDtree.cu.obj “C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\KDtree.cu”
1>
1> C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MTd " -o x64\Debug\kde_kernel_kdtr.cu.obj “C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_kernel_kdtr.cu”
1>
1> C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MTd " -o x64\Debug\CUDA_KDtree.cu.obj “C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\CUDA_KDtree.cu”
1> C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_kernel_kdtr.cu(486): warning : variable “tmp” was set but never used
1>
1> C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_kernel_kdtr.cu(696): warning : variable “tmp” was set but never used
1>
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(191): warning : conversion from a string literal to “char *” is deprecated
1>
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(192): warning : conversion from a string literal to “char *” is deprecated
1>
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(202): warning : conversion from a string literal to “char *” is deprecated
1>
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(203): warning : conversion from a string literal to “char *” is deprecated
1>
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(2351): error : expression must have a constant value
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(2351): note: the value of variable “n”
1> (2347): here cannot be used as a constant
1>
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_kernel_kdtr.cu(486): warning : variable “tmp” was set but never used
1>
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_kernel_kdtr.cu(696): warning : variable “tmp” was set but never used
1>
1> 1 error detected in the compilation of “C:/Users/TIMOTH~1.RUB/AppData/Local/Temp/tmpxft_00001c20_00000000-7_kde_cuda_kdtr.cpp1.ii”.
1> kde_cuda_kdtr.cu
1> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.1.targets(764,9): error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MTd " -o x64\Debug\kde_cuda_kdtr.cu.obj “C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_cuda_kdtr.cu”” exited with code 1.
1> Done building target “CudaBuildCore” in project “MultiGPUParallelSpatialAdaptiveKDE.vcxproj” – FAILED.
1>
1> Done building project “MultiGPUParallelSpatialAdaptiveKDE.vcxproj” – FAILED.
1> KDtree.cu
1> CUDA_KDtree.cu
1> kde_kernel_kdtr.cu
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/CUDA_KDtree.cu(275): warning C4267: ‘=’: conversion from ‘size_t’ to ‘int’, possible loss of data
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/CUDA_KDtree.cu(305): warning C4267: ‘=’: conversion from ‘size_t’ to ‘int’, possible loss of data
1> C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/CUDA_KDtree.cu(312): warning C4267: ‘+=’: conversion from ‘size_t’ to ‘int’, possible loss of data
1> Done building target “CudaBuildCore” in project “MultiGPUParallelSpatialAdaptiveKDE.vcxproj”.
1>
1> Done building project “MultiGPUParallelSpatialAdaptiveKDE.vcxproj”.
1>
1>Build FAILED.
1>
1>C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_kernel_kdtr.cu(486): warning : variable “tmp” was set but never used
1>C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_kernel_kdtr.cu(696): warning : variable “tmp” was set but never used
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(191): warning : conversion from a string literal to “char *” is deprecated
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(192): warning : conversion from a string literal to “char *” is deprecated
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(202): warning : conversion from a string literal to “char *” is deprecated
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(203): warning : conversion from a string literal to “char *” is deprecated
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_kernel_kdtr.cu(486): warning : variable “tmp” was set but never used
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_kernel_kdtr.cu(696): warning : variable “tmp” was set but never used
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/CUDA_KDtree.cu(275): warning C4267: ‘=’: conversion from ‘size_t’ to ‘int’, possible loss of data
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/CUDA_KDtree.cu(305): warning C4267: ‘=’: conversion from ‘size_t’ to ‘int’, possible loss of data
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/CUDA_KDtree.cu(312): warning C4267: ‘+=’: conversion from ‘size_t’ to ‘int’, possible loss of data
1>C:/Users/Timothy.Rubio/source/repos/MultiGPUParallelSpatialAdaptiveKDE/MultiGPUParallelSpatialAdaptiveKDE/kde_cuda_kdtr.cu(2351): error : expression must have a constant value
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 10.1.targets(764,9): error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64” -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MTd " -o x64\Debug\kde_cuda_kdtr.cu.obj “C:\Users\Timothy.Rubio\source\repos\MultiGPUParallelSpatialAdaptiveKDE\MultiGPUParallelSpatialAdaptiveKDE\kde_cuda_kdtr.cu”” exited with code 1.
1> 11 Warning(s)
1> 2 Error(s)
1>
1>Time Elapsed 00:00:06.71
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

More Detailed output for anyone kind enough to assist here.