Dependencies: AMReX CUDA CMake 3.25+ - #615
Merged
Merged
Conversation
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.
EZoni
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps
commit_amrexto 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:
export AMREX_CUDA_ARCH=8.0export CUDAARCHS=80export AMREX_CUDA_ARCH="7.0;7.5"export CUDAARCHS="70;75"CMake options:
-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-majorValues are integers (
80, not8.0);native,all,all-majorand the90aforms are supported as well.User-facing:
docs/source/install/dependencies.rst.native, resolved from the GPUs visible tocmake. Configuring where no GPU is visible (HPC login node, container, CI) now requires an explicit architecture — our CI sets one.docs/source/install/cmake.rst, plus aCMAKE_CUDA_ARCHITECTURESrow in the build options table.commit_amrexmoves 17 commits forward, from5273b558to19e6fba7— the same AMReX that WarpX#7202 pins, to keep the stack consistent.Internal:
cmake_policy(SET CMP0104 OLD), the pre-3.20 path AMReX dropped; keeping it would clearCMAKE_CUDA_ARCHITECTURES.CMP0105is deliberately kept: it is a separate policy about device link options that AMReX#4773 does not address. Because a policy is still set toOLD, theCMAKE_WARN_DEPRECATED OFFwork-around stays too — unlike WarpX#7202, which could drop both. RetiringCMP0105is a good follow-up, but wants a CUDA link-step test this PR does not provide..github/workflows/ubuntu.ymlto-DCMAKE_CUDA_ARCHITECTURES=80.Testing
AMReX_GPU_BACKEND=CUDAwith-DCMAKE_CUDA_ARCHITECTURES=80against the new pin: configures cleanly, reportsCUDA architectures: 80, and fetches AMReX19e6fba7.-DAMReX_CUDA_ARCH=8.0still configures, warns as documented and resolves to80.