Visual Studio 2022: nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

I have been trying to build AmgX with Visual Studio 2022, for the shared dll (amgxsh.dll) which works fine without AMGX_WITH_MPI flag. However, with AMGX_WITH_MPI flag, the only file that cannot pass the nvcc compilation is comms_mpi_hostbuffer_stream.cu, initially due to too many template sections, and it suggested to use /bigobj flag. After applying the /bigobj flag, it generates the following fatal error:

D:\AMGX-main\CASAmgXwMPIDLL>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe” -gencode=arch=compute_52,code=“sm_52,compute_52” --use-local-env -ccbin “C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64” -x cu -I…\external\rapidjson\include -I…\base\include -I…\core\include -I…\template_plugin\include -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -I"C:\Program Files (x86)\Microsoft SDKs\MPI\Include\" -I"C:\ProgramData\vcpkg\installed\x64-windows\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static /bigobj -DNVTX_RANGES -DWIN32 -DNDEBUG -DAMGX_API_EXPORTS -DAMGX_WITH_MPI -DRAPIDJSON_DEFINED -D_WINDOWS -D_USRDLL -DCUSPARSE_GENERIC_INTERFACES -DDISABLE_MIXED_PRECISION -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS -D_WINDLL -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /O2 /Fdx64\Release\vc143.pdb /FS /MD " -o x64\Release\comms_mpi_hostbuffer_stream.cu.obj “D:\AMGX-main\base\src\distributed\comms_mpi_hostbuffer_stream.cu”
nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified

and these statements were produced after switching to use “Detailed” in “MSBuild project build output verbosity” in Tools->option->Projects and Solutions->Build and Run, as even “Minimal” option produces the same error. “Detailed” produces a lengthy log but for the fatal error, it does not produce more information than the listed statements.
What could be the cause? How to resolve it? Thanks in advance for any insight.

BTW, I did use CMakefile initially, I could not make it work after so many attempts. Eventually I found it’s much easier with Visual Studio project — I am more familiar to Visual Studio and the latest version (2022) makes things much easier, and I use CUDA 11.6 and the latest download of AmgX by NVIDIA which was updated early this year and last month.