Forums - DSP not Working on Android

9 posts / 0 new
Last post
DSP not Working on Android
aryannamazi.sobhan
Join Date: 4 Mar 21
Posts: 1
Posted: Tue, 2021-03-09 03:21

Hi,

I am trying to use the Android(Java) API to run dlc models. Unfortunately, I cannot get the model to run on DSP.

I have tested the snpe-platform-validator via adb and it runs fine. But when i use the snpe-release.aar file in my android project i can only run the model on CPU and GPU.  I am using gradle 6.5, android plugin 4.1.2 and Android Studio 4.1.2.

The initialization of the model on DSP gives the following log:

2021-03-09 13:21:33.067 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/rpcmem_android.c:158: rpcmem_init_internal: opened ION device fd 78, configured heap IDs: system (0x2000000), contig (0x400000), secure (0x200), secure flags (0x80080000)
2021-03-09 13:21:33.067 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:2758: fastrpc_apps_user_init done
2021-03-09 13:21:33.068 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:2355: Error 0xd: open_shell failed for domain 3 search paths used are /dsp/, /vendor/dsp/, /vendor/dsp/xdsp/
2021-03-09 13:21:33.068 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_config.c:133: Reading configuration file: com.sensifai.visiondemo.debugconfig
2021-03-09 13:21:33.060 23150-23150/com.sensifai.visiondemo W/ifai.visiondemo: type=1400 audit(0.0:3736429): avc: denied { read } for name="adsprpc-smd-secure" dev="tmpfs" ino=23031 scontext=u:r:untrusted_app_27:s0:c84,c257,c512,c768 tcontext=u:object_r:vendor_xdsp_device:s0 tclass=chr_file permissive=0
2021-03-09 13:21:33.060 23150-23150/com.sensifai.visiondemo W/ifai.visiondemo: type=1400 audit(0.0:3736430): avc: denied { search } for name="/" dev="sde30" ino=2 scontext=u:r:untrusted_app_27:s0:c84,c257,c512,c768 tcontext=u:object_r:adsprpcd_file:s0 tclass=dir permissive=0
2021-03-09 13:21:33.070 23150-23150/com.sensifai.visiondemo W/ifai.visiondemo: type=1400 audit(0.0:3736432): avc: denied { search } for name="/" dev="sde30" ino=2 scontext=u:r:untrusted_app_27:s0:c84,c257,c512,c768 tcontext=u:object_r:adsprpcd_file:s0 tclass=dir permissive=0
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:922:Error 0x2: fileExists failed for path /data/app/~~FC0uN9VwWH1TkMZhtC1slw==/com.sensifai.visiondemo-CXdBodI4ZCe-IiBK0IkWsw==/lib/arm64/com.sensifai.visiondemo.debugconfig
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_config.c:57::error: 2: AEE_SUCCESS == (nErr = apps_std_fileExists(path, &fileExists))
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_config.c:105: Error 2: failed for /data/app/~~FC0uN9VwWH1TkMZhtC1slw==/com.sensifai.visiondemo-CXdBodI4ZCe-IiBK0IkWsw==/lib/arm64/com.sensifai.visiondemo.debugconfig with errno(No such file or directory)
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:922:Error 0x2: fileExists failed for path /system/vendor/lib/rfsa/adsp/com.sensifai.visiondemo.debugconfig
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_config.c:57::error: 2: AEE_SUCCESS == (nErr = apps_std_fileExists(path, &fileExists))
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_config.c:105: Error 2: failed for /system/vendor/lib/rfsa/adsp/com.sensifai.visiondemo.debugconfig with errno(No such file or directory)
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:922:Error 0x2: fileExists failed for path /vendor/lib/rfsa/adsp/com.sensifai.visiondemo.debugconfig
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_config.c:57::error: 2: AEE_SUCCESS == (nErr = apps_std_fileExists(path, &fileExists))
2021-03-09 13:21:33.074 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_config.c:105: Error 2: failed for /vendor/lib/rfsa/adsp/com.sensifai.visiondemo.debugconfig with errno(No such file or directory)
2021-03-09 13:21:33.146 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:2526: Successfully created user PD on domain 3 (attrs 0x0, debug_trace 0x0)
2021-03-09 13:21:33.147 23150-23150/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_perf.c:239: fastrpc_perf_init: enabled RPC traces (kernel 0, dsp 0) with frequency 1000
2021-03-09 13:21:33.147 23150-23321/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/log_config.c:339: file_watcher_thread starting for domain 3
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:922:Error 0x2: fileExists failed for path /data/app/~~FC0uN9VwWH1TkMZhtC1slw==/com.sensifai.visiondemo-CXdBodI4ZCe-IiBK0IkWsw==/lib/arm64/com.sensifai.visiondemo.farf
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/log_config.c:168::error: 2: AEE_SUCCESS == (nErr = apps_std_fileExists(path,&fileExists))
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/log_config.c:262:Error 2: fopen failed for /data/app/~~FC0uN9VwWH1TkMZhtC1slw==/com.sensifai.visiondemo-CXdBodI4ZCe-IiBK0IkWsw==/lib/arm64/com.sensifai.visiondemo.farf. (No such file or directory)
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:922:Error 0x2: fileExists failed for path /system/vendor/lib/rfsa/adsp/com.sensifai.visiondemo.farf
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/log_config.c:168::error: 2: AEE_SUCCESS == (nErr = apps_std_fileExists(path,&fileExists))
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/log_config.c:262:Error 2: fopen failed for /system/vendor/lib/rfsa/adsp/com.sensifai.visiondemo.farf. (No such file or directory)
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:922:Error 0x2: fileExists failed for path /vendor/lib/rfsa/adsp/com.sensifai.visiondemo.farf
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/log_config.c:168::error: 2: AEE_SUCCESS == (nErr = apps_std_fileExists(path,&fileExists))
2021-03-09 13:21:33.148 23150-23321/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/log_config.c:262:Error 2: fopen failed for /vendor/lib/rfsa/adsp/com.sensifai.visiondemo.farf. (No such file or directory)
2021-03-09 13:21:33.149 23150-23320/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/listener_android.c:119: listener thread starting
2021-03-09 13:21:33.152 23150-23320/com.sensifai.visiondemo I/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/mod_table.c:680: open_mod_table_open_from_static: reverse module apps_std opened with handle 0xe32828f8 (idx 0)
2021-03-09 13:21:33.153 23150-23320/com.sensifai.visiondemo W/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:805: Warning: apps_std_fopen_with_env failed with 0x2 for libsnpe_dsp_v66_domains_v2_skel.so (No such file or directory)
2021-03-09 13:21:33.154 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1166: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for file:///libsnpe_dsp_v66_domains_v2_skel.so?snpe_dsp_domains_v2_skel_handle_invoke&_modver=1.0&_dom=cdsp on domain 3 (dlerror cannot open libsnpe_dsp_v66_domains_v2_skel.so)
2021-03-09 13:21:33.154 23150-23150/com.sensifai.visiondemo W/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1417:Warning 0xe: remote_get_info failed to get attribute 257 for domain 3 (errno Success)
2021-03-09 13:21:33.154 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1207: Error 0x80000406: remote_handle64_open failed for file:///libsnpe_dsp_v66_domains_v2_skel.so?snpe_dsp_domains_v2_skel_handle_invoke&_modver=1.0&_dom=cdsp
2021-03-09 13:21:33.154 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:439: Error 0x2c: verify_local_handle failed. handle 0x0
2021-03-09 13:21:33.155 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:454: Error 0x2c: get_domain_from_handle failed. handle 0x0
2021-03-09 13:21:33.155 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1075: Error 0x2c: remote_handle64_invoke failed for handle 0x0, method 7 on domain 3 (sc 0x7000100)
2021-03-09 13:21:33.157 23150-23320/com.sensifai.visiondemo W/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/apps_std_imp.c:805: Warning: apps_std_fopen_with_env failed with 0x2 for libsnpe_dsp_v66_domains_v2_skel.so (No such file or directory)
2021-03-09 13:21:33.159 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1166: Error 0x80000406: remote_handle_open_domain: dynamic loading failed for file:///libsnpe_dsp_v66_domains_v2_skel.so?snpe_dsp_domains_v2_skel_handle_invoke&_modver=1.0&_dom=cdsp on domain 3 (dlerror cannot open libsnpe_dsp_v66_domains_v2_skel.so)
2021-03-09 13:21:33.159 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1207: Error 0x80000406: remote_handle64_open failed for file:///libsnpe_dsp_v66_domains_v2_skel.so?snpe_dsp_domains_v2_skel_handle_invoke&_modver=1.0&_dom=cdsp
2021-03-09 13:21:33.159 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:439: Error 0x2c: verify_local_handle failed. handle 0x0
2021-03-09 13:21:33.159 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:454: Error 0x2c: get_domain_from_handle failed. handle 0x0
2021-03-09 13:21:33.159 23150-23150/com.sensifai.visiondemo E/com.sensifai.visiondemo: vendor/qcom/proprietary/commonsys-intf/adsprpc/src/fastrpc_apps_user.c:1075: Error 0x2c: remote_handle64_invoke failed for handle 0x0, method 7 on domain 3 (sc 0x7000100)
2021-03-09 13:21:33.159 23150-23150/com.sensifai.visiondemo E/Processor: None of the selected runtime targets are supported.

  • Up0
  • Down0
a.larionov
Join Date: 2 Jul 21
Posts: 1
Posted: Fri, 2021-10-01 02:38

I'm having the same issue with Snapdragon phones I have.

Is there any way to solve it?

  • Up0
  • Down0
eedoza
Join Date: 20 Sep 21
Posts: 2
Posted: Fri, 2021-10-29 03:32

I believe I'm having the same issue, waiting for a solution.

https://developer.qualcomm.com/forum/qdn-forums/software/qualcomm-neural...

  • Up0
  • Down0
leaf-yej
Join Date: 10 Mar 22
Posts: 3
Posted: Wed, 2022-03-30 19:10

+1. In my case, the inception_v3 example android app can't find dsp or aip runtime.  However, dsp runtime works fine when running models through adb. I have set the spne-release.aar in app/libs. Anyone know why?

  • Up0
  • Down0
isak.mottelson
Join Date: 4 Apr 22
Posts: 1
Posted: Tue, 2022-04-19 01:29

+1. Same problem as above: DSP works fine when using adb and snpe-net-run, but android app cannot use it. Android app can run inference on CPU with no problem. Did anyone make any progress with this?

  • Up0
  • Down0
bernicerossen
Join Date: 27 Apr 22
Posts: 10
Posted: Wed, 2022-04-27 10:40

its not working for iOS as well. 

  • Up0
  • Down0
andrii.tsarov
Join Date: 30 Jun 21
Posts: 4
Posted: Fri, 2022-04-29 10:25

For me adding following parameters fixed the issue

  1. AndroidManifest
android:extractNativeLibs="true"
  1. build.gradle
android {
    packagingOptions {
        pickFirst 'lib/x86/libc++_shared.so'
        pickFirst 'lib/x86_64/libc++_shared.so'
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
        pickFirst 'lib/arm64-v8a/libc++_shared.so'
        doNotStrip "*/armeabi-v7a/libsnpe_*.so"
        doNotStrip "*/arm64-v8a/libsnpe_*.so"
    }

 

If you have rooted device also try

adb shell

setenforce 0

It might also help

 

  • Up0
  • Down0
windnoise
Join Date: 27 Jun 22
Posts: 1
Posted: Mon, 2022-08-29 00:28

Thanks a lot! Works for me!

But why?

  • Up0
  • Down0
byunghwy.choi
Join Date: 20 Aug 21
Posts: 4
Posted: Sun, 2022-09-25 22:25

This works for me too!

 

I'm currently using QCS 605.

For me, the DSP worked only in certain version of gradle which was 6.7.1 for gradle and 3.6.0 for gradle plugin.

But I had to change my gradle plugin version into 4.2.0 because I had merge my project with other projects and they were using 4.2.0.

The DSP did not work in 4.2.0 and I didn't know what to do, but after I added these packing options(especially doNotStrip), it works in most of the gradle plugin version.

 

It really helped me. Thank you so much.

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