Getting "CUDA_ARCHITECTURES is empty" with CUDA 9.2, not with later versions
I'm using CMake 3.20.5 to run the following CMakeLists.txt
script:
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
project(dummy LANGUAGES CUDA)
include(FindCUDA/select_compute_arch)
CUDA_DETECT_INSTALLED_GPUS(INSTALLED_GPUS)
message(STATUS "detected GPUs are: ${INSTALLED_GPUS}")
If I have CUDA 10.2 or 11.3.1, this works fine. However, if I downgrade to CUDA 9.2, this happens:
$ cmake -S . -B build
-- The CUDA compiler identification is unknown
-- Detecting CUDA compiler ABI info
CMake Error in /tmp/delme2/build/CMakeFiles/CMakeTmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_ca298".
CMake Error in /tmp/delme2/build/CMakeFiles/CMakeTmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_ca298".
CMake Error at /opt/versions/cmake/cmake-3.20.5/share/cmake-3.20/Modules/CMakeDetermineCompilerABI.cmake:49 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
/opt/versions/cmake/cmake-3.20.5/share/cmake-3.20/Modules/CMakeTestCUDACompiler.cmake:19 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:2 (project)
-- Configuring incomplete, errors occurred!
I'm attaching the output log: CMakeOutput.log
Also seeing this with CMake 3.21.0-rc2 .
Edited by Eyal Rozenberg