Vitals icon indicating copy to clipboard operation
Vitals copied to clipboard

Add GTT memory monitoring for AMD GPUs

Open jibanez-staticduo opened this issue 9 months ago • 0 comments

Summary

  • Adds GTT (Graphics Translation Table) memory monitoring for AMD GPUs detected via DRM sysfs
  • Reads mem_info_gtt_used and mem_info_gtt_total from /sys/class/drm/cardN/device/ and exposes them as two new GPU sensor fields: GTT Used and GTT Total
  • Errors are silently caught so discrete AMD GPUs or older drivers that don't expose these files are unaffected

Motivation

GTT memory represents system RAM accessible by the GPU. On AMD APUs — such as Strix Halo (Ryzen AI MAX), Rembrandt, and Phoenix — the dedicated VRAM is typically very small (e.g. 512 MiB), while GTT can be tens to hundreds of GiBs of system memory allocated to the GPU.

For workloads like LLM inference (via ROCm/llama.cpp), the GPU primarily uses GTT memory rather than VRAM. Tools like amdgpu_top already report GTT usage, but Vitals currently only shows VRAM — which gives an incomplete picture on these APUs.

Example on an AMD Ryzen AI MAX+ 395 (Strix Halo):

Memory Type Total Typical Usage
VRAM (dedicated) 512 MiB ~455 MiB
GTT (system RAM) 124 GiB ~63 GiB (running LLMs)

Without GTT monitoring, Vitals only shows the 512 MiB VRAM, missing the 63 GiB actually being used by the GPU.

Changes

  • sensors.js: Added two new FileModule.File reads inside the existing AMD DRM block in _readGpuDrm(), reading mem_info_gtt_used and mem_info_gtt_total. Both are wrapped in .catch() blocks to gracefully handle systems where these files don't exist.

Testing

  • Tested on Fedora 43 with AMD Ryzen AI MAX+ 395 (Strix Halo) / Radeon 8060S
  • GTT values correctly displayed alongside existing VRAM values
  • Verified that the extension loads without errors on systems where GTT sysfs files are present
  • No regressions observed for existing GPU, temperature, or other sensor readings

Made with Cursor

jibanez-staticduo avatar Feb 06 '26 11:02 jibanez-staticduo