Skip to content

Commit adc67b7

Browse files
rgerganovliuyang.marshall
authored and
liuyang.marshall
committed
ggml : allow loading backend with env variable (ggml/1059)
ref: ggml-org#1058
1 parent b128d64 commit adc67b7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ggml/src/ggml-backend-reg.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,4 +574,9 @@ void ggml_backend_load_all_from_path(const char * dir_path) {
574574
ggml_backend_load_best("opencl", silent, dir_path);
575575
ggml_backend_load_best("musa", silent, dir_path);
576576
ggml_backend_load_best("cpu", silent, dir_path);
577+
// check the environment variable GGML_BACKEND_PATH to load an out-of-tree backend
578+
const char * backend_path = std::getenv("GGML_BACKEND_PATH");
579+
if (backend_path) {
580+
ggml_backend_load(backend_path);
581+
}
577582
}

0 commit comments

Comments
 (0)