Skip to content

Fix incorrect minNumCU for RDNA2 (gfx103x) in AmdArchDb #2303

@bogdan-petkovic

Description

@bogdan-petkovic

Description

The rdnaInfo preset in AmdArchDb.cpp has minNumCU=30, but RDNA2 GPUs operate in WGP mode where HIP reports half the physical CU count. This causes the NativeArchInfoMatchesPresetInfo unit test to fail on GPUs with fewer than 30 WGPs.

Root Cause

RDNA2 GPUs (gfx103x) run in WGP mode. HIP's multiProcessorCount reports WGPs, not physical CUs. For example:

  • RX 6700 XT (gfx1031): 40 physical CUs → HIP reports 20
  • RX 6500 XT (gfx1032): 16 physical CUs → HIP reports 8

The preset minNumCU=30 is too high and fails for any RDNA2 GPU with fewer than 30 WGPs.

Failing Test

RocMLIR--Unit :: Dialect/Rock/MLIRRockUnitTests/NativeArchTests/
NativeArchTest/NativeArchInfoMatchesPresetInfo/2

Expected: (presetInfo.minNumCU) <= (nativeInfo.minNumCU)
actual: 30 vs 20

Fix

Lower minNumCU for rdnaInfo from 30 to 2, consistent with how rdna3Info handles this. This covers all supported RDNA2 chips including the smallest (gfx1032, RX 6500 XT, 8 WGPs).

Related

Similar fix was applied for cdna3Info in commit f4b8f2aee865.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions