棋子 · 2020年02月24日

Android 9 Mali G72 OpenCL library for C++ build

I was able to run JNI Opencl kernel on my mali T830 by coping the system/vendor/lib/libGLES_mali.so and libOpenCL.so to the JNI folder on android studio. of course we to load some library through

System.loadLibrary(xxx).

I hace done the same with my mali G72. Compilation and linkage are fine. But in excecution time i am asked for two other library :

system/vendor/lib/libgpucommon_vendor_client.so and system/vendor/lib/libmediacomm@2.0-client.so

the problem is taht android do not copy the libmediacomm@2.0-client.so to the data/data/apk/lib. So at run time a got this error :

java.lang.UnsatisfiedLinkError: dlopen failed: library "libmediacomm@2.0-client.so" not found

It is possible to get library which does not need of the system/vendor/lib/libgpucommon_vendor_client.so and system/vendor/lib/libmediacomm@2.0-client.so.

Or if you know how to run openCL on android 9 (honnor play) whitout linker library problem.

thanks a lot for drive me to a succefull solution.

regards herve terrole, paris france. ;))

1 个回答 得票排序 · 时间排序
极术小姐姐 · 2020年02月24日

Ok ! i found why libmediacomm@2.0-client.so is not copied to /data/data/apk/lib.

the problem is that the labrary containt the "@" caracter in the name. You can easely test it under android studio. just create a JNIlibrary and check data/data/apk/lib.

test in android.mk

LOCAL_MODULE := JNIProcessor@2.0-client
LOCAL_SRC_FILES := processor.cpp

and

LOCAL_MODULE := JNIProcessor2.0-client
LOCAL_SRC_FILES := processor.cpp

and you will find out.

So as the library is directly called from data/data/apk/lib. I need to change library name inside libGLES_mali.so and rename the
libmediacomm@2.0-client.so to libmediacomm2.0-client.so. But how do i change the lib name inside libGLES_mali.so ?

So the problem is solve for you. Can you help me to solve mine ;))

PS: i bougth the honnor play two days ago only for testing OpenCL on 12 heart G72 gpu. It is a petty to spend monney for nothing. ;))

thanks for you help.

regards herve terrolle from paris, France.

你的回答
关注数
1
收藏数
0
浏览数
3195
极术小姐姐
极术微信服务号
关注极术微信号
实时接收点赞提醒和评论通知
安谋科技学堂公众号
关注安谋科技学堂
实时获取安谋科技及 Arm 教学资源
安谋科技招聘公众号
关注安谋科技招聘
实时获取安谋科技中国职位信息