Skip to content

Commit 94607d5

Browse files
committed
ggml : allow loading backend with env variable
ref: #1058
1 parent 6a7a034 commit 94607d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ggml-backend-reg.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -549,4 +549,9 @@ void ggml_backend_load_all_from_path(const char * dir_path) {
549549
ggml_backend_load_best("opencl", silent, dir_path);
550550
ggml_backend_load_best("musa", silent, dir_path);
551551
ggml_backend_load_best("cpu", silent, dir_path);
552+
// check the environment variable GGML_BACKEND_PATH to load an out-of-tree backend
553+
const char * backend_path = std::getenv("GGML_BACKEND_PATH");
554+
if (backend_path) {
555+
ggml_backend_load(backend_path);
556+
}
552557
}

0 commit comments

Comments
 (0)