Forums - SNPE build in app failed with newer SNPE (at least ver. 1.62~1.68)

4 posts / 0 new
Last post
SNPE build in app failed with newer SNPE (at least ver. 1.62~1.68)
masakazu.yoshimura
Join Date: 13 Oct 22
Posts: 4
Posted: Wed, 2022-12-07 02:46

I tried to implement Java application internally usning native c++ SNPE with JNI.

snpe = snpeBuilder.setOutputLayers(outputNames)
        .setRuntimeProcessorOrder(runtimeList)
        .setUseUserSuppliedBuffers(useUserSuppliedBuffers)
        .setPlatformConfig(platformConfig)
        .setInitCacheMode(useCaching)
        .build();

However, the above build function returns nullptr regardless of any runtimes (CPU, GPU).

The error code generated with zdl::DlSystem::getLastErrorString() is as follows.

error:error_code=1200; error_message=libstd error. error_code=1200; error_message=libstd error. QnnBackend_initialize failed: 1006; error_component=Dependent library; line_no=646; thread_id=485820816560; error_component=Dependent library; line_no=342; thread_id=501993092344

 

I checked my dlc file has no problem. I successfuly ran the dlc using command line execution with adb shell.

Also, If I used older SNPE (ver.=1.15.0) with older smartphone, the dlc successfully ran on my  Java application.

So my compile script seems no problem at least for older SNPE.

 

I have to use SNPE>=1.62, because I want to use 8 Gen 1 Snapdragon.

 

I suspect the problem is around  the newly added  libc++_shared.so.

In command line execution, setting LD_LIBRARY_PATH to libc++_shared.so is needed, but I don't know collect way in app.

Any suggestion...?

  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sat, 2022-12-10 23:41

Dear developer,

You can take a look at below instructions,

1 Add enable_htp to snpe-dlc-quantize flow

2 unsingedPD:OFF is required for SNPE 1.6x or later.

BR.

Wei

  • Up0
  • Down0
masakazu.yoshimura
Join Date: 13 Oct 22
Posts: 4
Posted: Tue, 2022-12-13 06:28

 

Thank you for reply.

1. The model is not quantized.

2. I set unsignedPD as follows. 

zdl::DlSystem::PlatformConfig platformConfig;
bool is_platform_opt_set;
is_platform_opt_set = platformConfig.setPlatformOptions("unsignedPD:OFF");
snpe = snpeBuilder.setOutputLayers(outputNames)
 
        .setRuntimeProcessorOrder(runtimeList)
        .setUseUserSuppliedBuffers(useUserSuppliedBuffers)
        .setPlatformConfig(platformConfig)
        .setInitCacheMode(useCaching)
        .build();

But different errors came up...

*If CPU runtime:

snpeBuilder error:error_code=1200; error_message=libstd error. error_code=1200; error_message=libstd error. QnnBackend_initialize failed: 1006; error_component=Dependent library; line_no=646; thread_id=485682465968; error_component=Dependent library; line_no=342; thread_id=501993092344

*If GPU runtime:

snpeBuilder error:error_code=1006; error_message=Invalid constraint. error_code=1006; error_message=Invalid constraint. No GPU device available for target UNKNOWN_SDM; error_component=Model Validation; line_no=77; thread_id=487564496048; error_component=Model Validation; line_no=342; thread_id=501993092344

What is wrong...?

  • Up0
  • Down0
masakazu.yoshimura
Join Date: 13 Oct 22
Posts: 4
Posted: Wed, 2022-12-14 02:40

 

[Additional information of the state]

My app can run with SNPE 1.65 if it is on Snapdragon 865 after setting unsignedPD:OFF.

However, It can't run on Snapdragon 888 and 8 Gen 1.

  • 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.