]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/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>
Wed, 18 Dec 2024 10:52:16 +0000 (12:52 +0200)
commit2c05efa4b1617765c44bc308ead8029e39408e49
tree265e5bb5fc1cb25102fbff0674f96203a625defd
parentc21fb10b284ce0d3ee116be96447a8cc8c7a0994
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>
ggml/src/ggml-backend-reg.cpp