Skip to content

CUDA: Don't fail to detect the architecture just because NVCC doesn't support the system's C++ compiler

I'm using cmake 3.23.0-rc2. On a system with GCC 10 being the default C++ compiler and CUDA 10.2.89 installed, trying to configure a CUDA project yields:

CMake Error at /opt/versions/cmake/3.23.0-rc2/share/cmake-3.23/Modules/CMakeDetermineCUDACompiler.cmake:632 (message):
  Failed to detect a default CUDA architecture.

  

  Compiler output:

Call Stack (most recent call first):
  CMakeLists.txt:19 (PROJECT)

This statement is not true. That is, yes, you failed to detect, but you really don't have to. You can compile a perfectly mundane C++ program that will give you the information you need; or you could try nvidia-smi; etc.

Related to #23322 .

Edited by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information