Skip to content

Detect AMD GPUs whose amd-smi board product name is N/A - #114

Merged
patrickdoc merged 1 commit into
modular:mainfrom
KenJones-Modular:amd-gpu-detection-na
Nov 14, 2026
Merged

patrickdoc merged 1 commit into
modular:mainfrom
KenJones-Modular:amd-gpu-detection-na

Conversation

@KenJones-Modular

Copy link
Copy Markdown
Member

On some boards, such as a Strix Halo (gfx1151) in a Framework Desktop, amd-smi static --json reports every board field as N/A, so mojo_host_platform finds no match in gpu_mapping and fails, or builds CPU-only when unknown GPUs are ignored.

This change falls back to asic.market_name and then asic.target_graphics_version, lists all three names in the error when none match, and also looks for amd-smi and rocm-smi in /opt/rocm/bin when they aren't on the repository rule's PATH.

Testing

Tested on a Strix Halo with ROCm 7.2.4. The host platform gets the amd_gpu and has_gpu constraints, plus the GPU-specific constraint from the caller's mapping (strixhalo_gpu with "gfx1151": "strixhalo"). The new matching logic, run against sample amd-smi data, still matches an MI355 by its product name first. This repo's CI has no GPU runners, so it doesn't exercise this path.

Assisted-by: AI

On some boards, such as a Strix Halo (gfx1151) in a Framework Desktop,
amd-smi reports every board field as N/A, so no gpu_mapping key
matches. Fall back to the ASIC's market name and then its gfx target,
name all three in the error when none match, and look for amd-smi and
rocm-smi in /opt/rocm/bin when they aren't on the repository rule's
PATH.
@KenJones-Modular
KenJones-Modular marked this pull request as ready for review November 14, 2026 01:44
@KenJones-Modular
KenJones-Modular requested review from a team and Ahajha as code owners November 14, 2026 01:44
@patrickdoc
patrickdoc merged commit 288a63f into modular:main Nov 14, 2026
22 checks passed

@Ahajha Ahajha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, for future reference it might be good to have the exact amd-smi output for this case.

@KenJones-Modular
KenJones-Modular deleted the amd-gpu-detection-na branch November 17, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants