Snapdragon 820 DSP Runtime Unavailable
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
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.
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
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
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:
It seems like FastRPC is supported, but not working correctly.
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
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):
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
@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.)
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.
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 :
adb root
adb shell cat /sys/devices/soc0/serial_number
Convert the decimal number you get as output to hex
python ${QUALCOMM_SDK}/tools/elfsigner/elfsigner.py -t $(SERIAL_NUMBER_HEX_VALUE)
adb remount
adb shell mkdir -p /system/lib/rfsa/adsp
adb push
${QUALCOMM_SDK}/output/testsig-$(SERIAL_NUMBER_HEX_VALUE).so /system/lib/rfsa/adsp/
adb reboot
This solved the problem for me, I hope it helps.
Michelle
@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