Forums - DSP runtime error

7 posts / 0 new
Last post
DSP runtime error
andy.yc_chen
Join Date: 10 Jun 19
Posts: 7
Posted: Wed, 2019-11-13 01:18

Hi,i am tring to run model with SNPE-1.31.0522 on HTC U12+ which is S845 Adreno 630.

It's fine to run with cpu and gpu,but got error message as follows when running with dsp.

[The selected runtime is not available on this platform. Continue anyway to observe the failure at network creation time.

error_code=500; error_message=Target runtime is not available. No viable runtimes available.; error_component=Host Runtime; line_no=236; thread_id=-257788760]

 

I followed guideline from https://developer.qualcomm.com/docs/snpe/tutorial_inceptionv3.html.

The commands i ran as follows:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/snpe_1.31_Example/arm-android-clang6.0/lib
export PATH=$PATH:/data/local/tmp/snpe_1.31_Example/arm-android-clang6.0/bin
export ADSP_LIBRARY_PATH="/data/local/tmp/snpe_1.31_Example/dsp/lib;/system/lib/rfsa/adsp;/system/vendor/lib/rfsa/adsp;/dsp"
 
Digging into adb logcat I get the following error messages:
V snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1244: /dsp/fastrpc_shell_3 load failed 45, searching...
V snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1352: create user pd with attributes 0 domain 3
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1394: Error ffffffff: apps_dev_init failed. domain 3, errno Operation not permitted
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1478: Error ffffffff: open dev -1 for domain 3 failed
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:913: Error 3b: remote handle64 open failed. name file:///libsnpe_dsp_v65_domains_v2_skel.so?snpe_dsp_domains_v2_skel_handle_invoke&_modver=1.0&_dom=cdsp
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:513: Error 1d: verify local handle failed. handle 0xff8f1250
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:528: Error 1d: get domain from handle failed. handle 0xff8f1278
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:834: Error 1d: remote handle64 invoke failed. domain -372027712, handle 0xff8f12b8, sc 7000100, pra 0xff8f12e8
V snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1244: /dsp/fastrpc_shell_3 load failed 45, searching...
V snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1352: create user pd with attributes 0 domain 3
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1394: Error ffffffff: apps_dev_init failed. domain 3, errno Operation not permitted
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1478: Error ffffffff: open dev -1 for domain 3 failed
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:913: Error 3b: remote handle64 open failed. name file:///libsnpe_dsp_v65_domains_v2_skel.so?snpe_dsp_domains_v2_skel_handle_invoke&_modver=1.0&_dom=cdsp
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:513: Error 1d: verify local handle failed. handle 0xff8f1250
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:528: Error 1d: get domain from handle failed. handle 0xff8f1278
D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:834: Error 1d: remote handle64 invoke failed. domain -357957360, handle 0xff8f12b8, sc 7000100, pra 0xff8f12e8
E memtrack: Couldn't load memtrack module
W android.os.Debug: failed to get memory consumption info: -1
D CameraBackgroundService: Memory usage, Pss = 48477 KB / 524288 KB
D STT:lognet: in autoclear thread. 
D STT:lognet: total size = 0 bytes
 
Also,I checked these things:
1./dev/adsprpc-smd exists

2.ps | grep adsprpcd : Nothing output

3.logcat -s adsrpc outputs:

--------- beginning of  crash

--------- beginning of system

--------- beginning of main

4.The 4 part of ADSP_LIBRARY_PATH exists
5.The dsp libs in /data/local/tmp/snpe_1.31_Example/dsp/lib : 
libcalculator_domains_skel.so,
libcalculator_skel.so,
libsnpe_dsp_domains_skel.so,
libsnpe_dsp_skel.so,
libsnpe_dsp_v65_domains_v2_skel.so,
libsnpe_dsp_v66_domains_v2_skel.so
 

Does anyone have idea for this error?

  • Up0
  • Down0
zhaoyangstar
Join Date: 14 Apr 19
Posts: 23
Posted: Thu, 2019-11-14 18:57

From your logcat "D snpe-net-run: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:1394: Error ffffffff: apps_dev_init failed. domain 3, errno Operation not permitted" I guess maybe cdsp is not permitted. This error has nothing with your code.

  • Up0
  • Down0
andy.yc_chen
Join Date: 10 Jun 19
Posts: 7
Posted: Sun, 2019-11-17 18:24

Thanks for your reply.

I saw the error related message from  fastrpc guide file.( Page 27)

https://usermanual.wiki/Pdf/80N70392FASTRPCDEBUGGUIDE.399075392/view

The guide file pointed out this error occurs because the GLINK/SMD channel was not opened for the channel (aDSP/cDSP/mDSP). Check whether the DSP is up and running without any issues.

But I still don't know how to deal with it.

Any suggestions would be greatly appreciated.

  • Up0
  • Down0
zhaoyangstar
Join Date: 14 Apr 19
Posts: 23
Posted: Mon, 2019-11-18 05:15

According to the SDK, starting in the SM8150 family, clients can request to offload signature-free dynamic shared objects to cDSP.

You need to do some code changed in order to  request signature-free dynamic module offload.

Do your phone has benn rooted? Do you create a signature or make signature-free operations ?

  • Up0
  • Down0
andy.yc_chen
Join Date: 10 Jun 19
Posts: 7
Posted: Mon, 2019-11-18 17:54

My phone (HTC U12 ) is development device , and the device state is unlocked.

Also, i checked the OEM and bootloader were unlocked.

Could you tell me more about signature-free dynamic module offload??

I just follow the guide from SNPE, and i did't see operations relatd with signature.

Another question is whether it is feasible to offload the CPU to the DSP if the DSP is not up. ?

  • Up0
  • Down0
zhaoyangstar
Join Date: 14 Apr 19
Posts: 23
Posted: Tue, 2019-11-19 04:26

I think you already have a Hexagon SDK. You can refer to $HEXAGON_ROOT/docs/Tools_Signing.html for more info about signature-free offload.

1. make to create stub for host

2. change stub.c (take sdk calculator for exeampe)

__QAIC_STUB_EXPORT int __QAIC_STUB(calculator_sum)(const int* vec, int vecLen, int64* res) __QAIC_STUB_ATTRIBUTE {
uint32_t _mid = 0;
// add begin
#pragma weak remote_session_control
if (remote_session_control)
{
struct remote_rpc_control_unsigned_module data;
data.enable = 1;
data.domain = CDSP_DOMAIN_ID;
remote_session_control(DSPRPC_CONTROL_UNSIGNED_MODULE, (void*)&data, sizeof(data));
}
// add end
return _stub_method(_calculator_handle(), _mid, (char**)&vec, (uint32_t*)&vecLen, (uint64_t*)res);
}

 

3. make again to update host libs and executable

You can have a try.

  • Up0
  • Down0
andy.yc_chen
Join Date: 10 Jun 19
Posts: 7
Posted: Wed, 2019-11-20 01:52
This is a good suggestion, thank you very much.
 
I will try the Hexagon SDK to see if it could solve this problem, especially the situation that DSP may not up.
 
  • 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.