CUDA: CMakeCUDACompilerId.cu can't be 32-bit-compiled
- CMake: 3.10.0
- CUDA: 9.0
- OS: Windows 10
- VS: 2017
Events in order:
1.Use CMake to generate VS2017 project, 32-bit.
-- The CUDA compiler identification is unknown
CMake Error at CMakeLists.txt:2 (project):
No CMAKE_CUDA_COMPILER could be found.
2.Find the command in CMakeFiles\CMakeError.log
that cause error, and execute it.
"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compu te_30\" --use-local-env --cl-version 2017 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.11.25503\bin\HostX86\x86" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -D_MBCS -Xcompiler "/EHsc /W0 /nologo /Od /FS /Zi /RTC1 /MDd " -o Debug\CMakeCUDACompilerId.cu.obj "E:\Works\CUDA\cupix\build\CMakeFiles\3.10.0\CompilerIdCUDA\CMakeCUDACompilerId.cu"
nvcc fatal : 32 bit compilation is only supported for Microsoft Visual Studio 2013 and earlier
3.Generate VS2017 project, 64-bit (Win64). OK.
4.On another PC with the same environment (the beginning 4 lines). 32-bit and 64-bit are both OK.