]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix the validation of main device (#1872)
authorHoward Su <redacted>
Thu, 15 Jun 2023 17:29:59 +0000 (01:29 +0800)
committerGitHub <redacted>
Thu, 15 Jun 2023 17:29:59 +0000 (19:29 +0200)
ggml-cuda.cu

index 0565571f4df602b8b0d9c83aa8b232af9514495f..0873e3e515e1499fa9d44e815920519a62dc8867 100644 (file)
@@ -2366,7 +2366,7 @@ void ggml_cuda_assign_buffers_no_scratch(struct ggml_tensor * tensor) {
 }
 
 void ggml_cuda_set_main_device(int main_device) {
-    if (main_device > g_device_count) {
+    if (main_device >= g_device_count) {
         fprintf(stderr, "warning: cannot set main_device=%d because there are only %d devices. Using device %d instead.\n",
                 main_device, g_device_count, g_main_device);
         return;