-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
crashes when calling c++ in arm android #15006
Comments
@dkurt do you have suggestions? |
Which directory? |
@dkurt Thanks,At first my project directory tree:
But when got this error msg:
I change my project tree into:
When the application starts, I copy all the libraries in the assert directory to the android readable directory,and then change the location of all the plugin.so in the xml file:
This directory
The error seems that openvino c++ want to access directory I also tried to manually load all the plugin.so myself, here is CMakeLists.txt:
But another error occur:
As you mentioned, running C++ requires rooted device, I think this is a little unfriendly when you want to deploy openvino on arm Android. |
There is a similar report dkurt/openvino_java#18, however I cannot reproduce the problem. Can you verify that Java API works? |
Thanks, I think I know what to after looking at the java api source code: https://github.com/openvinotoolkit/openvino_contrib/blob/master/modules/java_api/org/intel/openvino/compatibility/IECore.java#L45 I should load the libopenvino.so library manually in dart code instead of in the camkeLists.txt. |
@yyccR, can you please check your Android API Level? In example, using CPU-Z app (System tab) If it's below 31, probably you tried the binaries with higher API requirement. For example, in the case with similar error message dkurt/openvino_java#18 binaries from Try rebuild OpenVINO with lower |
Thanks, @dkurt
it was built with
This error This loading method is very different from other inference frameworks such as onnxruntime, tflite, ncnn, paddle-lite. |
Do you know whether is happens during reading model through the frontend library or compiling for inference? Will it be convenient for Android scenarios to build OpenVINO with plugins / frontends as a single Thanks, |
Thanks, I will try it and report the result。
I haven't tried to do that. |
@ilya-lavrenov
got error:
|
@yyccR,t Sorry if missed, but have you managed to workaround the problem finally? In dkurt/openvino_java#18 where Android device with API level 29 is used we rebuild OpenVINO with
|
This is fixed on master branch and I ported to 2022.3 as well. |
thanks, I have pull the latest master branch of openvino and the branch- |
@dkurt I found that when I built openvino_contrib with the |
The same error about openvino_arm_cpu_plugin or initial libopenvino.so? |
Same error when cmake configure static library:
and the cmake flags:
|
@yyccR seems you got onto the right path with Java API, can this issue be closed? |
System information (version)
Detailed description
I was going to use openvino in flutter by calling c++ instead of using the Java api, but it crashed when calling c++ to initialize the model, here is the error msg:
Abort message: 'terminating with uncaught exception of type ov::Exception: Can't get absolute file path for [/data/app/com.test.test-YcefHGmNSq6Rurhx-jV-xQ==/base.apk!/lib/arm64-v8a/libopenvino.so], err = No such file or directory'
here is the c++ code:
and I have build the openvino with arm cpu plugin, below is the shared library and plugins.xml:
I have linked the libopenvino.so in the project and include all the header files, this is my CMakeLists.txt
And I've put all the plugin shared libraries in the same directory as libopevino.so。
I also put plugins.xml, openvino_model.xml, openvino_model.bin in the assert directory and copy these three files to the android system when I start the application so that c++ programs can read them.
The error below
seems that openvino c++ wants to find the libopenvino library directory and get the plugin shared library, but cannot access it when android is not root
So I've put all the plugin.so in the asset directory, and change the plugins.xml into :
The location in plugins.xml is the path to the android system file, which can be read by c++ programs, and is the target copy path to the asset file。
After trying, I still get the same error message.
please let me know if you have a solution.
Thank you so much.
The text was updated successfully, but these errors were encountered: