Skip to content

install: detect AMD GPUs (amdgpu, ROCm, GTT) with regression fixtures - #153

Merged
jayleaton merged 2 commits into
jayleaton:mainfrom
smfworks:amd-split/1-detection-doctor
Nov 17, 2026
Merged

jayleaton merged 2 commits into
jayleaton:mainfrom
smfworks:amd-split/1-detection-doctor

Conversation

@smfworks

@smfworks smfworks commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Part 1 of 5 (split from #152).

Split from #152 as suggested. The installer and doctor detect AMD GPUs (amdgpu sysfs, ROCm version, GTT pool) next to the existing NVIDIA path; hosts without an AMD GPU take the same path as before.

  • tools/install/test_amd.sh: 27 checks against recorded hosts in tests/fixtures/amd/{strix-halo,discrete,nvidia,none} (sysfs trees, rocminfo, nvidia-smi and nvcc output; LR_SYSFS points lib.sh at a fixture). The NVIDIA checks also pass against main's lib.sh.
  • The fixtures found a bug, fixed here: amd_name returned the first rocminfo agent, which is the CPU on an APU. It now takes the first agent whose Device Type is GPU.
  • CI runs test_amd.sh.

Checks run locally: zig build test, zig build test-unit (26/26), test_amd 27/27, bash -n / jq empty / bootstrap --dry-run on every profile, git diff --check.

lib.sh: when nvidia-smi sees no GPU, hw_gpu/hw_driver/hw_vram/hw_summary read the
first amdgpu card (sysfs) and rocminfo (marketing name, gfx target), hw_rocm the ROCm
version, hw_gtt/hw_gtt_used the GTT pool an APU's GPU maps. hw_match gains optional
hardware.min_rocm, hardware.gfx and hardware.min_gtt_gib. The NVIDIA and macOS paths
are unchanged.

doctor.sh: the free-memory warning reads hardware.min_free_gib (default 88, as before)
and, on AMD, shows GTT in use and AMD-side hints; a deploy.service of
"systemd-transient" (systemd-run --user) is checked by is-active instead of a unit file.
…he CPU

tools/install/test_amd.sh runs lib.sh's detection against four recorded hosts in
tests/fixtures/amd (a sysfs tree, rocminfo output, ROCm's version file and
nvidia-smi answers; no GPU needed):
- strix-halo: Radeon 8060S (gfx1151) APU, 96 GiB GTT, a 4 GiB carve-out that is not
  VRAM, connector entries (card1-DP-1) beside the card
- discrete: an Intel CPU and iGPU beside a Radeon RX 7900 XTX with real VRAM
- nvidia: an NVIDIA GPU and an AMD card on one box; the NVIDIA path wins and says
  what it said before AMD detection existed (checked against main's lib.sh)
- none: no GPU

The fixtures caught one bug: amd_name took the first rocminfo Marketing Name that
was not an AMD CPU, so an Intel CPU agent named the GPU. It now takes the first
agent whose Device Type is GPU. LR_SYSFS (default /sys) points the sysfs reads at
a fixture. CI runs the script.

@jayleaton jayleaton left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed at 70101d7da. NVIDIA keeps precedence, no-GPU behaviour is unchanged, macOS skips the AMD path, and all 27 fixture checks pass. CI is green. Thanks @smfworks!

@jayleaton
jayleaton merged commit 0429122 into jayleaton:main Nov 17, 2026
4 checks passed
smfworks added a commit to smfworks/localrouter that referenced this pull request Nov 17, 2026
smfworks added a commit to smfworks/localrouter that referenced this pull request Nov 17, 2026
smfworks added a commit to smfworks/localrouter that referenced this pull request Nov 17, 2026
smfworks added a commit to smfworks/localrouter that referenced this pull request Nov 17, 2026
smfworks added a commit to smfworks/localrouter that referenced this pull request Nov 17, 2026
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.

2 participants