Skip to content

Commit 3980e04

Browse files
authored
llama : add missing call to ggml_backend_load_all() (ggml-org#22752)
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent 2496f9c commit 3980e04

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/llama.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,18 @@ bool llama_supports_mlock(void) {
7171
}
7272

7373
bool llama_supports_gpu_offload(void) {
74+
if (!ggml_backend_reg_count()) {
75+
ggml_backend_load_all();
76+
}
7477
return ggml_backend_dev_by_type(GGML_BACKEND_DEVICE_TYPE_GPU) != nullptr ||
7578
ggml_backend_dev_by_type(GGML_BACKEND_DEVICE_TYPE_IGPU) != nullptr ||
7679
llama_supports_rpc();
7780
}
7881

7982
bool llama_supports_rpc(void) {
83+
if (!ggml_backend_reg_count()) {
84+
ggml_backend_load_all();
85+
}
8086
return ggml_backend_reg_by_name("RPC") != nullptr;
8187
}
8288

0 commit comments

Comments
 (0)