VS2019 CUDA v11 nvcc.exe command line fails

Hi

I get an error trying to build CUDA in a particular library (Open3d).

I think it is likely to do with escape characters/quotes/spaces in filenames on the nvcc.exe command line call (this call is set up by CMake, I presume.

Can anyone see what the problem is - here is an example from the Visual Studio build output…

Target CudaBuildCore:
22> Compiling CUDA source file …\Repos\Open3D_CUDA\src\Open3D\Core\Kernel\BinaryEWCUDA.cu…
23> FeatureIO.cpp
22>
22> C:\myProjects\Open3d_CUDA\src\Open3D\Core>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe” -gencode=arch=compute_75,code=“sm_75,compute_75” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64” -x cu -IC:\Repos\Open3D_CUDA\src -IC:\Repos\Open3D_CUDA\3rdparty\GLFW\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" -IC:\Repos\Open3D_CUDA\3rdparty\dirent -IC:\Repos\Open3D_CUDA\3rdparty\flann -I"C:\Repos\vcpkg\installed\x64-windows\include" -IC:\Repos\Open3D_CUDA\3rdparty\jsoncpp\include -IC:\Repos\Open3D_CUDA\3rdparty\liblzf -IC:\Repos\Open3D_CUDA\3rdparty\tomasakeninemoeller\include -IC:\Repos\Open3D_CUDA\3rdparty\tinyfiledialogs\include -IC:\Repos\Open3D_CUDA\3rdparty\tinygltf\tinygltf -IC:\Repos\Open3D_CUDA\3rdparty\tinyobjloader\tinyobjloader -IC:\Repos\Open3D_CUDA\3rdparty\rply\rply -IC:\Repos\Open3D_CUDA\3rdparty\qhull\src -IC:\Repos\Open3D_CUDA\3rdparty\PoissonRecon -I"C:\Repos\vcpkg\installed\x64-windows\include\eigen3" -IC:\Repos\Open3D_CUDA\3rdparty\fmt\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static /EHsc /wd4522 /WX /bigobj --expt-extended-lambda -Xcompiler="/EHsc -Ob2" -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -DWIN32 -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -D_MBCS -Xcompiler “/EHsc /W3 /nologo /O2 /FdCore.dir\Release\Core.pdb /FS /Zi /MD /GR” -o Core.dir\Release\BinaryEWCUDA.obj “C:\Repos\Open3D_CUDA\src\Open3D\Core\Kernel\BinaryEWCUDA.cu”
22>
22> C:\myProjects\Open3d_CUDA\src\Open3D\Core>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe” -gencode=arch=compute_75,code=“sm_75,compute_75” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64” -x cu -IC:\Repos\Open3D_CUDA\src -IC:\Repos\Open3D_CUDA\3rdparty\GLFW\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" -IC:\Repos\Open3D_CUDA\3rdparty\dirent -IC:\Repos\Open3D_CUDA\3rdparty\flann -I"C:\Repos\vcpkg\installed\x64-windows\include" -IC:\Repos\Open3D_CUDA\3rdparty\jsoncpp\include -IC:\Repos\Open3D_CUDA\3rdparty\liblzf -IC:\Repos\Open3D_CUDA\3rdparty\tomasakeninemoeller\include -IC:\Repos\Open3D_CUDA\3rdparty\tinyfiledialogs\include -IC:\Repos\Open3D_CUDA\3rdparty\tinygltf\tinygltf -IC:\Repos\Open3D_CUDA\3rdparty\tinyobjloader\tinyobjloader -IC:\Repos\Open3D_CUDA\3rdparty\rply\rply -IC:\Repos\Open3D_CUDA\3rdparty\qhull\src -IC:\Repos\Open3D_CUDA\3rdparty\PoissonRecon -I"C:\Repos\vcpkg\installed\x64-windows\include\eigen3" -IC:\Repos\Open3D_CUDA\3rdparty\fmt\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static /EHsc /wd4522 /WX /bigobj --expt-extended-lambda -Xcompiler="/EHsc -Ob2" -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -DWIN32 -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -D_MBCS -Xcompiler “/EHsc /W3 /nologo /O2 /FdCore.dir\Release\Core.pdb /FS /Zi /MD /GR” -o Core.dir\Release\IndexGetSetCUDA.obj “C:\Repos\Open3D_CUDA\src\Open3D\Core\Kernel\IndexGetSetCUDA.cu”
22>
22> C:\myProjects\Open3d_CUDA\src\Open3D\Core>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe” -gencode=arch=compute_75,code=“sm_75,compute_75” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64” -x cu -IC:\Repos\Open3D_CUDA\src -IC:\Repos\Open3D_CUDA\3rdparty\GLFW\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" -IC:\Repos\Open3D_CUDA\3rdparty\dirent -IC:\Repos\Open3D_CUDA\3rdparty\flann -I"C:\Repos\vcpkg\installed\x64-windows\include" -IC:\Repos\Open3D_CUDA\3rdparty\jsoncpp\include -IC:\Repos\Open3D_CUDA\3rdparty\liblzf -IC:\Repos\Open3D_CUDA\3rdparty\tomasakeninemoeller\include -IC:\Repos\Open3D_CUDA\3rdparty\tinyfiledialogs\include -IC:\Repos\Open3D_CUDA\3rdparty\tinygltf\tinygltf -IC:\Repos\Open3D_CUDA\3rdparty\tinyobjloader\tinyobjloader -IC:\Repos\Open3D_CUDA\3rdparty\rply\rply -IC:\Repos\Open3D_CUDA\3rdparty\qhull\src -IC:\Repos\Open3D_CUDA\3rdparty\PoissonRecon -I"C:\Repos\vcpkg\installed\x64-windows\include\eigen3" -IC:\Repos\Open3D_CUDA\3rdparty\fmt\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static /EHsc /wd4522 /WX /bigobj --expt-extended-lambda -Xcompiler="/EHsc -Ob2" -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -DWIN32 -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -D_MBCS -Xcompiler “/EHsc /W3 /nologo /O2 /FdCore.dir\Release\Core.pdb /FS /Zi /MD /GR” -o Core.dir\Release\ReductionCUDA.obj “C:\Repos\Open3D_CUDA\src\Open3D\Core\Kernel\ReductionCUDA.cu”
22>
22> C:\myProjects\Open3d_CUDA\src\Open3D\Core>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe” -gencode=arch=compute_75,code=“sm_75,compute_75” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64” -x cu -IC:\Repos\Open3D_CUDA\src -IC:\Repos\Open3D_CUDA\3rdparty\GLFW\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" -IC:\Repos\Open3D_CUDA\3rdparty\dirent -IC:\Repos\Open3D_CUDA\3rdparty\flann -I"C:\Repos\vcpkg\installed\x64-windows\include" -IC:\Repos\Open3D_CUDA\3rdparty\jsoncpp\include -IC:\Repos\Open3D_CUDA\3rdparty\liblzf -IC:\Repos\Open3D_CUDA\3rdparty\tomasakeninemoeller\include -IC:\Repos\Open3D_CUDA\3rdparty\tinyfiledialogs\include -IC:\Repos\Open3D_CUDA\3rdparty\tinygltf\tinygltf -IC:\Repos\Open3D_CUDA\3rdparty\tinyobjloader\tinyobjloader -IC:\Repos\Open3D_CUDA\3rdparty\rply\rply -IC:\Repos\Open3D_CUDA\3rdparty\qhull\src -IC:\Repos\Open3D_CUDA\3rdparty\PoissonRecon -I"C:\Repos\vcpkg\installed\x64-windows\include\eigen3" -IC:\Repos\Open3D_CUDA\3rdparty\fmt\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static /EHsc /wd4522 /WX /bigobj --expt-extended-lambda -Xcompiler="/EHsc -Ob2" -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -DWIN32 -D_WINDOWS -DNDEBUG -DBUILD_CUDA_MODULE -D_GLIBCXX_USE_CXX11_ABI=0 -DWINDOWS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -DNOMINMAX -D_USE_MATH_DEFINES -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DTINYGLTF_IMPLEMENTATION -DSTB_IMAGE_IMPLEMENTATION -DSTB_IMAGE_WRITE_IMPLEMENTATION -DTINYOBJLOADER_IMPLEMENTATION -DFMT_HEADER_ONLY=1 -D"CMAKE_INTDIR=“Release”" -D_MBCS -Xcompiler “/EHsc /W3 /nologo /O2 /FdCore.dir\Release\Core.pdb /FS /Zi /MD /GR” -o Core.dir\Release\UnaryEWCUDA.obj “C:\Repos\Open3D_CUDA\src\Open3D\Core\Kernel\UnaryEWCUDA.cu”
22> nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified
22>
22> nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified