Skip to content

Add GFX IP version fallback for GPU family detection#178

Open
mgajda wants to merge 3 commits into
clbr:masterfrom
mgajda:gfx-fallback-detection
Open

Add GFX IP version fallback for GPU family detection#178
mgajda wants to merge 3 commits into
clbr:masterfrom
mgajda:gfx-fallback-detection

Conversation

@mgajda

@mgajda mgajda commented Apr 14, 2026

Copy link
Copy Markdown

Summary

  • Query GFX IP version via amdgpu_query_hw_ip_info during init
  • When PCI device ID is not in r600_pci_ids.h, fall back to GFX version to identify the GPU family
  • Add 15 new families: MENDOCINO (gfx1036), GFX1033 (Steam Deck), GFX1034 (Navi 24), NAVI31-33 (RDNA 3), GFX1103 (780M iGPU), GFX1150-1151 (RDNA 3.5 Strix), GFX1170-1172 (RDNA 4m), GFX1200-1201 (RDNA 4), GFX1300/GFX1310 (RDNA 5)
  • Unknown GFX codes fall back to the base family for their major.minor version (e.g. any GFX11.0.x → NAVI31)
  • Handles kernel encoding change for hw_ip_version_minor on GFX11+ kernels

Notes

  • Does not touch r600_pci_ids.h — PCI ID table updates are a separate MR
  • Does not change initbits() — RDNA+ bit layout corrections are a separate MR
  • GRBM_STATUS offset (0x8010) and amdgpu_read_mm_registers access are confirmed correct across GFX10–GFX12 via kernel headers

Test plan

  • Build with ENABLE_AMDGPU=1 (requires libdrm_amdgpu)
  • Build without amdgpu (amdgpu=0) — gfx_version defined in detect.c, stays 0
  • Test on RDNA 3 card (RX 7000 series) — should identify as NAVI31/32/33
  • Test on older card with known PCI ID — PCI lookup still takes priority

When a GPU's PCI device ID is not in the r600_pci_ids.h table,
fall back to querying the GFX IP version from amdgpu and mapping
it to a family. This allows radeontop to recognize newer GPUs
(RDNA 3, 3.5, 4, 4m, 5) without needing a PCI ID table update
for every new SKU.

New families: MENDOCINO, GFX1033, GFX1034, NAVI31, NAVI32,
NAVI33, GFX1103, GFX1150, GFX1151, GFX1170-1172, GFX1200-1201,
GFX1300, GFX1310.

Unknown GFX codes fall back to the base family for their
major.minor version (e.g. any GFX11.0.x maps to NAVI31).
mgajda added 2 commits May 12, 2026 18:21
The GC (Graphics & Compute) block number queried via
amdgpu_query_hw_ip_info() comes straight from the chip and is
unambiguous, while PCI device IDs are reused by AMD across APU
SKUs (e.g. 0x150E is shared by Strix Point gfx1150 and Krackan
Point gfx1152 - only the GC number distinguishes them).

When both are available, the GC number wins. Legacy cards
(radeon driver, or amdgpu without IP query support) report
gfx_version == 0 and fall through to the PCI lookup, so this
is backwards-compatible.
When the GC (Graphics & Compute) block number is reported by
amdgpu but doesn't map to a known family, print both:

    gfx1152? (GC 11.5.2 unknown)

The GC number is what we know for certain (queried straight from
the chip); the GFX shader target is a putative guess because for
GC 11.0.x the GC rev and GFX number diverge (GC 11.0.1 = Phoenix
gfx1103, not gfx1101). The '?' suffix marks the GFX side as
uncertain so the user can search for either string when looking
up the chip.
mgajda added a commit to mgajda/radeontop that referenced this pull request May 13, 2026
When the GC (Graphics & Compute) block number is reported by
amdgpu but doesn't map to a known family, print both:

    gfx1152? (GC 11.5.2 unknown)

The GC number is what we know for certain (queried straight from
the chip); the GFX shader target is a putative guess because for
GC 11.0.x the GC rev and GFX number diverge (GC 11.0.1 = Phoenix
gfx1103, not gfx1101). The '?' suffix marks the GFX side as
uncertain so the user can search for either string when looking
up the chip.

Same fix is on the gfx-fallback-detection branch (PR clbr#178); the
two PRs will absorb the duplicate via squash-on-merge.
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.

1 participant