/vendor/lib64/libOpenCL.so has no access rights in Android applications-
when OpenCL is used to accelerate some NDK codes, it is found that the operation can not call the libOpenCL library provided by the manufacturer, because the permissions are not enough, the following is to solve Method:
-
Check whether the library file is in the public library declaration. Check the
adb root
adb shell
cd / vendor / etc
cat public.libraries.txt in the adb shell
as follows. If it shows
something like the following libMcClient.so
libMcRegistry.so
libOpenCL.so
shows no problem, but If libOpenCL.so is not found, it needs to be added to public.libraries.txt,
echo libOpenCL.so >> public.libraries.txt -
See if there is read and write access to the path where the library is performed in the adb shell:
getenforce
display
Permissive
indicates OK, if
Enforcing
the show is not currently open read-write access, the system is in a protected state (readonly system).
Everything to adb If root is successful, perform the following operations:
setenforce 0 In
this way, libOpenCL.so should be used normally. If it still doesn't work, please check if the libOpenCL.so file really exists under / vendor / lib64 /.