feat: Add NVIDIA GPU process utilization and memory#1552
Open
KinanLak wants to merge 12 commits intoaristocratos:mainfrom
Open
feat: Add NVIDIA GPU process utilization and memory#1552KinanLak wants to merge 12 commits intoaristocratos:mainfrom
KinanLak wants to merge 12 commits intoaristocratos:mainfrom
Conversation
KinanLak
commented
Feb 25, 2026
Author
|
Ready to review / merge |
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive per-process GPU monitoring to btop, implementing the feature requested in issue #968. The implementation provides GPU utilization and memory usage metrics for individual processes, supporting both NVIDIA GPUs (via NVML) and other GPU vendors (via /proc/[pid]/fdinfo parsing).
Changes:
- Adds per-process GPU metrics (utilization % and memory) with dual-source collection: NVML for NVIDIA GPUs and fdinfo parsing as fallback
- Introduces new sorting options ("gpu" and "gpu memory") and a GPU-only filter toggle (key 'g') to display only processes with active GPU usage
- Implements optional per-process GPU graphs alongside existing CPU graphs with responsive column layouts
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/linux/intel_gpu_top/CMakeLists.txt | Adds _GNU_SOURCE definition to fix implicit declaration of asprintf |
| src/linux/btop_collect.cpp | Core implementation: adds helper functions, NVML process stats collection, fdinfo parsing for non-NVIDIA GPUs, and GPU-only filtering logic |
| src/btop_shared.hpp | Extends proc_info struct with gpu_p, gpu_m, and gpu_t fields; adds "gpu" and "gpu memory" to sort_vector |
| src/btop_shared.cpp | Updates sorting logic to handle new GPU metrics (indices 6-7) and shifts CPU metrics to indices 8-9; adds GPU filter check in matches_filter |
| src/btop_menu.cpp | Adds help text for new config options (proc_gpu_graphs, proc_gpu_only) and updates proc_sorting description |
| src/btop_input.cpp | Adds 'g' key binding to toggle GPU-only filter |
| src/btop_draw.cpp | Implements GPU column rendering with width-responsive layouts, GPU graphs, and gpu-only toggle indicator |
| src/btop_config.cpp | Adds configuration options for proc_gpu_graphs and proc_gpu_only |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds NVIDIA GPU support to the process list view :
Also fix : #968