aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Su <howard0su@gmail.com>2023-06-16 01:29:59 +0800
committerGitHub <noreply@github.com>2023-06-15 19:29:59 +0200
commit64cc19b4fe3df03bc20e520aa111c30cff3a655e (patch)
tree0087039c089fffd82ac18ffa6d7652233e52388e
parent4bfcc855abdb2c9fcc3c5a84747974521909fa41 (diff)
Fix the validation of main device (#1872)
-rw-r--r--ggml-cuda.cu2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu
index 0565571..0873e3e 100644
--- a/ggml-cuda.cu
+++ b/ggml-cuda.cu
@@ -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;