]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : allow virtual igpu devices (#26953)
authorGeorgi Gerganov <redacted>
Fri, 14 Aug 2026 12:14:19 +0000 (15:14 +0300)
committerGitHub <redacted>
Fri, 14 Aug 2026 12:14:19 +0000 (15:14 +0300)
* llama : allow virtual igpu devices

* cont : better comment

src/llama.cpp

index 9ff1902fc1d5c528b18f61035381774a4a61bb7d..1609fec88ddfe3032e677590794bbadd1c93a2f7 100644 (file)
@@ -257,7 +257,11 @@ static bool llama_prepare_model_devices(const llama_model_params & params, llama
                     }
 
                     case GGML_BACKEND_DEVICE_TYPE_IGPU:
-                        if (igpus.empty()) {
+                        // igpus.empty() - workaround for integrated devices seen by multiple backends
+                        // ref: https://github.com/ggml-org/llama.cpp/pull/23897
+                        // ggml_backend_dev_backend_reg - allow devices of the same backend regardless if integrated
+                        // ref: https://github.com/ggml-org/llama.cpp/pull/23897#issuecomment-5264222997
+                        if (igpus.empty() || ggml_backend_dev_backend_reg(dev) == ggml_backend_dev_backend_reg(igpus.back().dev)) {
                             igpus.push_back({false, dev});
                         }
                         break;