Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ int gpu_init(void) {
return -1;
}

/* Per-GPU state lives in fixed-size arrays sized by MAX_GPU_COUNT. */
if (device_count > MAX_GPU_COUNT) {
fprintf(stderr, "Found %u GPUs but NVFD supports at most %d "
"(MAX_GPU_COUNT in include/nvfd.h)\n",
device_count, MAX_GPU_COUNT);
nvmlShutdown();
return -1;
}

return 0;
}

Expand Down
Loading