I have followed the getting started instructions (https://developer.qualcomm.com/software/snapdragon-neural-processing-eng...) and I have sucessfuly built the Android app with Android Studio. However the app fails to load the model, examing the adb log the following is displayed:
07-25 11:21:48.529 15012-15012/com.qualcomm.qti.snpe.imageclassifiers E/linker: library "/vendor/lib/libOpenCL.so" ("/system/vendor/lib/libOpenCL.so") needed or dlopened by "/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/lib/arm/libSNPE.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/lib/arm:/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/base.apk!/lib/armeabi-v7a:/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/split_lib_dependencies_apk.apk!/lib/armeabi-v7a:/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/split_lib_slice_0_apk.apk!/lib/armeabi-v7a:/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/split_lib_slice_1_apk.apk!/lib/armeabi-v7a:/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/split_lib_slice_2_apk.apk!/lib/armeabi-v7a:/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/split_lib_slice_3_apk.apk!/lib/armeabi-v7a:/data/app/com.qualcomm.qti.snpe.imageclassifiers-1/split_lib_slice_4_apk.apk!/lib/armeabi-v7a:/data/app/com.qualcomm.qti.snpe.imageclas
07-25 11:21:48.600 15012-15032/com.qualcomm.qti.snpe.imageclassifiers E/LoadNetworkTask: Unable to create network! Cause: error_code=809; error_message=OpenCL function has returned error. OpenCL Error (-59) CL_INVALID_OPERATION; error_component=GPU Runtime; line_no=121; thread_id=-847292128; opencl_error=-59
Java.lang.IllegalStateException: Unable to create network! Cause: error_code=809; error_message=OpenCL function has returned error. OpenCL Error (-59) CL_INVALID_OPERATION; error_component=GPU Runtime; line_no=121; thread_id=-847292128; opencl_error=-59
I am using an Inforce 6640 Single Board Computer running Android Nougat 7.1.1, I have also checked that LibOpenCL.so exists in /system/vendor/lib and it is present.
I am not sure how to proceed, a google search comes up with https://developer.android.com/about/versions/nougat/android-7.0-changes.... NDK Apps Linking to Platform Libraries which is preventing it linking do a non NDK library. I have tried changing the target API to 23, but still get the same error.
Thanks,
Simon
I have also checked the Inforce source build and libOpenCL.so is included in the public.libraries.txt (./vendor/qcom/proprietary/prebuilt/target/product/msm8996/system/vendor/etc/public.libraries.txt):
libOpenCL.so
libqti_performance.so
libqti-perfd-client.so
lib-ims-rcscmjni.so
lib-imsrcscm.so
lib-imsrcscmclient.so
lib-imsrcscmservice.so
libadsprpc.so
libsdsprpc.so
Thanks,
Simon
Seems to be a Inforce build problem as /libOpenCL.so is not be populated into /system/etc/public.libraries.txt, I have edited the file and in now loads the model.
I hope this helps anybody else with similar problems.
Simon
Simon,
glad that you solved it. Thanks for posting the solution!
Milan
Hi Simon,
I'm also developing on Inforce 6640 Single Board Computer running Android Nougat 7.1.1 and it looks like I do not have permission to modify public.libraries.txt.
How did you change the permission on that file (or the whole directory)?
Thanks!
I was able to push the edited public.lilbraries.txt by doing a remount on /system first. However I still see the same error.
From logcat
Hi shiangyong,
Here's what my public.libraries.txt contains:
cat /system/etc/public.libraries.txt
Thank you Simon, I am now able to use the GPU within the Android app. For the benefit of other readers, I also learned that it is necessary to reboot the device after updating public.libraries.txt
Thanks a lot Simon
faced the same problem
adding libOpenCL.so to /system/etc/public.libraries.txt resolved it