27

Recently I want to develop the parallel computing application on android use OpenCL. As far as I know, Android system does not include "libopencl.so",but there are still some webs or blogs show OpenCL development on android. Does Android support OpenCL? if so, what should I do to develop OpenCL on android ?

Neoh
  • 15,906
  • 14
  • 66
  • 78
liu jie
  • 281
  • 1
  • 3
  • 3
  • 1
    For ARM just link against `libGLES_mali.so`. For Qualcomm I think you have `libOpenCL.so`. However, sometimes they are not in the path, so look for them in "/system/vendor/lib" – DarkZeros Nov 07 '14 at 10:14
  • In my android mobile,there are not have the libOpenCL.so, where can i find the file ? my android GPU type is Imagination PowerVR SGX544. – liu jie Nov 07 '14 at 15:02
  • This may help: http://community.imgtec.com/developers/powervr/ I work with ARM and Qualcomm never with Imagination – DarkZeros Nov 07 '14 at 15:26
  • 1
    How to version: http://stackoverflow.com/questions/9005352/how-to-use-opencl-on-android – Ciro Santilli OurBigBook.com Nov 13 '16 at 01:36
  • Check it: https://stackoverflow.com/questions/9005352/how-to-use-opencl-on-android/54105051#54105051 – 42n4 Jan 09 '19 at 09:28
  • In my experience Samsung/Sony/LG/Motorola add the OCL runtimes and allow access on Android>7.0 on most of their recent phones. Search for OpenCL in the Anroid store. There are apps that use it the shred COL runtime on latest Android. – Hashman Jan 31 '19 at 05:17

4 Answers4

16

Update on May 20, 2016

For all devices with arm64-v8a ABI, the OpenCL library may located in lib64 folder as well.

So when you check the OpenCL library, make sure you also check the corresponding lib64 folder (if you prefer arm64-v8a as the first ABI for your app, you may want to first check lib64 folder).

For example: /system/vendor/lib64/libOpenCL.so


The original answer:

Since 2014, there are more phones supporting OpenCL.

The followings are the location of the OpenCL library:

Qualcomm Adreno:

/system/vendor/lib/libOpenCL.so
or /system/lib/libOpenCL.so (older devices)

ARM Mali:

/system/vendor/lib/egl/libGLES_mali.so
or /system/lib/egl/libGLES_mali.so

PowerVR:

/system/vendor/lib/libPVROCL.so

You can use OpenCL-Z Android to check the available and capabilities of OpenCL on Android devices.

Robert Wang
  • 1,161
  • 9
  • 15
  • Intel-based Android devices should also have it at the same place as Adreno: `/system/vendor/lib/libOpenCL.so` – Lrdx Jun 09 '15 at 10:42
  • @Lrdx, Intel based devices may use GPUs from other vendors. I've a tablet Samsung Tab 3 3G, using an Intel Atom Z2560. However, the GPU is a PowerVR SGX544MP2: /system/vendor/lib/libPVROCL.so – mdew Oct 14 '15 at 12:17
  • @mdew I forgot that Intel has some chips with PowerVR graphics. My comment was for chips with HD Graphics GPUs. It can change anyway, as there is no standardized place. – Lrdx Oct 28 '15 at 17:21
  • Hi, how can I check if that `.so` is on my device? – user8469759 Jan 11 '19 at 16:33
  • no good way so far, you have to try to query all possible paths as mentioned above to see if OpenCL driver is available. Luckily, there are limited number of possibilities to try due to the limited number of mobile GPU vendors. So that should not be too bad actually. – Robert Wang Jan 16 '19 at 19:22
4

Strictly speaking, Android does not support OpenCL. That is Google's (bad) choice. However, you can run OpenCL applications on your Android device if you can get hold of an OpenCL library for it. From the links Kirtan provides, I'd recommend the Sony route as it is the most straight forward (i.e. the phones already come with OpenCL on them) which I believe is Qualcomm's Adreno GPU.

The only Imagination OpenCL availability I know of is on this dev board. It has an SGX544 so you may be able to take the drivers from that board and put them on your device. It may work.....

As an aside: OpenGL ES 3.1 supports GL compute shaders and is supported on Android so may be an option of you are looking to ship something using the GPU for compute.

user2746401
  • 3,157
  • 2
  • 21
  • 46
3

you can take reference of below links

https://software.intel.com/en-us/android/articles/opencl-basic-sample-for-android-os

http://arrayfire.com/getting-started-with-opencl-on-android/

http://developer.sonymobile.com/2013/10/29/boost-the-performance-of-your-android-app-with-opencl/

Kirtan
  • 1,782
  • 1
  • 13
  • 35
  • think u, for now,there are Adreno or Mali GPU support mobile OpenCL,not all mobile phone ,it is a bad news for me. – liu jie Nov 07 '14 at 14:58
  • Glad to see things have changed recently. Most of the recently mid to high end phones except google ones support OpenCL. Good news for OpenCL developers. – Robert Wang Aug 22 '15 at 06:56
0

I know this is an old post but could be an help for other visitors.

Starting from API level 24 a better solution to perform GPGPU on Android is using Vulkan's compute stage.

Vulkan is not only for graphics, the compute stage in the pipeline is indipendent and can be used to run kernels.

I have recently released a Java module that uses the Vulkan's compute stage. It uses GLSL program as kernel but in the future I could add OpenCL C support too.