Qualcomm AI Hub example NPU error

I’m trying to run the face_det_lite example from the AI Model Hub following the docs.

Passing the —use-npu flag results in QNN Delegate error.


python3 face_detection.py --use-npu


/prj/qct/webtech_hyd18/mlg_user_admin/qaisw_source_repo/qaisw_repo_point_release/snpe_src/avante-tools/prebuilt/dsp/hexagon-sdk-4.2.0/ipc/fastrpc/rpcmem/src/rpcmem_android.c:38:dummy call to rpcmem_init, rpcmem APIs will be used from libxdsprpc

ERROR: [QNN Delegate] Failed to create device_handle for Backend ID 6, error=14001

Traceback (most recent call last):

File "/home/ubuntu/qai/face_detection.py", line 22, in <module>

interpreter = Interpreter(

^^^^^^^^^^^^

File "/home/ubuntu/qnn_venv/lib/python3.12/site-packages/ai_edge_litert/interpreter.py", line 536, in __init__

self._interpreter.ModifyGraphWithDelegate(

RuntimeError: Restored original execution plan after delegate application failure.

System Info:

Os image link


PRETTY_NAME="Ubuntu 24.04.3 LTS"

NAME="Ubuntu"

VERSION_ID="24.04"

VERSION="24.04.3 LTS (Noble Numbat)"

VERSION_CODENAME=noble

ID=ubuntu

ID_LIKE=debian

HOME_URL="https://www.ubuntu.com/"

SUPPORT_URL="https://help.ubuntu.com/"

BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

UBUNTU_CODENAME=noble

LOGO=ubuntu-logo

qnn-platform-validator test is also failing


qnn-platform-validator --backend dsp --testBackend


PF_VALIDATOR: DEBUG: Calling PlatformValidator->setBackend

PF_VALIDATOR: DEBUG: Calling PlatformValidator->isBackendHardwarePresent

PF_VALIDATOR: DEBUG: Calling PlatformValidator->isBackendAvailable

PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libc.so.6

PF_VALIDATOR: DEBUG: dlOpen successfull for library : libc.so.6

PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libcdsprpc.so

PF_VALIDATOR: DEBUG: dlOpen successfull for library : libcdsprpc.so

Backend DSP Prerequisites: Present.

PF_VALIDATOR: DEBUG: Calling PlatformValidator->backendCheck

PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libc.so.6

PF_VALIDATOR: DEBUG: dlOpen successfull for library : libc.so.6

PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libcdsprpc.so

PF_VALIDATOR: DEBUG: dlOpen successfull for library : libcdsprpc.so

PF_VALIDATOR: DEBUG: Starting calculator test

PF_VALIDATOR: DEBUG: Loading sample stub: libQnnHtpV68CalculatorStub.so

PF_VALIDATOR: DEBUG: Successfully loaded DSP library - 'libQnnHtpV68CalculatorStub.so'. Setting up pointers.

Error opening session with unsigned PD

PF_VALIDATOR: ERROR: -1 . Error while executing the sum function.

PF_VALIDATOR: ERROR: Please use testsig if using unsigned images.

PF_VALIDATOR: ERROR: Also make sure ADSP_LIBRARY_PATH points to directory containing skels.

Unit Test on the backend DSP: Failed.

QNN is NOT supported for backend DSP on the device.

*********** Results Summary ***********

Backend = DSP

{

Backend Hardware : Supported

Backend Libraries : Found

Library Version : Not Queried

Core Version : Not Queried

Unit Test : Failed

}

Error in saving the results ⏎

May I ask whether you are using Ubuntu Server or Ubuntu Desktop?
Have you also used root privileges?
We recommend testing with the latest version; you can refer to the following steps to upgrade.

If the issue persists, please share the ~/aihub-demo directory from your development board.

I am using Ubuntu desktop and using its latest version. I tried with root privileges but got the same errors no difference.

I am wondering what can be the reason for the error.
Error opening session with unsigned PD, I see a lot of people going through this issue but not got a final answer to solve this

The issues identified in the Ubuntu Desktop image will be optimized in a future release.
For the time being, we recommend that you use the Ubuntu Server image for your AI-development activities, provided this alternative is acceptable to you.

I just checked with the Ubuntu server image and there is no difference at all. I got the same error as the desktop version.

We have verified that the Ubuntu Server image functions correctly in our environment.
Would you kindly share the ~/aihub-demo directory from your development board?

I followed this demo and there is only one file face_detection.py.
I transferred the qnn libs to the board and set LD_LIBRARY_PATH and ADSP_LIBRARY_PATH
After running the python3 face_detection.py --use-npu, I got

<W> Initializing HtpProvider
 <W> Specified config SOC, ignoring on real target
 <E> Fail to get effective domain id from rpc with DeviceId 0 coreId 0 pdId 0
 <E> error in creation of transport instance
 <W> Failed to create transport instance: 1002
 <E> Failed to create transport for device, error: 1002
 <E> Failed to load skel, error: 1002
 <E> Transport layer setup failed: 14001
 <E> Failed to parse default platform info: 14001                                                                    <E> Failed to load default platform info: 14001
 <E> Failed to parse platform config: 14001
Traceback (most recent call last):
  File "/home/ubuntu/litert-demo/face_detection.py", line 22, in <module>                                               interpreter = Interpreter(
                  ^^^^^^^^^^^^
  File "/home/ubuntu/litert-demo/.venv/lib/python3.12/site-packages/ai_edge_litert/interpreter.py", line 536, in __init__                                                                                                                   self._interpreter.ModifyGraphWithDelegate(
RuntimeError: Restored original execution plan after delegate application failure.

Also the qnn-platform-validator dsp test also keep failing.

--backend dsp --testBackend
PF_VALIDATOR: DEBUG: Calling PlatformValidator->setBackend
PF_VALIDATOR: DEBUG: Calling PlatformValidator->isBackendHardwarePresent
PF_VALIDATOR: DEBUG: Calling PlatformValidator->isBackendAvailable
PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libc.so.6
PF_VALIDATOR: DEBUG: dlOpen successfull for library : libc.so.6
PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libcdsprpc.so
PF_VALIDATOR: DEBUG: dlOpen successfull for library : libcdsprpc.so
Backend DSP Prerequisites: Present.
PF_VALIDATOR: DEBUG: Calling PlatformValidator->backendCheck
PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libc.so.6
PF_VALIDATOR: DEBUG: dlOpen successfull for library : libc.so.6
PF_VALIDATOR: DEBUG: Should be able to access atleast one of libraries from : libcdsprpc.so
PF_VALIDATOR: DEBUG: dlOpen successfull for library : libcdsprpc.so
PF_VALIDATOR: DEBUG: Starting calculator test
PF_VALIDATOR: DEBUG: Loading sample stub: libQnnHtpV68CalculatorStub.so
PF_VALIDATOR: DEBUG: Successfully loaded DSP library - 'libQnnHtpV68CalculatorStub.so'.  Setting up pointers.       Error opening session with unsigned PD
Unable to destroy the handlePF_VALIDATOR: ERROR: -6 . Error while executing the sum function.
PF_VALIDATOR: ERROR: Please use testsig if using unsigned images.
PF_VALIDATOR: ERROR: Also make sure ADSP_LIBRARY_PATH points to directory containing skels.                         Unit Test on the backend DSP: Failed.
QNN is NOT supported for backend DSP on the device.

May I ask whether you performed the test using the method below?
If so, please share the ~/aihub-demo directory, as we will use it for testing and to gather further information.
If not, kindly refer the method below first to confirm that python3 face_detection.py --use-npu executes successfully.

Update:
If the issue persists, please upload the ~/aihub-npu directory.

I found out the solution, this is due to the qnn libs version mismatch and the wrong version of qairt sdk. For now it’s working for me.

Great news! Thank you for your response.

@vasucp1207 How did you solve the version mismatch issue please? I have the same problem I guess.

I installed the v2.37.1.250807 qairt sdk and removed all the dependencies from the old one. Kept the complete sdk on your board and set the env variables.

export QNN_SDK_ROOT=<path>/2.37.1.250807
export ADSP_LIBRARY_PATH=$QNN_SDK_ROOT/lib/hexagon-v$DSP_ARCH/unsigned
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QNN_SDK_ROOT/lib/aarch64-oe-linux-gcc11.2
export PRODUCT_SOC=6490 DSP_ARCH=68

# test for the dsp backend(make sure qnn-platform-validator points to right location)
qnn-platform-validator --backend dsp --testBackend