Skip to content

Commit 64cc19b

Browse files
authored
Fix the validation of main device (#1872)
1 parent 4bfcc85 commit 64cc19b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml-cuda.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2366,7 +2366,7 @@ void ggml_cuda_assign_buffers_no_scratch(struct ggml_tensor * tensor) {
23662366
}
23672367

23682368
void ggml_cuda_set_main_device(int main_device) {
2369-
if (main_device > g_device_count) {
2369+
if (main_device >= g_device_count) {
23702370
fprintf(stderr, "warning: cannot set main_device=%d because there are only %d devices. Using device %d instead.\n",
23712371
main_device, g_device_count, g_main_device);
23722372
return;

0 commit comments

Comments
 (0)