]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
Fix crash caused by ggml_backend_load_all when launching on Android Activity (#10812)
author谢乃闻 <redacted>
Fri, 13 Dec 2024 12:56:07 +0000 (12:56 +0000)
committerGitHub <redacted>
Fri, 13 Dec 2024 12:56:07 +0000 (13:56 +0100)
commit9f35e44592a7646a5803620eb6a3f0ed5ac90553
treec5d444d231a44a8ddaa0ec2e16f35dd1abd2ad6b
parent64ae0655114f84f11a724bc6878c6f8f4a55560b
Fix crash caused by ggml_backend_load_all when launching on Android Activity (#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