llama : skip main_gpu validation when no devices are available (#23405)

This commit is contained in:
Dev-iL 2026-06-17 17:30:26 +03:00 committed by GitHub
parent 1a2dea29b9
commit b4024af6c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -249,7 +249,7 @@ static bool llama_prepare_model_devices(const llama_model_params & params, llama
}
// if using single GPU mode, remove all except the main GPU
if (params.split_mode == LLAMA_SPLIT_MODE_NONE) {
if (params.split_mode == LLAMA_SPLIT_MODE_NONE && !model->devices.empty()) {
if (params.main_gpu < 0) {
model->devices.clear();
} else {