Skip to content

feat: add GPU monitoring - #202

Open
nezmaka wants to merge 1 commit into
Abdenasser:mainfrom
nezmaka:gpu_monitoring
Open

nezmaka wants to merge 1 commit into
Abdenasser:mainfrom
nezmaka:gpu_monitoring

Conversation

@nezmaka

@nezmaka nezmaka commented Aug 30, 2026

Copy link
Copy Markdown

Description

GPU monitoring has been added: if a graphics card is detected, a panel is created between 'CPU usage' and 'Memory' to display available GPU stats. A column and filtering for the GPU were added as well.
I tested it on AMD cards. I believe it should work with NVIDIA as well.

Fixes #169

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Test configuration
OS Tuxedo OS (Ubuntu 24.04 based), X11, KDE.

No new dependencies were added, in either Cargo.toml or package.json.

  • Unit tests. cd src-tauri && cargo test → 12 passed, 0 failed. Eight are new: three in gpu_monitor (discovery succeeds with or without a GPU; readings stay within documented ranges; pci.ids model-name shortening), five in gpu_process_monitor (fdinfo parsing, drm-engine-capacity-* exclusion, non-DRM descriptor rejection, first-sample-has-no-baseline, percentages finite and non-negative). The GPU tests are written to pass on a machine with no GPU, so they are safe for CI.

  • System panel matches the kernel. Compared each rendered value against its source while the app ran: gpu_busy_percent, mem_info_vram_total/_used, and the hwmon temp*_input / power1_average / freq1_input files under /sys/class/drm/card1/device/. Reproduce with:

    watch -n1 'cd /sys/class/drm/card*/device; \
      cat gpu_busy_percent mem_info_vram_used; cat hwmon/hwmon*/{temp1_input,power1_average,freq1_input}'
    
  • Under load. glxgears running: the GPU panel moved from 0% to 65–73% core utilisation, with power and clock rising in step and returning to idle afterwards.

  • DPer-process GPU % column. With glxgears running, the column reported glxgears at 29.8–31.4% and Xorg at 44–50%.

  • GPU % filter. Set to > 1, the table narrowed from thousands of rows to exactly 3 — glxgears 30.2%, Xorg 49.0%, kwin_x11 1.4%. Clear All restores the full list and the active-filter count behaves like the existing CPU/RAM/Runtime filters.

  • Formatting and types. npm run format:check passes (Prettier and cargo fmt). svelte-check reports only the 4 Cannot find namespace 'NodeJS' errors already present on main.

    (Didn't test on macOS, Windows, NVIDIA or multi-GPU)

    Checklist:

  • My code follows the style guidelines of this project

  • I have performed a self-review of my code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation

  • My changes generate no new warnings

  • I have added tests that prove my fix is effective or that my feature works

  • New and existing unit tests pass locally with my changes

  • Any dependent changes have been merged and published in downstream modules — n/a, this PR is self-contained

- if GPU is detected, creates a panel between CPU usage and Memory to
display available GPU stats.
- Added GPU% column
- Filter by GPU usage
@nezmaka
nezmaka requested a review from Abdenasser as a code owner August 30, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] - GPU Stats

1 participant