Fix CPU panel GPU sub-graph widths (crash / dropped sub-graphs)#1614
Open
stepelu wants to merge 1 commit intoaristocratos:mainfrom
Open
Fix CPU panel GPU sub-graph widths (crash / dropped sub-graphs)#1614stepelu wants to merge 1 commit intoaristocratos:mainfrom
stepelu wants to merge 1 commit intoaristocratos:mainfrom
Conversation
init_graphs() for the `gpu-totals` field used an arithmetically
incorrect per-sub-graph width formula. For gpu_draw_count >= 4 the
computed width was too small; for the final graph at
gpu_draw_count == 8 on a narrow panel it went negative, causing
Graph::Graph() to pass a bogus data_offset into Graph::_create()
whose `data.size() - data_offset > 1` check wraps under unsigned
arithmetic and triggers
deque::_M_range_check: __n (which is 13) >= this->size() (which is 2)
(or `basic_string::at: ...` on older stdlib).
Replace the formula with a uniform split that gives every sub-graph
`(graph_default_width - (gpu_draw_count - 1)) / gpu_draw_count` cells.
At most `gpu_draw_count - 1` cells remain as an unused strip at the
right edge; sub-graph widths and label positioning are then uniform.
Also guard Graph::Graph() and Graph::operator()() against non-positive
widths as a backstop for any other caller with a bad width.
Addresses: aristocratos#874, aristocratos#1017, aristocratos#1118, aristocratos#742, aristocratos#949
Author
|
The failing checks don’t look related to this PR’s changes (only touches src/btop_draw.cpp). CI is blocked by the snap build environment / snap/snapcraft.yaml dependency list (likely the gcc-14 / g++-14 pin). |
|
I am hyped by this PR, I have been upset that btop does not work well on H100 nodes with tons of cpu cores. |
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.
Corrects the arithmetic in
init_graphs()that sized per-GPUgpu-totalssub-graphs in the CPU panel, and adds aDraw::Graphbackstop for non-positive widths.Addresses: #874, #1017, #1118, #742, #949