Skip to content

feat(node-info): report Linux AMD GPU utilization - #43

Open
dbourdea wants to merge 2 commits into
NVIDIA:developfrom
dbourdea:amd-strix-halo-poc
Open

dbourdea wants to merge 2 commits into
NVIDIA:developfrom
dbourdea:amd-strix-halo-poc

Conversation

@dbourdea

@dbourdea dbourdea commented Sep 7, 2026

Copy link
Copy Markdown

Description

Linux AMD adapters can already execute GPU-backed inference through PAIR's existing Ollama integration, but node-info does not provide their live GPU utilization. This change reads the amdgpu gpu_busy_percent sysfs counter and matches it to detected AMD adapters by PCI address, so utilization is available to PAIR's existing telemetry and scheduling path.

An isolated two-node experiment on Ryzen AI Max+ 395 / Radeon 8060S systems verified Ollama 0.33.3 native ROCm gfx1151 execution, all 29 layers of Qwen3 0.6B offloaded, discovery, PIN pairing, model inventory and concurrent independent requests on distinct nodes. Inference worked with configuration only; this patch adds utilization reporting, not a new engine adapter.

Detailed findings, six reproducible figures, sanitized measurements, failure cases and setup notes: public experiment repository and white paper DOI.

Scope

  • Recognize AMD PCI vendor 0x1002 and normalize PCI addresses independently of DRM card numbering.
  • Accept genuine idle zero and valid utilization through 100%; leave missing or malformed counters unavailable.
  • Preserve existing NVIDIA samples and append ghw AMD adapters when the NVIDIA detection path succeeds.
  • Keep AMD memory fields absent because reserved VRAM, GTT, HSA-visible capacity and host MemAvailable have different, overlapping meanings.
  • Add focused sysfs fixture tests and documentation; bump node-info from 0.13.3 to 0.14.0.
  • No RPC contract, desktop, engine adapter, driver, process ownership or network security changes.

Validation

On Ubuntu 26.04.1, Go 1.26.0, AMD gfx1151:

cd services
./build.sh
cd nvpair-node-info
GOMAXPROCS=4 go test -race ./...

All 13 service executables built. Ordinary go test ./... passed in shared, engine-manager, ui-broker (including relay/workloadstore), ollama-proxy, lmstudio-proxy, scheduler, scanner and cluster-manager components. Saved logs are in the linked evidence repository. Windows amd64 and macOS arm64 node-info cross-compilation with CGO disabled passed; these are build checks only.

Manual two-host coverage included streaming and non-streaming Ollama/OpenAI APIs, inventories, adoption and managed start, cancellation, real discovery/pairing, distinct concurrent destinations, new-request routing after engine loss, seven successful requests during whole-peer loss, and recovery without re-pairing. Final rebuilt node-info returned live AMD utilization with memory omitted and exited cleanly.

Repository checks: node scripts/spdx-headers.mjs passed (873 checked, zero missing/review/unclassified), git diff --check passed, and the exported patch applies to upstream commit 13b68115fa2c9c1d94f1ead1358f8d5a527cfecf.

The complete cross-process services/tests suite and Electron checks were not run. No runtime validation on real NVIDIA, Windows AMD, Apple or mixed-GPU hardware is claimed.

Risk

The patch follows the existing global GPU freshness and omitted-zero conventions; per-adapter freshness and UMA-aware memory reporting remain future schema work. Mixed-vendor behavior is covered by preserving existing map entries in fixture tests, not real mixed hardware.

Separately, the experiment observed that abruptly killing an upstream engine after first content ended the stream without a completion marker while its workload remained running in a later snapshot. Normal client cancellation correctly became failed. This pre-existing proxy terminal-reporting path is documented in the paper and is outside this focused telemetry change; new requests still routed to a surviving peer. PAIR did not replay or migrate a partial answer.

Timing is deliberately bounded: five warmed calls per route, same local engine, 128 generated tokens each. The difference between median wall time outside the engine was about 0.53 ms. This is not a large-model performance or production reliability claim.

Checklist

  • I have read the Contributing Guidelines.
  • Every commit is signed off, certifying the Developer Certificate of Origin.
  • New tests cover the change.
  • Relevant documentation is updated.
  • I checked the diff, filenames, commit message and public evidence for credentials, private identifiers and internal URLs.
  • Validation commands, results and untested areas are recorded above.
  • The affected component version is bumped and the user-visible change is described.

Codex assisted with source inspection, implementation, test execution and documentation. The accompanying report preserves evidence and explicitly limits conclusions to the measured configuration.

Signed-off-by: David Bourdeau <42303109+dbourdea@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 7, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The change is scoped, test-covered, and integrates cleanly with the existing GPU telemetry freshness contract, with only a minor doc-comment mismatch noted in review comments.

Pull request overview

Adds Linux AMD GPU utilization telemetry to the nvpair-node-info service by reading the amdgpu gpu_busy_percent sysfs counter and joining samples to detected adapters via PCI address, so existing PAIR telemetry/scheduling can consume utilization on AMD hosts without adding a new engine adapter.

Changes:

  • Add AMD PCI-based statsKey generation and sysfs-based utilization sampling (gpu_busy_percent) on Linux.
  • Combine AMD utilization sampling with existing NVIDIA nvidia-smi sampling and include AMD adapters on mixed-vendor hosts.
  • Add Linux sysfs-fixture unit tests, update nvpair-node-info documentation, and bump nvpair-node-info version to 0.14.0.
File summaries
File Description
services/versions.json Bumps nvpair-node-info component version to 0.14.0.
services/nvpair-node-info/stats_linux.go Extends Linux sampling pass to include AMD utilization and adjusts NVIDIA “unavailable” log behavior.
services/nvpair-node-info/README.md Documents AMD sysfs utilization behavior and freshness/zero-omission implications.
services/nvpair-node-info/gpu_linux.go Adds AMD PCI-based join key generation and includes AMD adapters on mixed-vendor hosts.
services/nvpair-node-info/amd_linux.go Implements PCI normalization/vendor check and reads gpu_busy_percent for utilization.
services/nvpair-node-info/amd_linux_test.go Adds fixture-based tests for AMD keying and utilization parsing/availability behavior.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

name = card.DeviceInfo.Product.Name
}
gpus = append(gpus, GPUInfo{Name: name})
gpus = append(gpus, GPUInfo{Name: name, statsKey: amdStatsKey(amdPCIRoot, card.Address)})
@sherief-nv

Copy link
Copy Markdown
Collaborator

Thanks for the PR - can we merge the AMD GPU code into gpu_linux.go to be consistent with out <device>_<os>.go breakdown? I would like to merge that in for the next release.

@sherief-nv
sherief-nv changed the base branch from main to develop September 9, 2026 01:07
@sherief-nv
sherief-nv self-requested a review September 9, 2026 01:07
Signed-off-by: David Bourdeau <42303109+dbourdea@users.noreply.github.com>
@dbourdea

dbourdea commented Sep 9, 2026

Copy link
Copy Markdown
Author

Implemented the requested source layout update in 5279297.

  • Moved amdStatsKey and decodeAMDUtilization into gpu_linux.go.
  • Renamed the focused fixture test to gpu_linux_test.go.
  • Corrected the detectGPUsGHW comment so it describes AMD PCI-derived telemetry keys accurately.
  • Preserved the utilization behavior, NVIDIA map preservation, and intentional omission of AMD memory fields.

Validation on an isolated Ubuntu Linux checkout with Go 1.26.0:

cd services/nvpair-node-info
GOMAXPROCS=4 go test -race ./...

Passed. node scripts/spdx-headers.mjs also passed with 872 files checked and no missing or unclassified headers. git diff --check passed.

Thank you. This should now match the repository's Linux GPU source layout for the next release.

@sherief-nv sherief-nv self-assigned this Sep 9, 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.

3 participants