From bcd47d18ca361ea7345b3d913e35b68f63f42cf9 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Wed, 30 Jul 2025 11:32:56 -0700 Subject: [PATCH] CMake 3.30: Ignore SM 10.0+ The legacy CMake logic we have fails the moment that CUDA Toolkit advertises SMs >= 10.0. While we work on a modernization, this breaks all CUDA builds, even for older SMs. Exclude newer SMs for now from our build logic. --- Tools/CMake/AMReXUtils.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tools/CMake/AMReXUtils.cmake b/Tools/CMake/AMReXUtils.cmake index a935936914e..3bc0ba779f7 100644 --- a/Tools/CMake/AMReXUtils.cmake +++ b/Tools/CMake/AMReXUtils.cmake @@ -222,15 +222,22 @@ endfunction () function (convert_cuda_archs _cuda_archs) foreach (_item IN LISTS ${_cuda_archs}) + # remove -real suffixes + string(REGEX REPLACE "\\-real$" "" _item "${_item}") + string(REGEX MATCH "\\." _has_decimal "${_item}") string(REGEX MATCH "[0-9]+" _is_number "${_item}") if (NOT _has_decimal AND _is_number) math(EXPR _int "${_item}/10" OUTPUT_FORMAT DECIMAL) math(EXPR _mod "${_item}%10" OUTPUT_FORMAT DECIMAL) - list(APPEND _tmp "${_int}.${_mod}") + if(_int LESS 10) # CMake 3.30 does not support SM 10.0+ in cuda_select_nvcc_arch_flags + list(APPEND _tmp "${_int}.${_mod}") + endif() else () - list(APPEND _tmp ${_item}) + if(_item LESS 10) # CMake 3.30 does not support SM 10.0+ in cuda_select_nvcc_arch_flags + list(APPEND _tmp ${_item}) + endif() endif() endforeach ()