Forums - Cannot run model on HTP backend

7 posts / 0 new
Last post
Cannot run model on HTP backend
andrei.iancu
Join Date: 9 Jun 22
Posts: 4
Posted: Thu, 2023-03-16 03:34

Hello!

I'm working on a Qualcomm Ride platform which has a SA8540P  ( SA8540P_v2.1_ft0_ADP_Ride_v1.0.2_UFS_NORMAL aarch64le). I've converted the inception v3 model using the provided scripts on the SDK and tried after that to run the obtained libInception_v3.so on the device. 

For CPU it worked without any issues, but when I'm trying to run it on HTP by using the libQnnHtp.so, I'm getting errors.

Here is the verbose output and command:

Command:

./bin/qnn-net-run --model ../../model/libInception_v3.so --input_list ../../data/cropped/raw_list.txt --log_level verbose --backend lib/libQnnHtp.so

Output:

qnn-net-run pid:2584636
     0.0ms [  INFO ] Backend: lib/libQnnHtp.so
     0.0ms [  INFO ] Model: ../../model/libInception_v3.so
     3.0ms [  INFO ] Loading model shared library ([model].so)
   174.0ms [  INFO ] Backend does not support asynchronous execution, defaulting to synchronous
   174.0ms [  INFO ] qnn-net-run build version: v2.7.0.230203063221_51381-auto
   175.0ms [  INFO ] Backend     build version: v2.7.0.230203063221_51381-auto
   175.0ms [  INFO ] Initializing logging in the backend. Callback: [101688e8], Log Level: [4]
     0.0ms [  INFO ] QnnDsp <I> Qnn log initialized
 
     0.0ms [  INFO ] QnnDsp <I> addClient done (1). status 0x0
 
   175.0ms [  INFO ] No BackendExtensions lib provided;initializing NetRunBackend Interface
     0.0ms [  INFO ] QnnDsp <I> addClient started.
 
     0.0ms [VERBOSE] QnnDsp <V> BackendLifecycle: Add client, clientCnt = 1, callCnt = 0, deinitCnt = 0
 
     0.0ms [VERBOSE] QnnDsp <V> Backend handle created: 1
 
     0.0ms [  INFO ] QnnDsp <I> addClient done (1). status = 0x0
 
     0.0ms [  INFO ] QnnDsp <I> QnnDevice_create started. device = 0x1
 
     0.0ms [  INFO ] QnnDsp <I> exit with 0
 
     0.0ms [  INFO ] QnnDsp <I> exit with 0
 
     0.0ms [  INFO ] QnnDsp <I> exit with 0
 
     0.0ms [  INFO ] QnnDsp <I> exit with 0
 
     0.0ms [VERBOSE] QnnDsp <V> Config not passed. Loading default config
 
     0.0ms [VERBOSE] QnnDsp <V> Setting default value for unsigned PD usage
 
     0.0ms [VERBOSE] QnnDsp <V> skel file path file:///libQnnHtpV68Skel.so?qnn_skel_handle_invoke&_modver=1.0&_dom=cdsp
 
     0.0ms [ ERROR ] QnnDsp <E> Failed to resolve symbol 'stubLoadDspQueueFuncs' for dspQueue: Symbol not found
 
     0.0ms [ ERROR ] QnnDsp <E> failed to load remote functions
 
     0.0ms [ ERROR ] QnnDsp <E> Failed to create transport instance: 4000
 
     0.0ms [ ERROR ] QnnDsp <E> Failed to load skel
 
     0.0ms [VERBOSE] QnnDsp <V> exits device initialization with  4000
 
     0.0ms [ ERROR ] QnnDsp <E> Tranport layer setup failed: 4000
 
     0.0ms [ ERROR ] QnnDsp <E> Failed to parse default platform info: 4000
 
     0.0ms [ ERROR ] QnnDsp <E> Failed to load default platform info: 4000
 
     0.0ms [ ERROR ] QnnDsp <E> Failed to parse platform config: 4000
 
     0.0ms [  INFO ] QnnDsp <I> QnnDevice_create done. status 0xfa0
 
   179.0ms [ ERROR ] Failed to create device: 4000
   179.0ms [ ERROR ] Device Creation failure
     0.0ms [  INFO ] QnnDsp <I> terminateClient started. 0x1
 
     0.0ms [VERBOSE] QnnDsp <V> BackendLifecycle: terminating client. clientCnt = 1, callCnt = 0, prev deinitCnt = 0
 
     0.0ms [  INFO ] QnnDsp <I> terminateClient done. status 0x0
 
     0.0ms [  INFO ] QnnDsp <I> terminateClient started. logger = 0x1
 
     0.0ms [VERBOSE] QnnDsp <V> LoggerLifecycle: terminating client. clientCnt = 1
 
     0.0ms [  INFO ] QnnDsp <I> Qnn log terminated
 
     0.0ms [  INFO ] QnnDsp <I> terminateClient done. status 0x0
 
     0.0ms [  INFO ] QnnDsp <I> Polling not supported in terminateWorkerThreads
 
     0.0ms [  INFO ] QnnDsp <I> Polling not supported in clearAllContexts
 
     0.0ms [VERBOSE] QnnDsp <V> Starting final logging cleanup.
 
     0.0ms [VERBOSE] QnnDsp <V> Final cleanup for logging successful.
 
Any idea on how to run the model on Hexagon? CPU/GPU is not enough.
 
Thank you,
Andrei
  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sat, 2023-03-25 23:12

Dear customer,

It seems like you executed model on online compile and error happened.

Have your tired to serialize your model to offline compile with tool of qnn-context-binary-generator?

BR.

Wei

  • Up0
  • Down0
andrei.iancu
Join Date: 9 Jun 22
Posts: 4
Posted: Thu, 2023-03-30 05:19

Thank you a lot for the reply!

Yes, I have tried to serialize the model and run it on host and also on target SA8540P.

On host x86_64_linux_clang it works, also using the HTP backend.

On target device it doesn't. I'm getting the following message:

Command:

 ./qnn-context-binary-generator --model ../quant_model/aarch64-qnx/quant_how_aarch64_qnx.so --backend libQnnHtp.so --binary_file how_context_htp --output_dir ../quant_model/  --log_level error

Output:

qnn-context-binary-generator pid:1646653
ERROR 0x6c: remote_session_control failed to set thread params
     0.0ms [ ERROR ] QnnDsp <E> setSkelLogLevelInternal failed 1

     0.0ms [ ERROR ] QnnDsp <E> HtpPrepare load failed Library cannot be found

     0.0ms [ ERROR ] QnnDsp <E> HTP Prepare backend missing. Aborting

[ ERROR ] QnnModel::initialize() not able to create graph in given context.[ ERROR ] model.initialize(backendHandle, interface, contextHandle, "model", debug, DO_GRAPH_NODE_VALIDATIONS, graphConfigs) expected MODEL_NO_ERROR, got MODEL_GRAPH_ERROR
    99.0ms [ ERROR ] Failed in composeGraphs()
    99.0ms [ ERROR ] Graph Compose failure
     0.0ms [ ERROR ] QnnDsp <E> Skel side context cleanup failed with error -1

     0.0ms [ ERROR ] QnnDsp <E> exits with 2147483647, undefined m_mutex handle object

     0.0ms [ ERROR ] QnnDsp <E> exits with 2147483647, undefined m_mutex handle object

   100.0ms [ ERROR ] Could not terminate backend
     0.0ms [ ERROR ] QnnDsp <E> Unable to terminate polling on skel side for device 0 core 0

This looks to me like there are missing HTP libraries on the device. But I'm not sure.

The platform validator says that the DSP backed is supported but the library prerequisites are not found, so the overall result for DSP is failed.

*/ So to me it looks like the required libraries for HTP are missing. If this is right please confirm and let me know what I should be doing next. My guess is that I will have to flash the platform with a different build.

 

  • Up0
  • Down0
ruzhongl
Join Date: 7 Jun 21
Posts: 42
Posted: Thu, 2023-04-06 21:02

HtpPrepare load failed Library cannot be found

--------------------------------------------------------------------------------------

QNX do not support online prepare  due to qnx c++ toolchain, so we remove QNNPrepare for QNX platform. I want to check your qnn-net-run cmd,the option should be --retrieve_context instead of --model 

 

qnn-net-run xxxx --retrieve_context how_context_htp

  • Up0
  • Down0
andrei.iancu
Join Date: 9 Jun 22
Posts: 4
Posted: Thu, 2023-04-13 02:19

Hey, thanks for the reply!

I am unable to create the context on target in order to be run with qnn-net-run as you've mentioned. Please check the output error in my previous comment. 

And on host this shouldn't be possible since we have different arch. 

Thank you!

Andrei

  • Up0
  • Down0
ruzhongl
Join Date: 7 Jun 21
Posts: 42
Posted: Mon, 2023-04-17 05:04

host  use htp simulator which is same as real device, this is why you can generate context with host htp and run the context in real device.

This is QNN-HTP design to help customer simulate real device behevior without hardware.

 

B.t.w, plese rase QNN issue via creatpoint. QNN is out of QDN scrope and I will not reply any issues about QNN.

 

 

  • Up0
  • Down0
andrei.iancu
Join Date: 9 Jun 22
Posts: 4
Posted: Tue, 2023-04-18 00:59

Ok, I will try to create the context on host like you've said.
If any other issues will come I will go to CreatePoint instead.

Many thanks!

 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.