Forums - Cannot run Inception tutorial on DSP

14 posts / 0 new
Last post
Cannot run Inception tutorial on DSP
mpeniak
Profile picture
Join Date: 28 Apr 17
Location: London
Posts: 6
Posted: Wed, 2017-11-01 09:55
Hi,
 
I am following this tutorial and trying to test it on Pixel XL.
 
snpe-1.6.0/doc/html/tutorial_inceptionv3.html
 
Everything goes fine until I try to use the DSP in which case I get the following:
 
marlin:/data/local/tmp/inception_v3 $ snpe-net-run --container inception_v3_quantized.dlc --input_list target_raw_list.txt --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=106; thread_id=-409090904
 
No idea what's wrong or what to do? Do you guys have any tips? I suppose that Pixel XL's DSP must be supported.

Thanks,
Martin Peniak
  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Wed, 2017-11-01 10:22

In our experience, Pixel devices have not been able to run the DSP runtime.  We have heard that there are DSP access limitations built into the Pixel, that restrict what applications are allowed to use DSP.  

Unfortunately, this means that SNPE DSP runtime will not work on Pixel devices.

 

  • Up0
  • Down0
mpeniak
Profile picture
Join Date: 28 Apr 17
Location: London
Posts: 6
Posted: Thu, 2017-11-02 02:15

I see, well...thank you for your reply... at least I know I was not doing anything wrong.

  • Up0
  • Down0
yanbophx
Join Date: 16 Oct 17
Posts: 17
Posted: Fri, 2017-11-17 23:28

I encountered the same problem when running inception model on DSP on a S820am ADP development board, and the same problem occurs as well.

Would you please confirm that SNPE DSP will not work on this device as well?

Best regards,

 

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Mon, 2017-11-20 04:45

@yanbophx

Snapdragon 820 should support the DSP runtime.  Can you provide the commands you are running and the error message you are getting?  Logcat would be helpful too.

Also, make sure that /system/lib contains libadsprpc.so.  Also, please list the contents of the following directories:

/system/lib/rfsa/adsp

/system/vendor/lib/rfsa/adsp

 

  • Up0
  • Down0
yanbophx
Join Date: 16 Oct 17
Posts: 17
Posted: Mon, 2017-11-20 05:24

HI jesliger,

Thanks for your reply. I cannot find libadsprpc.so in /system/lib/; also, I don't seem to have the folder rfsa under /system/lib/, let alone adsp,  see below:

root@msm8996:/system/lib # cd rfsa
/system/bin/sh: cd: /system/lib/rfsa: No such file or directory

The contents for /system/vendor/lib/rfsa/adsp are:

root@msm8996:/system/vendor/lib/rfsa/adsp # ls
icc_module.so.1.so
libdspCV_skel.so
libfastcvadsp.so
libfastcvadsp_skel.so
libobjectMattingApp_skel.so
libscveBlobDescriptor_skel.so
libscveCleverCapture_skel.so
libscveObjectSegmentation_skel.so
libscveT2T_skel.so
libscveTextReco_skel.so
libvpp_frc.so
libvpp_svc_skel.so
sec_module.so.1.so
us-syncproximity.so

 

Please check below for all the commands and messages when implmenting this turorial on DSP:

yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ source bin/envsetup.sh -t $TENSORFLOW_DIR
INFO: Setting TENSORFLOW_HOME=/usr/local/lib/python2.7/dist-packages/tensorflow
INFO: Found ANDROID_NDK_ROOT at /home/yihangrd/Android/Sdk/ndk-bundle/
INFO: Found /home/yihangrd/snpe-1.6.0/lib/arm-android-gcc4.9/libgnustl_shared.so
INFO: Adding libgnustl_shared.so to /home/yihangrd/snpe-1.6.0/android/snpe-release.aar
updating: jni/armeabi-v7a/libgnustl_shared.so (deflated 66%)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb shell "mkdir -p /data/local/tmp/snpeexample/arm-android-gcc4.9/bin"
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb shell "mkdir -p /data/local/tmp/snpeexample/arm-android-gcc4.9/lib"
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb shell "mkdir -p /data/local/tmp/snpeexample/dsp/lib"
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libgnustl_shared.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
2171 KB/s (5665180 bytes in 2.547s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb push $SNPE_ROOT/lib/dsp/libsnpe_dsp_skel.so /data/local/tmp/snpeexample/dsp/lib
2183 KB/s (363808 bytes in 0.162s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libsnpe_adsp.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
221 KB/s (11984 bytes in 0.052s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libsnpe_cdsp.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
225 KB/s (11984 bytes in 0.051s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb push $SNPE_ROOT/lib/arm-android-gcc4.9/libSNPE.so /data/local/tmp/snpeexample/arm-android-gcc4.9/lib
2312 KB/s (3483292 bytes in 1.470s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb push $SNPE_ROOT/bin/arm-android-gcc4.9/snpe-net-run /data/local/tmp/snpeexample/arm-android-gcc4.9/bin
1580 KB/s (58972 bytes in 0.036s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ adb shell
Y_PATH:/data/local/tmp/snpeexample/arm-android-gcc4.9/lib                     <
ATH=$PATH:/data/local/tmp/snpeexample/arm-android-gcc4.9/bin                  <
root@msm8996:/ # snpe-net-run -h

DESCRIPTION:
------------
Example application demonstrating how to load and execute a neural network
using the SNPE C++ API.


REQUIRED ARGUMENTS:
-------------------
  --container  <FILE>   Path to the DL container containing the network.
  --input_list <FILE>   Path to a file listing the inputs for the network.


OPTIONAL ARGUMENTS:
-------------------
  --use_gpu             Use the GPU runtime for SNPE.
  --use_dsp             Use the DSP fixed point runtime for SNPE.
  --debug               Specifies that output from all layers of the network
                        will be saved.
  --output_dir <DIR>    The directory to save output to. Defaults to ./output
  --storage_dir <DIR>   The directory to store SNPE metadata files
  --encoding_type <VAL> Specifies the encoding type of input file. Valid settings are "nv21".
                        Cannot be combined with --userbuffer*.
  --userbuffer_float    [EXPERIMENTAL] Specifies to use userbuffer for inference, and the input type is float.
                        Cannot be combined with --encoding_type.
  --userbuffer_tf8      [EXPERIMENTAL] Specifies to use userbuffer for inference, and the input type is tf8exact0.
                        Cannot be combined with --encoding_type.
  --perf_profile <VAL>  Specifies perf profile to set. Valid settings are "default" , "high_performance" and "power_saver".
  --enable_cpu_fallback Enables cpu fallback functionality. Defaults to disable mode.
  --help                Show this help message.
  --version             Show SNPE Version Number.

root@msm8996:/ # exit
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0$ cd $SNPE_ROOT/models/inception_v3
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0/models/inception_v3$ adb shell "mkdir -p /data/local/tmp/inception_v3"
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0/models/inception_v3$ adb push data/cropped /data/local/tmp/inception_v3/cropped
push: data/cropped/chairs.raw -> /data/local/tmp/inception_v3/cropped/chairs.raw
push: data/cropped/handicap_sign.raw -> /data/local/tmp/inception_v3/cropped/handicap_sign.raw
push: data/cropped/plastic_cup.jpg -> /data/local/tmp/inception_v3/cropped/plastic_cup.jpg
push: data/cropped/17010030.raw -> /data/local/tmp/inception_v3/cropped/17010030.raw
push: data/cropped/chairs.jpg -> /data/local/tmp/inception_v3/cropped/chairs.jpg
push: data/cropped/notice_sign.raw -> /data/local/tmp/inception_v3/cropped/notice_sign.raw
push: data/cropped/trash_bin.jpg -> /data/local/tmp/inception_v3/cropped/trash_bin.jpg
push: data/cropped/raw_list.txt -> /data/local/tmp/inception_v3/cropped/raw_list.txt
push: data/cropped/plastic_cup.raw -> /data/local/tmp/inception_v3/cropped/plastic_cup.raw
push: data/cropped/notice_sign.jpg -> /data/local/tmp/inception_v3/cropped/notice_sign.jpg
push: data/cropped/handicap_sign.jpg -> /data/local/tmp/inception_v3/cropped/handicap_sign.jpg
push: data/cropped/trash_bin.raw -> /data/local/tmp/inception_v3/cropped/trash_bin.raw
push: data/cropped/17010030.jpg -> /data/local/tmp/inception_v3/cropped/17010030.jpg
13 files pushed. 0 files skipped.
2833 KB/s (6521276 bytes in 2.247s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0/models/inception_v3$ adb push data/target_raw_list.txt /data/local/tmp/inception_v3
2 KB/s (135 bytes in 0.045s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0/models/inception_v3$ adb push dlc/inception_v3_quantized.dlc /data/local/tmp/inception_v3
3569 KB/s (23882618 bytes in 6.534s)
yihangrd@yihangrd-Inspiron-3668:~/snpe-1.6.0/models/inception_v3$ adb shell
root@msm8996:/ # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/data/local/tmp/snpee>
ATH=$PATH:/data/local/tmp/snpeexample/arm-android-gcc4.9/bin                  <
lib;/system/lib/rfsa/adsp;/system/vendor/lib/rfsa/adsp;/dsp"                  <
root@msm8996:/ # cd /data/local/tmp/inception_v3
nception_v3_quantized.dlc --input_list target_raw_list.txt --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=106; thread_id=-146265292

 

Best regards,

 

 

 

 

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Mon, 2017-11-20 05:58

Thanks for the reply.

Ok we have to figure out libadsprpc.so.  It is the library that allows SNPE to communicate to the DSP.  If it's not on the platform, then DSP runtime won't work.  It is rare for this library to be missing so expanding the search is next.  Can you check /system/vendor/lib as well? 

Can you check with your board vendor to see if there is an updated software image for it?

You don't need to worry about /system/lib/rfsa/adsp if /system/vendor/lib/rfsa/adsp is populated (and it appears to be) then that portion checks out.

 

  • Up0
  • Down0
yanbophx
Join Date: 16 Oct 17
Posts: 17
Posted: Mon, 2017-11-20 16:52

Thanks for your instructions,  I notice that libadsprpc.so is in /system/vendor/lib/ . So, what shall I do now? Copy this file to /system/lib/ ? Or modify the path $  to include /system/vendor/lib/ ?

Thanks,

  • Up0
  • Down0
bspinar
Join Date: 4 Feb 15
Posts: 21
Posted: Mon, 2017-11-27 13:52

Hi. Did you ever get this resolved? Many of us were out for the holiday, so we've been slow in repsonding. You should be able to copy the file. If that doesn't work, let us know. Thanks.

  • Up0
  • Down0
bspinar
Join Date: 4 Feb 15
Posts: 21
Posted: Mon, 2017-11-27 13:53

Hi. Did you ever get this resolved? Many of us were out for the holiday, so we've been slow in repsonding. You should be able to copy the file. If that doesn't work, let us know. Thanks.

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Tue, 2017-12-19 06:21

@yanbophx

libadsprpc.so being in /system/vendor/lib is fine. No need to move it.

Which device are you running this on?  DSP will not work on Google pixel devices.

  • Up0
  • Down0
madhavajay
Join Date: 15 Mar 18
Posts: 22
Posted: Mon, 2018-04-02 12:48
On my LG G6 With Android 7.0 I have the following:
 
For this file: libadsprpc.so
 
-rw-r--r-- 1 root root 83716 2008-12-31 12:00 ./vendor/lib/libadsprpc.so
./vendor/lib/libadsprpc.so
-rw-r--r-- 1 root root 104848 2008-12-31 12:00 ./vendor/lib64/libadsprpc.so
 
For this folder adsp:
lucye:/system $ find ./ -name "adsp"
./vendor/lib/rfsa/adsp
 
Contents of adsp:
 
lucye:/system $ ls -la ./vendor/lib/rfsa/adsp
total 18480
drwxr-xr-x 2 root shell    4096 2008-12-31 12:00 .
drwxr-xr-x 3 root shell    4096 2008-12-31 12:00 ..
-rw-r--r-- 1 root root    28904 2008-12-31 12:00 AlacDecoderModule.so.1
-rw-r--r-- 1 root root    49208 2008-12-31 12:00 ApeDecoderModule.so.1
-rw-r--r-- 1 root root   201400 2008-12-31 12:00 EtsiEaacPlusEncAndCmnModule.so.1
-rw-r--r-- 1 root root    39248 2008-12-31 12:00 FlacDecoderModule.so.1
-rw-r--r-- 1 root root   297360 2008-12-31 12:00 HeaacDecoderModule.so.1
-rw-r--r-- 1 root root   125744 2008-12-31 12:00 SAPlusCmnModule.so.1
-rw-r--r-- 1 root root   164728 2008-12-31 12:00 SrsTruMediaModule.so.1
-rw-r--r-- 1 root root    86680 2008-12-31 12:00 VorbisDecoderModule.so.1
-rw-r--r-- 1 root root   375000 2008-12-31 12:00 WmaProDecoderModule.so.1
-rw-r--r-- 1 root root   127544 2008-12-31 12:00 WmaStdDecoderModule.so.1
-rw-r--r-- 1 root root   127872 2008-12-31 12:00 activity.so
-rw-r--r-- 1 root root    73640 2008-12-31 12:00 chre.so
-rw-r--r-- 1 root root    74080 2008-12-31 12:00 chre_drv_sns.so
-rw-r--r-- 1 root root    38288 2008-12-31 12:00 chre_platform.so
-rw-r--r-- 1 root root   685728 2008-12-31 12:00 fastrpc_shell_0
-rw-r--r-- 1 root root   153200 2008-12-31 12:00 fluence_voiceplus_module.so.1
-rw-r--r-- 1 root root   371992 2008-12-31 12:00 libadsp_fd_skel.so
-rw-r--r-- 1 root root    24864 2008-12-31 12:00 libadsp_hvx_add_constant.so
-rw-r--r-- 1 root root    70928 2008-12-31 12:00 libadsp_hvx_skel.so
-rw-r--r-- 1 root root    24844 2008-12-31 12:00 libadsp_hvx_stats.so
-rw-r--r-- 1 root root    41348 2008-12-31 12:00 libadsp_hvx_zzhdr_BGGR.so
-rw-r--r-- 1 root root    45444 2008-12-31 12:00 libadsp_hvx_zzhdr_RGGB.so
-rw-r--r-- 1 root root    66536 2008-12-31 12:00 libapps_mem_heap.so
-rw-r--r-- 1 root root    33224 2008-12-31 12:00 libdspCV_skel.so
-rw-r--r-- 1 root root  1185396 2008-12-31 12:00 libfastcvadsp.so
-rw-r--r-- 1 root root   550172 2008-12-31 12:00 libfastcvadsp_skel.so
-rw-r--r-- 1 root root    25104 2008-12-31 12:00 libnanohub_ctl_skel.so
-rw-r--r-- 1 root root    82272 2008-12-31 12:00 libobjectMattingApp_skel.so
-rw-r--r-- 1 root root    99808 2008-12-31 12:00 libscveBlobDescriptor_skel.so
-rw-r--r-- 1 root root   429140 2008-12-31 12:00 libscveCleverCapture_skel.so
-rw-r--r-- 1 root root   635648 2008-12-31 12:00 libscveFaceRecognition_skel.so
-rw-r--r-- 1 root root    41780 2008-12-31 12:00 libscveObjectSegmentation_skel.so
-rw-r--r-- 1 root root   399744 2008-12-31 12:00 libscveT2T_skel.so
-rw-r--r-- 1 root root  1487612 2008-12-31 12:00 libscveTextReco_skel.so
-rw-r--r-- 1 root root    78600 2008-12-31 12:00 libsysmon_skel.so
-rw-r--r-- 1 root root   123240 2008-12-31 12:00 libvpp_frc.so
-rw-r--r-- 1 root root   356608 2008-12-31 12:00 libvpp_svc_skel.so
-rw-r--r-- 1 root root   522136 2008-12-31 12:00 mmecns_module.so.1
 
 
Does this mean that DSP should be enabled???
 
 
  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Tue, 2018-04-03 04:39

The system does appear to be populated with the correct files.  

Please try snpe-net-run example (I know you have another thread going on this..I can't remember if you tried snpe-net-run yet.)

If snpe-net-run example for InceptionV3 works on DSP, but the APK doesn't, then there might be some permission issues (selinux perhaps) on the device that is preventing APKs from running on DSP runtime.  

  • Up0
  • Down0
madhavajay
Join Date: 15 Mar 18
Posts: 22
Posted: Mon, 2018-04-30 15:21

Hi,

I finally got around to doing this as I have been busy just getting the SSD demo to work.

I didnt bother with the CPU demo just straight to DSP and it worked first time with these results:

Classification results
cropped/handicap_sign.raw 0.361044 932 street sign
cropped/trash_bin.raw     0.958078 752 ashcan
cropped/notice_sign.raw   0.201760 716 brass
cropped/chairs.raw        0.140700 311 studio couch
cropped/plastic_cup.raw   0.953900 946 measuring cup
 
I assume that means it has DSP enabled and that the MobileNet SSD model doesnt support DSP yet?
However how come im getting 500ms for GPU / GPU_FLOAT16 performance on that model?
 
Others are claiming under 100ms, see here:
 
Can anyone comment on what is possible with this model and what Qualcomm hardware. I need to know because im building a prototype SSD based application and the performance needs to be better than 500ms per frame. I can get about 150ms on CoreML when converting the same model, so something must be wrong with my numbers....
 
Any help would be appreciated.
 
  • 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.