CUDA,VS: Improve error when cudart component is missing
If the CUDA 11+ Toolkit with VS Integration is installed, but the cudart
component is missing, CMake fails to identify/find the nvcc
compiler because cuda_runtime.h
is not available. Currently our error message is just
The CUDA compiler identification is unknown
CMake Error at CMakeLists.txt:... (...):
No CMAKE_CUDA_COMPILER could be found.
A user can only diagnose the problem by studying CMakeFiles/CMakeError.log
, noticing the error
fatal error C1083: Cannot open include file: 'cuda_runtime.h': No such file or directory
and knowing that the cudart
component is needed to get it.
Maybe CMake's VS generator can be taught to check for this, or at least suggest this to the user as a possible reason for the failure.