Forums - DSP not found on Android APK

3 posts / 0 new
Last post
DSP not found on Android APK
pablog
Join Date: 28 Feb 21
Posts: 11
Posted: Wed, 2021-06-02 00:30

Hi !!!

I created a console app (in C++) to run an inference on a Galaxy S21 with SD888 and it seems to work properly on CPU,GPU and DSP. When I integrate it into an APP (APK) for android, the system is not able to find the DSP. I copied all the libs into jniLibs/arm64-v8a (DSP ones included), also I set the ADSP_LIBRARY_PATH as suggested in the documentation but no success... 

The files are uncompressed in the getApplicationContext().getApplicationInfo().nativeLibraryDir

Quote:

 
drwxr-xr-x 2 system system     3452 2021-06-01 19:36 .
drwxr-xr-x 3 system system     3452 2021-06-01 19:36 ..
-rwxr-xr-x 1 system system    34576 1981-01-01 01:01 libOpenCL.so
-rwxr-xr-x 1 system system   686368 1981-01-01 01:01 libPlatformValidatorShared.so
-rwxr-xr-x 1 system system  7091232 1981-01-01 01:01 libSNPE.so
-rwxr-xr-x 1 system system  1055016 1981-01-01 01:01 libc++_shared.so
-rwxr-xr-x 1 system system    14128 1981-01-01 01:01 libcalculator.so
-rwxr-xr-x 1 system system     9832 1981-01-01 01:01 libcalculator_htp.so
-rwxr-xr-x 1 system system    20828 1981-01-01 01:01 libcalculator_skel.so
-rwxr-xr-x 1 system system   809104 1981-01-01 01:01 libdmlc.so
-rwxr-xr-x 1 system system  3009112 1981-01-01 01:01 libhta.so
-rwxr-xr-x 1 system system  1628288 1981-01-01 01:01 libopencv_calib3d.so
-rwxr-xr-x 1 system system  3083616 1981-01-01 01:01 libopencv_core.so
-rwxr-xr-x 1 system system   542688 1981-01-01 01:01 libopencv_features2d.so
-rwxr-xr-x 1 system system   395400 1981-01-01 01:01 libopencv_flann.so
-rwxr-xr-x 1 system system    55272 1981-01-01 01:01 libopencv_highgui.so
-rwxr-xr-x 1 system system  1530608 1981-01-01 01:01 libopencv_imgcodecs.so
-rwxr-xr-x 1 system system  2510672 1981-01-01 01:01 libopencv_imgproc.so
-rwxr-xr-x 1 system system 17042888 1981-01-01 01:01 libopencv_java4.so
-rwxr-xr-x 1 system system   469032 1981-01-01 01:01 libopencv_ml.so
-rwxr-xr-x 1 system system   321520 1981-01-01 01:01 libopencv_objdetect.so
-rwxr-xr-x 1 system system   481256 1981-01-01 01:01 libopencv_photo.so
-rwxr-xr-x 1 system system   505832 1981-01-01 01:01 libopencv_stitching.so
-rwxr-xr-x 1 system system   325608 1981-01-01 01:01 libopencv_video.so
-rwxr-xr-x 1 system system   264248 1981-01-01 01:01 libopencv_videoio.so
-rwxr-xr-x 1 system system    51336 1981-01-01 01:01 libplatformvalidator-android.so
-rwxr-xr-x 1 system system   166032 1981-01-01 01:01 libsnpe-android.so
-rwxr-xr-x 1 system system    26472 1981-01-01 01:01 libsnpe_dsp_domains_v2.so
-rwxr-xr-x 1 system system    18080 1981-01-01 01:01 libsnpe_dsp_domains_v3.so
-rwxr-xr-x 1 system system  1743626 1981-01-01 01:01 libsnpe_dsp_v65_domains_v2_skel.so
-rwxr-xr-x 1 system system  1747722 1981-01-01 01:01 libsnpe_dsp_v66_domains_v2_skel.so
-rwxr-xr-x 1 system system 12402840 1981-01-01 01:01 libsnpe_dsp_v68_domains_v3_skel.so

Can anyone give me a hand to solve this problem?

P.S.: I am running SPNE 1.49 version.

Thanks in advance!!!!!!

  • Up0
  • Down0
xs_xingshuai
Join Date: 12 May 21
Posts: 1
Posted: Tue, 2021-06-15 18:13

did you solve this issue?  I am running SPNE 1.50 version and still have this problem

  • Up0
  • Down0
pablog
Join Date: 28 Feb 21
Posts: 11
Posted: Thu, 2021-06-17 00:04

Hi,

It was solved. I copied the libs into /data/local/tmp/snpe_libs (adb) and assigned the enviorement ADSP_LIBRARY_PATH to this path. 

Version 1.5 has some bugs and not working properly on SD888, I was using 1.49. 

The function zdl::SNPE::SNPEFactory::isRuntimeAvailable(..) is not working properly because the snpe libs are loaded before I set the ADSP_LIBRARY_PATH path. 

IMPORTANT: 

if you change SNPE version, convert again and quantize the models (no compatible from version to version)

Try also:

 zdl::DlSystem::PlatformConfig platform_config;
platform_config.setPlatformOptions("unsignedPD:ON");
 
snpe_builder.setRuntimeProcessor(m_runtime)
                        .setPerformanceProfile(m_performance_profile)
                        .setExecutionPriorityHint(m_execution_priority_hint)
                        .setOutputTensors(m_output_names)
                        .setCPUFallbackMode(false) 
                        .setUseUserSuppliedBuffers(false)  // Using Tensors instead of buffers
                        .setPlatformConfig(platform_config)
                        .build();

 

Good luck !!!

 

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