]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
llama: use host memory if device reports 0 memory (llama/18587)
authorAaron Teo <redacted>
Thu, 8 Jan 2026 21:34:56 +0000 (05:34 +0800)
committerGeorgi Gerganov <redacted>
Wed, 14 Jan 2026 07:11:59 +0000 (09:11 +0200)
ggml/src/ggml-backend-impl.h
ggml/src/ggml-opencl/ggml-opencl.cpp

index 6792ba986e8ed5041de450ddaab7fe2ba6af8446..59190b7c4656d8cd55d649791f3417a875a2d94b 100644 (file)
@@ -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
index 472e2df50a4d1f59cbfc8fa5bec402ecc9858d76..e50ca8e0f2700797cf33cf3c454a8ef1dfeb1e80 100644 (file)
@@ -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);
 }