Forums - Snapdragon 820 DSP Runtime Unavailable

12 posts / 0 new
Last post
Snapdragon 820 DSP Runtime Unavailable
ian.wilmoth
Join Date: 2 Jun 17
Posts: 5
Posted: Wed, 2017-08-09 10:56

Hi,

     I am trying to get the DSP runtime working on the Snapdragon 820 (using an Inforce 6601 Development Kit) under Android 7.1.1. The CPU and GPU runtimes work fine, but the SNPE C++ API reports that the DSP runtime is unavailable. I am using Android Studio 2.3.3 on Windows 7 x64, and I have included libsnpe_adsp.so in my project's jniLibs folder.

When calling zdl::SNPE::SNPEFactory::isRuntimeAvailable(zdl::DlSystem::Runtime_t::DSP), I get these error messages in logcat:

E/adsprpc: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:688::error: -1: 0 == ioctl(dev, FASTRPC_IOCTL_INIT, (unsigned long)&init)
E/adsprpc: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:764::error: -1: !apps_dev_init(domain)
E/adsprpc: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:431::error: -1: -1 != open_dev(domain)
E/adsprpc: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:688::error: -1: 0 == ioctl(dev, FASTRPC_IOCTL_INIT, (unsigned long)&init)
E/adsprpc: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:764::error: -1: !apps_dev_init(domain)
E/adsprpc: vendor/qcom/proprietary/adsprpc/src/fastrpc_apps_user.c:329::error: -1: -1 != (dev = open_dev(domain))
 

I don't see anything mentioned in the SNPE documentation about extra steps, am I missing something?

Thanks,

Ian

 

  • Up0
  • Down0
oferr Moderator
Profile picture
Join Date: 26 Jul 17
Location: San Diego
Posts: 22
Posted: Wed, 2017-08-09 18:09

Hi Ian,

Thank you for your interest in Snapdragon NPE.

Have you tried following the Tutorial on Inception v3 as provided in the documentation ? (Example Tutorials -> Running Nets -> TensorFlow Inception v3). If not, can you try running it and tell us if it works ?

Thanks,

Ofer.

  • Up0
  • Down0
ian.wilmoth
Join Date: 2 Jun 17
Posts: 5
Posted: Thu, 2017-08-10 07:53

     Thank you for the suggestion. I just ran the example on my device; the CPU and GPU runtimes work as expected, but the DSP runtime still isn't available. The snpe-net-run executable gave me these errors when I launched it with --use_dsp:

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

error_code=101; error_message=Invalid parameter in user config. Attempted to set a neural network configuration option DSP that is not supported on this platform.; error_component=System Configuration; line_no=86; thread_id=-300346060

Also, I opened up logcat and got the same errors from adsprpc that I mentioned in my original post.

Thanks,

Ian

  • Up0
  • Down0
oferr Moderator
Profile picture
Join Date: 26 Jul 17
Location: San Diego
Posts: 22
Posted: Fri, 2017-08-11 13:55

Thanks for checking.

Let's see if FastRPC is working correctly on your platform. Some OEMs disable the FastRPC, and in that case the DSP cannot be accessed by SNPE.

Please do the following steps :

1. Check if the adsprpc.kodriver is running

adb shell ls /dev/adsprpc-smd

If the module is not found and /dev/adsprpc-smd is not present, this device does not support FastRPC

 

2. Check if adsprpcdis running

ps | grep adsprpcd denotes adsprpc daemon is running

media 521 1 17260 1440 ffffffff 96b92ae0 S /system/bin/adsprpcd

If running and logcat -s adsprpc does not display any errors, FastRPC is enabled and operational

  • Up0
  • Down0
ian.wilmoth
Join Date: 2 Jun 17
Posts: 5
Posted: Mon, 2017-08-14 10:31

I checked on those items:

/dev/adsprpc-smd exists

ps | grep adsprpcd outputs:

media     707   1     12284  1512  poll_sched 0000000000 S /system/bin/adsprpcd

logcat -s adsrpc outputs:

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

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

 

I get the errors from adsprpc I mentioned in my first post whenever I check on the availability of the DSP runtime. I also noticed this info in logcat:

I/iop: type=1400 audit(0.0:33): avc: denied { read } for name="fastrpc_shell_0" dev="sde12" ino=26 scontext=u:r:dumpstate:s0 tcontext=u:object_r:adsprpcd_file:s0 tclass=file permissive=1
I/iop: type=1400 audit(0.0:34): avc: denied { open } for path="/dsp/fastrpc_shell_0" dev="sde12" ino=26 scontext=u:r:dumpstate:s0 tcontext=u:object_r:adsprpcd_file:s0 tclass=file permissive=1
I/iop: type=1400 audit(0.0:35): avc: denied { getattr } for path="/dsp/fastrpc_shell_0" dev="sde12" ino=26 scontext=u:r:dumpstate:s0 tcontext=u:object_r:adsprpcd_file:s0 tclass=file permissive=1
 

 

It seems like FastRPC is supported, but not working correctly.

  • Up0
  • Down0
oferr Moderator
Profile picture
Join Date: 26 Jul 17
Location: San Diego
Posts: 22
Posted: Mon, 2017-08-14 23:17

Thanks Ian.

Let's continue to focus on making the snpe-net-run work properly.

Just to validate, have you followed the SNPE setup sections, including the one under Examples -> Code Examples -> DSP Runtime ? Just want to make sure all environment variables are set correctly (especially ADSP_LIBRARY_PATH).

Can you provide a list of commands that you're running ? the ADB push , export on the device, etc.

Thanks,

Ofer

  • Up0
  • Down0
ian.wilmoth
Join Date: 2 Jun 17
Posts: 5
Posted: Tue, 2017-08-15 09:53

I followed the SNPE setup instructions (all Ubuntu environmental variables were set up with bin/envsetup.sh, including the path to TensorFlow).

The commands I ran in order to set up and run the Inception v3 example on my device are as follows (these include DSP runtime setup):

adb shell "mkdir -p /data/local/tmp/snpeexample/arm-android-gcc4.9/bin"
adb shell "mkdir -p /data/local/tmp/snpeexample/arm-android-gcc4.9/lib"
adb shell "mkdir -p /data/local/tmp/snpeexample/dsp/lib"
 
adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libgnustl_shared.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
adb push $SNPE_ROOT/lib/dsp/libsnpe_dsp_skel.so /data/local/tmp/snpeexample/dsp/lib
adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libsnpe_adsp.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libsnpe_cdsp.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libSNPE.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
adb push $SNPE_ROOT/bin/arm-android-gcc4.9/snpe-net-run /data/local/tmp/snpeexample/arm-android-gcc4.9/bin
 
cd $SNPE_ROOT/models/inception_v3
adb shell "mkdir -p /data/local/tmp/inception_v3"
adb push data/cropped /data/local/tmp/inception_v3/cropped
adb push data/target_raw_list.txt /data/local/tmp/inception_v3
adb push dlc/inception_v3_quantized.dlc /data/local/tmp/inception_v3
 
adb shell
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/snpeexample/arm-android-gcc4.9/lib
export PATH=$PATH:/data/local/tmp/snpeexample/arm-android-gcc4.9/bin
export ADSP_LIBRARY_PATH="/data/local/tmp/snpeexample/dsp/lib;/system/lib/rfsa/adsp;/system/vendor/lib/rfsa/adsp;/dsp"
cd /data/local/tmp/inception_v3
snpe-net-run --container inception_v3_quantized.dlc --input_list target_raw_list.txt --use_dsp

 

  • Up0
  • Down0
shiangyong
Join Date: 21 Sep 17
Posts: 15
Posted: Fri, 2017-10-13 13:16

I'm also facing a similar issue with DSP so I thought I'd post it here.

I'm using the Inforce 6640 board that also contains the SD820 chip, also installed Android 7.1.1. I'm using SNPE version 1.6.0

I did the list of adb pushes followiong the docs. Also verified that adsprpcd is present and running.

 

This is my command line (within adb shell):

snpe-net-run --container inception_v3_quantized.dlc --input_list target_raw_list.txt --use_dsp

 

and here is the error:

WARNING: linker: Warning: unable to normalize ""
The selected runtime is not available on this platform. Continue anyway to observe the failure at network creation time.
error_code=101; error_message=Invalid parameter in user config. Attempted to set a neural network configuration option DSP that is not supported on this platform.; error_component=System Configuration; line_no=106; thread_id=-248322764

 

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Mon, 2017-10-16 05:19

@shiangyong

When running snpe-net-run via adb shell, please ensure you followed the instructions for setting ADSP_LIBRARY_PATH after you shell in.  The user's guide describes how to set the ADSP_LIBRARY_PATH. 

Please post the exact command sequence that you are using in the adb shell.

Also, if you have access to QXDM or to mini-dm (from the hexagon SDK) we can collect some DSP logs.  Do you have access to either of those?  (These won't work on commercial devices but you are using a dev board so they might work.)

 

  • Up0
  • Down0
shiangyong
Join Date: 21 Sep 17
Posts: 15
Posted: Mon, 2017-10-16 15:41

Yes I followed the SNPE tutorial line-by-line, including that ADSP_LIBRARY_PATH line.

Will try to install the Hexagon SDK so I can view the logs.

  • Up0
  • Down0
michelle.legrand
Join Date: 16 Feb 17
Posts: 1
Posted: Thu, 2017-10-26 06:58

I also had the same problem as Ian on a Snapdragon 820, here is what I did to solve it.

I noticed that in ADSP_LIBRARY_PATH, I didn’t have the /system/lib/rfsa/adsp directory, so I downloaded the Hexagon SDK to generate the testsig library.

Here’s how to do it :

  1. adb root

  2. adb shell cat /sys/devices/soc0/serial_number

  3. Convert the decimal number you get as output to hex

  4. python ${QUALCOMM_SDK}/tools/elfsigner/elfsigner.py -t $(SERIAL_NUMBER_HEX_VALUE)

  5. adb remount

  6. adb shell mkdir -p /system/lib/rfsa/adsp

  7. adb push
    ${QUALCOMM_SDK}/output/testsig-$(SERIAL_NUMBER_HEX_VALUE).so /system/lib/rfsa/adsp/

  8. adb reboot

This solved the problem for me, I hope it helps.

Michelle

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Thu, 2017-10-26 11:10

@michelle.legrand

The DSP runtime  that is shipped with SNPE is already signed.  You should not need a testsig for it to work (we test on many commercial devices without using testsig.)

Which Snapdragon 820 device are you using?  Is it a commercial device or a development board?

Since you have the Hexagon SDK, then perhaps we can debug your issue using a tool in the Hexagon SDK called "mini-dm". If you are running on Ubuntu, you can use mini-dm.

 I'm wondering if you could try removing the testsig, and then run "mini-dm" from the hexagon SDK and trying SNPE again.    If you can get mini-dm logs and post them here, it could help us to understand why the DSP runtime isn't working on your device without a testsig.

mini-dm is in $HEXAGON_SDK_ROOT/tools/debug/mini-dm/Linux_Debug/

Thanks,

Jamie

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