fix: refuse to start with more GPUs than MAX_GPU_COUNT - #2
Merged
Conversation
richardkiene
force-pushed
the
fix/reject-unsupported-gpu-count
branch
from
September 1, 2026 15:47
b65f098 to
c8a799e
Compare
daemon_loop (src/main.c prev_managed[MAX_GPU_COUNT]) and the dashboard (src/dashboard.c gpus[MAX_GPU_COUNT], init_mode[MAX_GPU_COUNT][16], init_speed[MAX_GPU_COUNT]) keep per-GPU state in arrays sized by MAX_GPU_COUNT (8) but indexed by device_count, so a host with nine or more GPUs overran them. Fail at gpu_init with a message naming the limit and the constant to raise instead.
richardkiene
force-pushed
the
fix/reject-unsupported-gpu-count
branch
from
September 1, 2026 16:30
c8a799e to
ff58213
Compare
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.
daemon_loop(src/main.cprev_managed[MAX_GPU_COUNT], indexed byi < device_count) and the dashboard (src/dashboard.cgpus[MAX_GPU_COUNT],init_mode[MAX_GPU_COUNT][16],init_speed[MAX_GPU_COUNT], indexed byi < st->gpu_countwherest->gpu_count = device_count) keep per-GPU state in arrays sized byMAX_GPU_COUNT(8), so a host with nine or more GPUs overran them.gpu_initnow fails with a message naming the limit and the constant to raise.nvmlShutdown()beforereturn -1mirrors the existingnvmlDeviceGetCountfailure path; the sole caller (main.c) returns 1 without a second shutdown.