Open iknowican opened 1 month ago
more like environment issue, make sure you have export VENDOR_LIB=/vendor/lib64/ export LD_LIBRARY_PATH=/data/local/tmp/your_qnn/v227:/vendor/dsp/cdsp:$VENDOR_LIB export ADSP_LIBRARY_PATH="/data/local/tmp/qnn/v227;/vendor/dsp/cdsp;/vendor/lib/rfsa/adsp;/system/lib/rfsa/adsp;/dsp" similar issue to https://github.com/microsoft/onnxruntime/issues/21887
try setting ADSP_LIBRARY_PATH so that it contains the directory with the QNN libs
Whether to use setting ADSP_LIBRARY_PATH when building onnxrntime
Have you solved this problem? I also encountered the same error
Snapdragon 8 Gen 1 is v69, make sure you copied the v69 libs from hexagon-v69 folder to the folder which has libQnnHtp.so
This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.
Well, it took a bit of time to figure out what was wrong in my case.
First, i use Qt toolchain, so, it was crucial to set up Qt/CMake variable to import Android manifest with explicitly declared native libraries (libcdsprpc.so). I missed this step and got auto-generated manifest without platform libs declaration. It solved the problem, but partially.
Second, right after resolving issue with libcdsprpc.so, i got errors about access to tmpfs
. At this point everything turned into a battle versus SELinux and apk restrictions. I spent a few days on it and switched to another chip without such problems.
That's all for now. Thanks a lot!
Describe the issue
I have Snapdragon 8 Gen 1+ (v69 platform) and i am trying to initialize ONNX runtime with QNN backend (with NPU support).
I followed the instruction described if the official documentation from QNN execution provider and got onnxruntime.so for arm64-v8a. Doc states, that i need to put QNN dependencies such as libQnnHtp.so inside my .apk.
After this step i got following list of libraries (from Qualcomm AI SDK):
Here is a code, that i use to initialize session:
I used a model from ONNX model zoo, small enough, to check that problem persists on any model.
At this point i got the following output:
As i can see, the main problem is here
So, it looks like i picked right dependencies, and, at least, QNN EP is constructed, but, for some unknown reason, failed to allocate memory on DSP. I guess this problem can be related to Qualcomm AI SDK or CPU/NPU itself, but here is a chance, that QNN EP may handle something wrong (or i am missing something).
To reproduce
Provided in description.
In general, build QNN EP according to official instructions with standard Qualcomm libraries (i used QAIRT 2.27.0.240926 and Hexagon SDK 6.0.0.2), then try to initialize session using QNN EP with default settings and any model on Snapdragon 8 Gen 1+.
Urgency
N/A
Platform
Android
OS Version
API 29, 30
ONNX Runtime Installation
Built from Source
Compiler Version (if 'Built from Source')
Clang 17.0.2
Package Name (if 'Released Package')
onnxruntime-mobile
ONNX Runtime Version or Commit ID
a47254eaef87a4572078d3165f4b9d1c4b4c52b1
ONNX Runtime API
C++/C
Architecture
ARM64
Execution Provider
Other / Unknown
Execution Provider Library Version
QNN