Skip to content

Commit 1738129

Browse files
authored
llama : do not skip iGPU when only RPC devices are present (#23868)
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
1 parent 0821c5f commit 1738129

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/llama.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,9 @@ static bool llama_prepare_model_devices(const llama_model_params & params, llama
239239
// add GPUs
240240
model->devices.insert(model->devices.end(), gpus.begin(), gpus.end());
241241

242-
// add integrated GPUs only if no other devices were found
243-
if (model->devices.empty()) {
242+
// add integrated GPUs only if no discrete GPUs were found
243+
// (RPC servers do not count, otherwise the local iGPU would be dropped on iGPU+RPC setups)
244+
if (gpus.empty()) {
244245
model->devices.insert(model->devices.end(), igpus.begin(), igpus.end());
245246
}
246247
}

0 commit comments

Comments
 (0)