Skip to content

QNN_TARGET_ARCH when running qnn-model-lib-generator and qnn-context-binary-generator #4022

@xiaoxiaosuaxuan

Description

@xiaoxiaosuaxuan

I want to run a neural network on the htp backend on Android device. My host device is linux x64.

Following the documentation https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/qnn_tutorial_linux_host_linux_target.html?product=1601111740009302, I first use qnn-model-lib-generator to get a .so model file, then use qnn-context-binary-generator to get the serialized binary file.

According to the documenation, when run qnn-model-lib-generator, the "-t" option should be set to "aarch64-android". But doing so leads the following qnn-context-binary-generator command fails, specifically:

if the backend is set to "${QNN_SDK_ROOT}/lib/aarch64-android/libQnnHtp.so", the error is:

0.2ms [ ERROR ] Unable to load backend. dlerror(): /opt/qcom/aistack/qairt/2.31.0.250130/lib/aarch64-android/libQnnHtp.so: cannot open shared object file: No such file or directory
0.2ms [ ERROR ] Failed to load backendLib! 
0.2ms [ ERROR ] Could not load backend : /opt/qcom/aistack/qairt/2.31.0.250130/lib/aarch64-android/libQnnHtp.so!

if the target of the model library is set to "aarch64-android", ther error is:

 27.6ms [ ERROR ] Unable to load model. dlerror(): ./linear_model_lib/aarch64-android/liblinear_model.so: cannot open shared object file: No such file or directory
 27.6ms [ ERROR ] Failed to load ModelLib!
 27.6ms [ ERROR ] Could not load model : ./linear_model_lib/aarch64-android/liblinear_model.so!

It seems that on linux host, qnn-context-binary-generator can't open .so file whose target is "aarch64-android". And if I replace all these files to the "x86_64-linux-clang" version(including set the target of qnn-model-lib-generator to "x86_64-linux-clang", and set the backend when running qnn-context-binary-generator to "x86_64-linux-clang/libQnnHtp.so"), I can successfully generate the context binary file.

However, I still failed to run the context binary file with qnn-net-run on my Android device, with the "initialization failure" or "device creation failure" errors.

Metadata

Metadata

Assignees

Labels

QNNIssues related to QNNbugSomething isn't workingwaiting on more informationThis doesn't seem right

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions