From: Aaron Teo Date: Thu, 8 Jan 2026 21:34:56 +0000 (+0800) Subject: llama: use host memory if device reports 0 memory (llama/18587) X-Git-Tag: v0.9.6~92 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=880736e7016ad3a8774b7c5162479cb0c9ceb265;p=pkg%2Fggml%2Fsources%2Fggml llama: use host memory if device reports 0 memory (llama/18587) --- diff --git a/src/ggml-backend-impl.h b/src/ggml-backend-impl.h index 6792ba98..59190b7c 100644 --- a/src/ggml-backend-impl.h +++ b/src/ggml-backend-impl.h @@ -144,7 +144,7 @@ extern "C" { // device description: short informative description of the device, could be the model name const char * (*get_description)(ggml_backend_dev_t dev); - // device memory in bytes + // device memory in bytes: 0 bytes to indicate no memory to report void (*get_memory)(ggml_backend_dev_t dev, size_t * free, size_t * total); // device type diff --git a/src/ggml-opencl/ggml-opencl.cpp b/src/ggml-opencl/ggml-opencl.cpp index 472e2df5..e50ca8e0 100644 --- a/src/ggml-opencl/ggml-opencl.cpp +++ b/src/ggml-opencl/ggml-opencl.cpp @@ -4287,8 +4287,8 @@ static const char * ggml_backend_opencl_device_get_description(ggml_backend_dev_ } static void ggml_backend_opencl_device_get_memory(ggml_backend_dev_t dev, size_t * free, size_t * total) { - *free = 1; - *total = 1; + *free = 0; + *total = 0; GGML_UNUSED(dev); }