Support AMD GPU metrics via sysfs
Describe the new feature you'd like It would be useful if the extension displayed GPU load and memory usage for AMD GPUs.
Additional context
I know this gets requested a lot, but in the case of new-ish AMD GPUs (i.e. ones supported by the amdgpu open source driver), it is much easier to support.
The driver exposes at least the following values via sysfs:
/sys/class/drm/cardN/device/gpu_busy_percent: current GPU load in %/sys/class/drm/cardN/device/pp_dpm_sclk: GPU clock rates available (current clock rate on the line with a "*")/sys/class/drm/cardN/device/mem_info_vram_used: VRAM usage in bytes/sys/class/drm/cardN/device/mem_info_vram_total: total VRAM in bytes
I think this falls in line with what Vitals is, and as mentioned, that is a non io blocking extension. I think it makes sense to put these in into their own section called Graphics. Assuming cardN is a number, you could iterate from 0 to say 5, and use that number in the human readable text.
Unfortunately, not having this graphics card makes it very hard for me to see if what I coded is working. If you can make the changes and create a PR, I'd be glad to merge it in!
@corecoding I have an AMD card and could look into it. I know JS/TS like Neo knows kung fu, but I know nothing about gnome extensions.
Can you give me some pointers on where in this code base I should start looking when implementing this feature?