From b5ccd62135b18ccd16aa759d2660e4e42c0aed96 Mon Sep 17 00:00:00 2001 From: "Li, Zonghang" <870644199@qq.com> Date: Sat, 14 Jun 2025 18:55:53 +0400 Subject: [PATCH] fix n_gpu_layers allocation errors --- common/common.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index dff98506..573e8107 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -1421,8 +1421,9 @@ static bool assign_layers_to_device( if (n_m < static_cast(std::floor(W * vec_z_gpu[m]))) { // if there is still free GPU memory has_free_gpu_memory = true; - } else if (w_m > n_m) { - // if the GPU is overloaded + } + if (w_m > n_m) { + // if layers are offloaded to CPU has_gpu_overload = true; } } else if (!in_set(m, M4)) {