Skip to content
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
Jas-SinghFSU merged 3 commits into
Jas-SinghFSU:masterfrom
Times-Z:feat/amd-gpu-stats
Mar 23, 2026
Merged

feat: use amdgpu_top to get usage#1141
Jas-SinghFSU merged 3 commits into
Jas-SinghFSU:masterfrom
Times-Z:feat/amd-gpu-stats

Conversation

@Times-Z

@Times-Z Times-Z commented Nov 28, 2025

Copy link
Copy Markdown
Contributor

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

image

Comment thread src/services/system/gpuUsage/index.ts Outdated
@Jas-SinghFSU

Copy link
Copy Markdown
Owner

Thanks for the PR!
A few linter errors as well.

lika85456 added a commit to lika85456/HyprPanel that referenced this pull request Feb 3, 2026
@Times-Z Times-Z force-pushed the feat/amd-gpu-stats branch from 91172c6 to ca6771e Compare February 7, 2026 16:41
@Times-Z

Times-Z commented Feb 13, 2026

Copy link
Copy Markdown
Contributor Author

Any news ?

@Times-Z Times-Z requested a review from Jas-SinghFSU March 19, 2026 17:45
@Jas-SinghFSU

Copy link
Copy Markdown
Owner

Something weird is going on, could you push another empty commit to get this unstuck?

git commit --allow-empty -m 'unstuck'

Times-Z added 2 commits March 23, 2026 09:54
refactor detect function to be extendable (for intel gpu's)
@Times-Z Times-Z force-pushed the feat/amd-gpu-stats branch from ca6771e to 55438b2 Compare March 23, 2026 08:54
@Times-Z

Times-Z commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

Something weird is going on, could you push another empty commit to get this unstuck?

git commit --allow-empty -m 'unstuck'

I'll rebase the branch
Is this better ?

@Jas-SinghFSU Jas-SinghFSU merged commit e919b4a into Jas-SinghFSU:master Mar 23, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants