]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama : do not skip iGPU when only RPC devices are present (#23868)
authorRadoslav Gerganov <redacted>
Sat, 30 May 2026 04:48:22 +0000 (07:48 +0300)
committerGitHub <redacted>
Sat, 30 May 2026 04:48:22 +0000 (07:48 +0300)
After #23007 reclassified integrated CUDA/HIP devices as IGPU, the device
selection logic dropped the local iGPU whenever any RPC server was added,
because RPC devices made `model->devices` non-empty. On systems where the
"iGPU" is the main compute device (e.g. Strix Halo with 128 GiB of unified
memory), this caused all tensors to be allocated on the RPC peer alone and
model loading to fail.

Gate the iGPU inclusion on `gpus.empty()` instead, so RPC peers no longer
suppress the local iGPU.

closes: #23858

src/llama.cpp

index dfe30ce8f611bad8e7b1ad7585e750d8c6b91d81..edacd1d5f424ee0a11163f4f51474d39c9d1c936 100644 (file)
@@ -239,8 +239,9 @@ static bool llama_prepare_model_devices(const llama_model_params & params, llama
         // add GPUs
         model->devices.insert(model->devices.end(), gpus.begin(), gpus.end());
 
-        // add integrated GPUs only if no other devices were found
-        if (model->devices.empty()) {
+        // add integrated GPUs only if no discrete GPUs were found
+        // (RPC servers do not count, otherwise the local iGPU would be dropped on iGPU+RPC setups)
+        if (gpus.empty()) {
             model->devices.insert(model->devices.end(), igpus.begin(), igpus.end());
         }
     }