]> git.djapps.eu Git - pkg/ggml/sources/ggml/commit
Fix crash caused by ggml_backend_load_all when launching on Android Activity (llama...
author谢乃闻 <redacted>
Fri, 13 Dec 2024 12:56:07 +0000 (12:56 +0000)
committerGeorgi Gerganov <redacted>
Tue, 17 Dec 2024 17:23:40 +0000 (19:23 +0200)
commitc01afc1a12bb116a8af6762d4ab419b4cb86a6d6
tree07124f98f3b66755650e7eecca45c30bcda1943b
parent25312042e8d29c7649ac908984c4d3eade15474f
Fix crash caused by ggml_backend_load_all when launching on Android Activity (llama/10812)

* Fix crash caused by ggml_backend_load_all when launching on AndroidActivity.

Details:
Calling ggml_backend_load_all during initialization in the AndroidActivity project leads to a crash with the error:
terminating with uncaught exception of type std::__ndk1::__fs::filesystem::filesystem_error: filesystem error: in directory_iterator::directory_iterator(...): Permission denied [./].
This issue occurs because AndroidActivity restricts file access due to sandboxing.

Reproduction:
In the example folder, the LlamaAndroid project can reproduce the crash by calling ggml_backend_load_all first in Java_android_llama_cpp_LLamaAndroid_backend_1init.

* Update ggml/src/ggml-backend-reg.cpp

---------

Co-authored-by: Diego Devesa <redacted>
src/ggml-backend-reg.cpp