mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #105] [CLOSED] The Monitor's GPU readings on ROCm: an amdgpu sysfs backend, and the disk rate without psutil #2458
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2458
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/105
Author: @xyzzing
Created: 9/29/2026
Status: ❌ Closed
Base:
main← Head:feature/amd-telemetry📝 Commits (1)
25e518dThe Monitor's GPU readings on ROCm, and the disk rate without psutil📊 Changes
2 files changed (+260 additions, -5 deletions)
View changed files
📝
serve/telemetry.py(+180 -5)➕
serve/test_telemetry.py(+80 -0)📄 Description
What
The Monitor's hardware half is NVML-only, so it is empty on a ROCm box. Measured on this machine (Fedora 44, ROCm 7.1.1, Radeon RX 7900 XTX / gfx1100) with
libnvidia-ml.so.1absent:GET /metrics → hardwarecarried nogpu_*key at all — GPU load, VRAM, GPU temp, power and PCIe all showed–hardware_static.gpu_namewasnull, so About → GPU printed "not readable (NVML)"psutilnot installed (the venv this port runs in), the disk card showed "needs psutil (setup installs it)" and the physical-core count was missing ("psutil": false)What changed
_AmdSysfs— the same fields from amdgpu's sysfs, used only when_Nvmlfails to load:/sys/class/drm/card*/deviceforDRIVER=amdgpu(the index is not fixed: this box has the AMD card atcard1, notcard0)gpu_busy_percent→ util;mem_info_vram_used/mem_info_vram_total→ VRAMedge→ temperature (what NVML calls the GPU temperature; junction and memory sensors are 55 °C and 52 °C at the same moment on this card)power1_average/power1_cap(µW) → power and its limitcurrent_link_speed/max_link_speed("16.0 GT/s PCIe"→ Gen4) andcurrent_link_width→ the linkEvery reading is a small file read, so a sample cannot block the server, and anything the kernel does not expose stays
Nonerather than being invented. amdgpu has no PCIe throughput counter (rocm-smi --showbw --jsonanswers "No JSON data to report" here), so the link is reported and the MB/s series stays empty —serve/webalready renders "Gen4 x16" from those fields, so no client change was needed.Without psutil (Linux):
/proc/diskstatsfor the read/write rate — the source psutil itself reads — counting whole disks only (never partitions, and neverloop/zram/dm-*, which would count a device-mapper layer twice), and/proc/cpuinfo's(physical id, core id)pairs for the physical-core count.Measured after the change
With
psutilforced absent, every GPU series, the disk rate and the 12 cores still come through.Compatibility
NVML still wins whenever it loads and the
psutilpath is untouched, so an NVIDIA install behaves exactly as before; the sysfs and/procpaths are only ever reached when the previous backend is unavailable (the/procreads returnNoneoff Linux, which is what the existing Windows fallbacks already expect).Tests
New
serve/test_telemetry.py— no GPU, no pack, no driver:GT/s→ generation mapping, and the whole-disk filter (sdayes,sda1/dm-0/zram0/loop0no)ok()false,read() == {},name() == "AMD GPU"(rather than a traceback)mem_used <= mem_total,0 <= util <= 100, temperature in range when the sensor exists)Telemetry.sample()still merges the server's ownextra()and still carries every series the Monitor plotsIndependent of #104 — no shared file. Found while porting this engine to HIP/gfx1100, where the Monitor was the last thing still speaking NVIDIA.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.