This repository was archived by the owner on Apr 27, 2026. It is now read-only.
feat: use amdgpu_top to get usage#1141
Merged
Merged
Conversation
Jas-SinghFSU
suggested changes
Jan 3, 2026
Owner
|
Thanks for the PR! |
lika85456
added a commit
to lika85456/HyprPanel
that referenced
this pull request
Feb 3, 2026
91172c6 to
ca6771e
Compare
Contributor
Author
|
Any news ? |
Jas-SinghFSU
approved these changes
Mar 23, 2026
Owner
|
Something weird is going on, could you push another empty commit to get this unstuck? |
refactor detect function to be extendable (for intel gpu's)
ca6771e to
55438b2
Compare
Contributor
Author
I'll rebase the branch |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
As an AMD user, the default implementation isn’t working with my GPU
This PR adds AMD GPU usage support using amdgpu_top with automatic vendor detection, keeping NVIDIA (gpustat) behavior unchanged
Features Added
1. AMD GPU Usage
Added AMD backend using amdgpu_top JSON dump (--json --dump)
- Reads per-device gpu_activity.GFX.value as utilization
- Averages across multiple AMD GPUs when present
- Reports usage as a 0–1 decimal, consistent with NVIDIA path
- Requires amdgpu_top available in PATH
2. Automatic Vendor Detection
Detects available GPU monitoring tool at runtime
- NVIDIA: uses gpustat --json (existing behavior preserved)
- AMD: uses amdgpu_top --json --dump
- Falls back to unknown vendor if neither tool is available
- Gracefully returns 0 and logs a warning instead of crashing
=> very easily extendable to add other vendors