Hi,
I am tring to run models on Samsung Tab S3 by using SNPE 1.6.0. I made simple test applications (both native and Java) and followed the documentation instructions. Both CPU and GPU mode can run, but not the DSP mode. I also ran the example Android application, image-classifier, included in SNPE 1.6.0. Only the CPU and GPU runtime were found, which appear in the menu.
But if I use snpe-net-run and manually put the files onto the device, following steps shown in the "Running the Inception v3 Model" tutorial, it can run and pick the DSP runtime. That is, only snpe-net-run can run on the DSP runtime. Why is it? Did I do something wrong?
Thanks,
Best regards.
Harry
Hi Harry. Thanks for trying out SNPE. We have not tried the Galaxy Tab S3, but we've tried many other commercial devices.
The ability to run snpe-net-run using DSP, but not an APK, can be related to the permissions provided to APKs. There is a file called public.libraries.txt in /vendor/ect (or just /etc) that is a list of libraries that APKs are allowed to use. This file needs to contain libadsprpc.so in it. If you could check that, it would be great. If it doesn't have libadsprpc.so in there, then the DSP runtime won't be available. If it *does* have libadsprpc.so, then we have to investigate further.
Also, if you could provide logcat output when using the APK, we could have a look.
We've had one other person have a similar issue with a different Android N device. We are looking into it.
Thanks
Ok we tried 1.6.0 on a OnePlus 5 running Android 7.1.1. THe image-classifiers application that you build with SNPE SDK is able to detect the DSP runtime and use it. /vendor/etc/public.libraries.txt contains libadsprpc.so on this device.
So.. next step is for you to check /vendor/etc/public.libraries.txt and then provide logcats from your device please.
Thank you very much Jesliger,
I checked both the files in /vendor/etc/ and /etc/. It looks the lib is not in either of the lists. The content are as follows:
Thanks for the reply. We found the same issue on a Tab S3 that we have. We have not solved this problem yet. Device manufactures are free to configure public.libraries.txt any way they want.. and it can result in limitations as to what APKs can do.
One possible way to work around this is to try bundling libadsprpc.so inside your APK. It (libadsprpc.so) may have other dependencies that must be bundled as well. You may have to pull these libraries from your device in order to bundle them. See this:
https://www.google.ca/amp/s/ravindragv.wordpress.com/2017/01/30/android-n-and-shared-libraries/amp/
This is probably a non-sanctioned solution (ie. not google approved and not scalable.)
Thanks Jesliger,
I finally made it working by copying the libs as you mentioned.
Greatly appreciate your help!
Harry
Glad you made some progress. Please keep in mind my previous comment "This is probably a non-sanctioned solution (ie. not google approved and not scalable.)"
In short : this solution is not guaranteed to work on other devices. libadsprpc.so is a platform library that, in theory, could be different for every device.
Hello Jesliger,
I have the same problem by using SNPE-1.30.0.480. SampleCode can run at DSP mode, but Android application can't (I also set ADSP_LIBRARY_PATH). Following is my jni native code:
std::stringstream path;