Skip to content

test(server): add test coverage for is_strix_apu() sysfs scanning + rename to is_apu() #3

Description

@jane-alesi

Problem

The new SystemInfo::is_strix_apu() function scans /sys/class/kfd/kfd/topology/nodes/*/properties for gfx_target_version, then calls has_unified_memory() on each node. Currently this has no test coverage in test/cpp/test_amd_vram.cpp.

Additionally, the method is hardcoded to "Strix" APUs only. We have an old AMD 2400G APU (Stoney Ridge, gfx v8) that we want to validate detection against -- which means the function name and scope need broadening.

Proposed Solution

  1. Rename SystemInfo::is_strix_apu() --> SystemInfo::is_apu() -- broader name reflecting that it detects any AMD APU with unified memory, not just Strix-generation parts.
  2. Add sysfs scanning test -- mock or parameterize the KFD path so the test can verify:
    • Correct parsing of gfx_target_version from properties file
    • Multiple node iteration (at least one matching --> return true)
    • Missing/empty nodes gracefully handled
  3. Validate on 2400G hardware -- once detection logic covers Stoney Ridge, test against the actual APU.

Related

Depends on future-proof detection logic issue for the detection predicate itself. This issue focuses on renaming + test coverage.

Files to update

  • src/cpp/include/lemon/system_info.h -- rename declaration
  • src/cpp/server/system_info.cpp -- rename implementation, any callers
  • test/cpp/test_amd_vram.cpp -- add test cases
  • CMakeLists.txt -- if test dependencies change

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions