Skip to content

Leverage archspec GPU detection for +cuda and +rocm variants - #53113

Draft
Aiden2244 wants to merge 7 commits into
spack:developfrom
Aiden2244:archspec/support-gpus
Draft

Aiden2244 wants to merge 7 commits into
spack:developfrom
Aiden2244:archspec/support-gpus

Conversation

@Aiden2244

@Aiden2244 Aiden2244 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Add feature to spack which uses archspec to auto-detect GPU microarchitecture identifiers for NVIDIA and AMD GPUs when the +cuda or +rocm variants are specified without versions.

This is blocked on archspec #247 which adds GPU detection capability for archspec.

TODO: At current, this works by making the +cuda and +rocm variants special cases in the solver and overriding the package defaults. This is not desirable, and the relevant logic is to be refactored into the Spack packages API.

@Aiden2244
Aiden2244 force-pushed the archspec/support-gpus branch 5 times, most recently from 7206ff0 to 9584da7 Compare October 1, 2026 16:23
@Aiden2244
Aiden2244 force-pushed the archspec/support-gpus branch from 9584da7 to 5e4c97f Compare October 6, 2026 15:50
@Aiden2244
Aiden2244 force-pushed the archspec/support-gpus branch 2 times, most recently from f9c77e1 to 553976c Compare October 20, 2026 17:49
Adds the archspec.gpu package and its detection JSON, plus the
"archspec gpu" CLI subcommand, from the archspec detect-gpus branch.
Needed by the upcoming concretizer change that uses GPUs detected on
the host as variant defaults.

Signed-off-by: Aiden McCormack <aiden.mccormack@kitware.com>
@Aiden2244
Aiden2244 force-pushed the archspec/support-gpus branch 2 times, most recently from 895fbf1 to 3fd39a8 Compare October 22, 2026 17:03
Signed-off-by: Aiden McCormack <aiden.mccormack@kitware.com>
Signed-off-by: Aiden McCormack <aiden.mccormack@kitware.com>
@Aiden2244
Aiden2244 force-pushed the archspec/support-gpus branch 3 times, most recently from 7cba474 to 952bb3e Compare October 23, 2026 16:28
Signed-off-by: Aiden McCormack <aiden.mccormack@kitware.com>
Bare cuda_arch / amdgpu_target values are compared exactly, by the
variant that holds them, as they are on develop. Only a range form
will defer to the GPU logic on ArchSpec.

Signed-off-by: Aiden McCormack <aiden.mccormack@kitware.com>
To preserve existing behavior, comparisons between GPU-variant specs
will match based on exact values of cuda_arch/amdgpu_target unless the
value of those variants is explicitly marked with a leading colon (e.g.
``cuda_arch=:86``). This syntax is based on CPU target ranges and
indicates that the comparison should be a compatibility check instead of
an exact match.

Signed-off-by: Aiden McCormack <aiden.mccormack@kitware.com>
@Aiden2244
Aiden2244 force-pushed the archspec/support-gpus branch from 952bb3e to a96e77b Compare October 23, 2026 22:29

This branch has not been deployed

No deployments
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.

1 participant