Skip to content

interface: add TOTAL row as the last entry in the process table - #549

Open
zarbis wants to merge 6 commits into
Syllo:masterfrom
zarbis:feat/total-row
Open

zarbis wants to merge 6 commits into
Syllo:masterfrom
zarbis:feat/total-row

Conversation

@zarbis

@zarbis zarbis commented Nov 9, 2026 •

Copy link
Copy Markdown

What

image

Append a TOTAL row as the last entry in the scrollable process list that sums the per-process GPU, encoder, decoder, memory, CPU, and CPU memory values across all processes.

Notes

  • Disabled by default to retain current behavior.
  • The row uses the same column layout as the process rows so it aligns with the header and scrolls together with the rest of the list.
  • Only shown when there are processes.

Testing

Tested on Linux 7.3.1-1-cachyos Nvidia 615.78.08 RTX 5080:

  • total sum math is correct
  • column alignment is solid on different terminal width
  • addition and removal of processes is handled well

AI Usage

I used agent to write the code. Grilled it to explain it to me to the point I can write this description by hand.

print_processes_on_screen built every column of a process row inline.
Extract the GPU, encoder, decoder, memory, CPU and CPU memory columns
into format_process_numeric_fields and move the all_processes and
gpuid_and_process types into interface_common.h so they can be shared.

No behavior change.
Append a TOTAL row as the last entry in the scrollable process list that sums
the per-process GPU, encoder, decoder, memory, CPU and CPU memory values. The
row reuses the process column formatting so it aligns with the header and
scrolls together with the rest of the list. It is only shown when there are
processes.

Scrolling counts the TOTAL row as a real entry and shifts the window up by one
line when the last process is visible, so the row stays on screen.

sum_processes and the scroll helpers live in interface_layout_selection.c
where they can be unit tested. Each process reports gpu_memory_percentage of
its own device, so the summed value can exceed 100% on a multi-GPU system.
The row is off by default so the process list keeps looking exactly like
it did before, and can be turned on from the command line with --total-row
(long-only, no short option taken), from the config file with the ShowTotalRow
key, and from the Processes section of the setup window.
Describes --total-row, the setup-window entry, the fact that the summed
percentages are per device and can exceed 100, and that the row needs room
of its own.
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.

1 participant