Skip to content

feat: Add NVIDIA GPU process utilization and memory#1552

Open
KinanLak wants to merge 12 commits intoaristocratos:mainfrom
KinanLak:main
Open

feat: Add NVIDIA GPU process utilization and memory#1552
KinanLak wants to merge 12 commits intoaristocratos:mainfrom
KinanLak:main

Conversation

@KinanLak
Copy link
Copy Markdown

@KinanLak KinanLak commented Feb 24, 2026

This PR adds NVIDIA GPU support to the process list view :

  • adds per-process GPU metrics (utilization + memory), using NVML when available, with /proc/[pid]/fdinfo fallback
  • adds new process sorting keys: gpu and gpu memory
  • adds a proc_gpu_only filter (toggle g) to show only GPU-active processes
  • adds a proc_gpu_graphs option to display per-process GPU graphs
  • wires the feature end-to-end across config, menu, input, collector, and rendering.

Also fix : #968

Comment thread src/linux/intel_gpu_top/CMakeLists.txt
@KinanLak KinanLak marked this pull request as ready for review February 25, 2026 16:07
Copilot AI review requested due to automatic review settings February 25, 2026 16:07
@KinanLak
Copy link
Copy Markdown
Author

Ready to review / merge

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/linux/btop_collect.cpp Outdated
Comment thread src/btop_draw.cpp Outdated
Comment thread src/linux/btop_collect.cpp
KinanLak and others added 2 commits February 25, 2026 17:16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@KinanLak KinanLak changed the title Add GPU process utilization and memory feat: Add NVIDIA GPU process utilization and memory Feb 25, 2026
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.

[REQUEST] Per process GPU usage

2 participants