feat(gpu): live usage/VRAM/temperature for AMD on Linux via amdgpu sysfs - #2
Merged
Merged
Conversation
Mirror the NVML poller pattern for AMD cards: a 2 s background thread
reads /sys/class/drm/card*/device/ — gpu_busy_percent, mem_info_vram_*,
and hwmon/temp*_input (preferring the sensor labeled "edge" to match
NVIDIA's GpuTemp). No new dependency; gated on cfg(target_os = "linux").
To support vendor-specific dispatch beyond is_nvidia, GpuRow now carries
vendor_id + device_id (PCI 16-bit values from wgpu::AdapterInfo). AMD
samples match wgpu slots by device_id, which is unambiguous unlike the
substring name match used for NVML.
UI cleanup that came out of testing on RX 5x0 (8 GiB):
- shrink label column 14→6 ("temperature" → "temp") so the bar isn't
squeezed to nothing on narrow panels
- compact "used / total <unit>" formatter — both numbers share the unit
of total, so "1.6 / 8.0 GB" instead of "1.59 GB / 8.00 GB" (~10 chars
saved)
- recompute bar_w against the vram line's worst-case trailing width;
the old constant assumed every line ended in just "100.0%"
- per-vendor unsupported_reason text (NVIDIA / AMD / Intel / other)
README updated to reflect AMD-on-Linux now reports live stats.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirror the NVML poller pattern for AMD cards: a 2 s background thread reads /sys/class/drm/card*/device/ — gpu_busy_percent, mem_info_vram_, and hwmon/temp_input (preferring the sensor labeled "edge" to match NVIDIA's GpuTemp). No new dependency; gated on cfg(target_os = "linux").
To support vendor-specific dispatch beyond is_nvidia, GpuRow now carries vendor_id + device_id (PCI 16-bit values from wgpu::AdapterInfo). AMD samples match wgpu slots by device_id, which is unambiguous unlike the substring name match used for NVML.
UI cleanup that came out of testing on RX 5x0 (8 GiB):
README updated to reflect AMD-on-Linux now reports live stats.