]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : add missing call to ggml_backend_load_all() (#22752)
authorAdrien Gallouët <redacted>
Thu, 7 May 2026 05:24:47 +0000 (07:24 +0200)
committerGitHub <redacted>
Thu, 7 May 2026 05:24:47 +0000 (08:24 +0300)
Signed-off-by: Adrien Gallouët <redacted>
src/llama.cpp

index b5dd8433c4b1998e1d19ad2de1ec66f3966ee10f..dfe30ce8f611bad8e7b1ad7585e750d8c6b91d81 100644 (file)
@@ -71,12 +71,18 @@ bool llama_supports_mlock(void) {
 }
 
 bool llama_supports_gpu_offload(void) {
+    if (!ggml_backend_reg_count()) {
+        ggml_backend_load_all();
+    }
     return ggml_backend_dev_by_type(GGML_BACKEND_DEVICE_TYPE_GPU) != nullptr ||
            ggml_backend_dev_by_type(GGML_BACKEND_DEVICE_TYPE_IGPU) != nullptr ||
            llama_supports_rpc();
 }
 
 bool llama_supports_rpc(void) {
+    if (!ggml_backend_reg_count()) {
+        ggml_backend_load_all();
+    }
     return ggml_backend_reg_by_name("RPC") != nullptr;
 }