Skip to content

Conversation

@ax3l
Copy link
Member

@ax3l ax3l commented Jul 30, 2025

Summary

The legacy CMake logic we have fails the moment that CUDA Toolkit advertises SMs >= 10.0. While we work on a modernization #4572, the current development breaks all CUDA builds in CUDA 12.9, even for older SMs.

Exclude newer SMs for now from our build logic.

Additional background

Seen with

$ cmake --version
cmake version 3.30.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Tue_May_27_02:21:03_PDT_2025
Cuda compilation tools, release 12.9, V12.9.86
Build cuda_12.9.r12.9/compiler.36037853_0

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

@ax3l
Copy link
Member Author

ax3l commented Jul 30, 2025

Error messages where:

-- Found CUDAToolkit: /home/axel/micromamba/envs/warpx-gpu-mpich-dev/targets/x86_64-linux/include (found version "12.9.86")
CMake Error at build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:229 (math):
  math cannot parse the expression: "50-real/10": syntax error, unexpected
  exp_DIVIDE (8).
Call Stack (most recent call first):
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:262 (convert_cuda_archs)
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXParallelBackends.cmake:113 (set_cuda_architectures)
  build/_deps/fetchedamrex-src/Src/CMakeLists.txt:40 (include)


CMake Error at build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:230 (math):
  math cannot parse the expression: "50-real%10": syntax error, unexpected
  exp_MOD (8).
Call Stack (most recent call first):
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:262 (convert_cuda_archs)
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXParallelBackends.cmake:113 (set_cuda_architectures)
  build/_deps/fetchedamrex-src/Src/CMakeLists.txt:40 (include)

and

CMake Error at /home/axel/micromamba/envs/warpx-gpu-mpich-dev/share/cmake-3.30/Modules/FindCUDA/select_compute_arch.cmake:245 (message):
  Unknown CUDA Architecture Name 10.0 in CUDA_SELECT_NVCC_ARCH_FLAGS
Call Stack (most recent call first):
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:274 (cuda_select_nvcc_arch_flags)
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXParallelBackends.cmake:113 (set_cuda_architectures)
  build/_deps/fetchedamrex-src/Src/CMakeLists.txt:40 (include)


CMake Error at /home/axel/micromamba/envs/warpx-gpu-mpich-dev/share/cmake-3.30/Modules/FindCUDA/select_compute_arch.cmake:249 (message):
  arch_bin wasn't set for some reason
Call Stack (most recent call first):
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:274 (cuda_select_nvcc_arch_flags)
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXParallelBackends.cmake:113 (set_cuda_architectures)
  build/_deps/fetchedamrex-src/Src/CMakeLists.txt:40 (include)


CMake Error at /home/axel/micromamba/envs/warpx-gpu-mpich-dev/share/cmake-3.30/Modules/FindCUDA/select_compute_arch.cmake:245 (message):
  Unknown CUDA Architecture Name 10.1 in CUDA_SELECT_NVCC_ARCH_FLAGS
Call Stack (most recent call first):
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:274 (cuda_select_nvcc_arch_flags)
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXParallelBackends.cmake:113 (set_cuda_architectures)
  build/_deps/fetchedamrex-src/Src/CMakeLists.txt:40 (include)


CMake Error at /home/axel/micromamba/envs/warpx-gpu-mpich-dev/share/cmake-3.30/Modules/FindCUDA/select_compute_arch.cmake:249 (message):
  arch_bin wasn't set for some reason
Call Stack (most recent call first):
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXUtils.cmake:274 (cuda_select_nvcc_arch_flags)
  build/_deps/fetchedamrex-src/Tools/CMake/AMReXParallelBackends.cmake:113 (set_cuda_architectures)
  build/_deps/fetchedamrex-src/Src/CMakeLists.txt:40 (include)
...

@ax3l ax3l changed the title CMake 3.30: Ignore SM 10.0+ Workaround CUDA 12.9 / CMake 3.30: Ignore SM 10.0+ Jul 30, 2025
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.
@atmyers atmyers enabled auto-merge (squash) July 30, 2025 19:25
@atmyers atmyers merged commit 9f798b0 into AMReX-Codes:development Jul 30, 2025
75 checks passed
@ax3l ax3l deleted the hotfix-cuda-sm10 branch July 30, 2025 20:55
@WeiqunZhang
Copy link
Member

It seems to work for me without the change here. Maybe it's because I am using cmake 4.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants