I've downloaded the NVIDIA sample for CUDA and it fails to work for bandwidthTest, because of the error "nvcc ..." in command line "exited error code 1". The complete command line is(my private info is neglected):
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe" -gencode=arch=compute_50,code=\"sm_50,compute_50\" -gencode=arch=compute_52,code=\"sm_52,compute_52\" -gencode=arch=compute_60,code=\"sm_60,compute_60\" -gencode=arch=compute_61,code=\"sm_61,compute_61\" -gencode=arch=compute_70,code=\"sm_70,compute_70\" -gencode=arch=compute_75,code=\"sm_75,compute_75\" -gencode=arch=compute_80,code=\"sm_80,compute_80\" -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.29.30133\bin\HostX86\x64" -x cu -I./ -I../../../Common -I./ -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\/include" -I../../../Common -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler "/wd 4819" --threads 0 -g -DWIN32 -DWIN32 -D_MBCS -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Fdx64/Debug/vc142.pdb /FS /Zi /RTC1 /MTd " -o [private info]\bandwidthTest\x64\Debug\bandwidthTest.cu.obj "[private info]\bandwidthTest\bandwidthTest.cu"
Then I ran this code in cmd, which reported "nvcc fatal: Compiler 'cl.exe' in PATH different than the one specified with -ccbin". It seemed that the CUDA C/C++ command line went wrong. So I changed the HostX86\x64 to HostX64\x64, then it succeeded(at least no error was reported).
So, I tried to find where to edit this command line in VS2019. It's in Project->Properties->CUDA C/C++->Command Line.
Here -ccbin has a parameter string ending with "HostX86\x64". However, I have no idea about how to edit it, because it seems that there is no such option. (Maybe I left it out. All of the options can be checked at https://docs.nvidia.com/nsight-visual-studio-edition/3.2/Content/CUDA_Properties_Config.htm).
So is there any way to edit it? Or is there any other method to solve it?
