Skip to content

Dependencies: AMReX CUDA CMake 3.25+ - #615

Merged
ax3l merged 2 commits into
AMReX-Codes:developmentfrom
ax3l:cmake-cuda-modernize
Aug 27, 2026
Merged

Dependencies: AMReX CUDA CMake 3.25+#615
ax3l merged 2 commits into
AMReX-Codes:developmentfrom
ax3l:cmake-cuda-modernize

Conversation

@ax3l

@ax3l ax3l commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Bumps commit_amrex to AMReX-Codes/amrex#4773 (as BLAST-WarpX/warpx#7202 does for WarpX): CUDA architectures are now selected through the standard CMake interface and the CMake minimum rises to 3.25.
This moves our CI over to the new spelling and raises pyAMReX's own CMake minimum to match.

Details

The variables we usually set in our scripts still work, but are deprecated and warn on configure.

Environment variables:

old (deprecated, warns) new
export AMREX_CUDA_ARCH=8.0 export CUDAARCHS=80
export AMREX_CUDA_ARCH="7.0;7.5" export CUDAARCHS="70;75"

CMake options:

old (deprecated, warns) new
-DAMReX_CUDA_ARCH=8.0 -DCMAKE_CUDA_ARCHITECTURES=80
-DAMReX_CUDA_ARCH=Auto -DCMAKE_CUDA_ARCHITECTURES=native (new default)
-DAMReX_CUDA_ARCH=Common -DCMAKE_CUDA_ARCHITECTURES=all-major

Values are integers (80, not 8.0); native, all, all-major and the 90a forms are supported as well.

User-facing:

  • CMake 3.25.0+ is now required (was 3.24.0); documented in docs/source/install/dependencies.rst.
  • The default is native, resolved from the GPUs visible to cmake. Configuring where no GPU is visible (HPC login node, container, CI) now requires an explicit architecture — our CI sets one.
  • New "Select GPU Architectures" section in docs/source/install/cmake.rst, plus a CMAKE_CUDA_ARCHITECTURES row in the build options table.
  • commit_amrex moves 17 commits forward, from 5273b558 to 19e6fba7 — the same AMReX that WarpX#7202 pins, to keep the stack consistent.

Internal:

  • Removed cmake_policy(SET CMP0104 OLD), the pre-3.20 path AMReX dropped; keeping it would clear CMAKE_CUDA_ARCHITECTURES.
  • CMP0105 is deliberately kept: it is a separate policy about device link options that AMReX#4773 does not address. Because a policy is still set to OLD, the CMAKE_WARN_DEPRECATED OFF work-around stays too — unlike WarpX#7202, which could drop both. Retiring CMP0105 is a good follow-up, but wants a CUDA link-step test this PR does not provide.
  • Migrated .github/workflows/ubuntu.yml to -DCMAKE_CUDA_ARCHITECTURES=80.

Testing

  • Configured AMReX_GPU_BACKEND=CUDA with -DCMAKE_CUDA_ARCHITECTURES=80 against the new pin: configures cleanly, reports CUDA architectures: 80, and fetches AMReX 19e6fba7.
  • -DAMReX_CUDA_ARCH=8.0 still configures, warns as documented and resolves to 80.
  • No new CMake deprecation warnings at configure.
  • Sphinx docs build with no warnings from the changed pages.

ax3l added 2 commits August 26, 2026 15:51
AMReX modernized its CUDA CMake logic and now requires CMake 3.25+:
AMReX-Codes/amrex#4773

Bump `commit_amrex` to that change and adopt it here. Architecture
selection moves to the standard CMake interface
(`CMAKE_CUDA_ARCHITECTURES` / `CUDAARCHS`, integer values). The
AMReX-specific `AMReX_CUDA_ARCH` / `AMREX_CUDA_ARCH` spellings still
work but warn, so our CI moves over.

`cmake_policy(SET CMP0104 OLD)` is removed: that is exactly the
pre-3.20 path AMReX dropped, and keeping it would clear
`CMAKE_CUDA_ARCHITECTURES` and defeat the new handling.

`CMP0105` is deliberately kept for now: it is a separate policy about
device link options that AMReX#4773 does not address, so the
`CMAKE_WARN_DEPRECATED OFF` work-around stays with it (unlike in
WarpX, where no policy is set to `OLD` anymore).

Raise the documented and enforced CMake minimum from 3.24 to 3.25 in
`CMakeLists.txt`, `setup.py`, `pyproject.toml` and the docs, and
document how to select architectures in the install docs.
@ax3l ax3l added backend: cuda Specific to CUDA execution (GPUs) install Build and installation labels Aug 27, 2026
@ax3l
ax3l requested review from EZoni and WeiqunZhang August 27, 2026 16:11
@ax3l ax3l changed the title Dependencies: AMReX update + CMake 3.25 Dependencies: AMReX CUDA CMake 3.25+ Aug 27, 2026
@ax3l
ax3l enabled auto-merge (squash) August 27, 2026 17:29
@ax3l
ax3l merged commit 2955974 into AMReX-Codes:development Aug 27, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend: cuda Specific to CUDA execution (GPUs) install Build and installation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants