Skip to content

fix: refuse to start with more GPUs than MAX_GPU_COUNT - #2

Merged
richardkiene merged 1 commit into
mainfrom
fix/reject-unsupported-gpu-count
Sep 1, 2026
Merged

fix: refuse to start with more GPUs than MAX_GPU_COUNT#2
richardkiene merged 1 commit into
mainfrom
fix/reject-unsupported-gpu-count

Conversation

@richardkiene

@richardkiene richardkiene commented Sep 1, 2026

Copy link
Copy Markdown

daemon_loop (src/main.c prev_managed[MAX_GPU_COUNT], indexed by i < device_count) and the dashboard (src/dashboard.c gpus[MAX_GPU_COUNT], init_mode[MAX_GPU_COUNT][16], init_speed[MAX_GPU_COUNT], indexed by i < st->gpu_count where st->gpu_count = device_count) keep per-GPU state in arrays sized by MAX_GPU_COUNT (8), so a host with nine or more GPUs overran them.

gpu_init now fails with a message naming the limit and the constant to raise. nvmlShutdown() before return -1 mirrors the existing nvmlDeviceGetCount failure path; the sole caller (main.c) returns 1 without a second shutdown.

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
richardkiene force-pushed the fix/reject-unsupported-gpu-count branch from c8a799e to ff58213 Compare September 1, 2026 16:30
@richardkiene
richardkiene merged commit 1b5af7d into main Sep 1, 2026
2 checks passed
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