2

Actually i try to run OpenCL samples on Nexus 10, but no success yet. I used Mali OpenCL SDK http://malideveloper.arm.com/resources/sdks/mali-opencl-sdk/ and android NDK. Also while linking samples, i used libGLES_mali.so from target. After some struggling i have compiled sample program and pushed it to board. It seems that it runs ok, but i get an error while compiling GPU code:

root@manta:/hello_world # ./hello_world_opencl                                                                                                                                          
OpenCL error: CL_COMPILER_NOT_AVAILABLE
Build log:
 error: Compiler not supported on this platform

Failed to build OpenCL program. common.cpp:351
OpenCL error: CL_INVALID_PROGRAM
Releasing the OpenCL program failed. common.cpp:204
Failed to create OpenCL program.hello_world_opencl.cpp:53

I googled a lot, but found nothing related to subj. Where can i found this OpenCL compiler and why it is not provided when OpenCL library is on board?

Alex Hoppus
  • 3,821
  • 4
  • 28
  • 47
  • 3
    No personal experience with Mali, but they seem to have an [offline compiler for OpenCL](http://malideveloper.arm.com/news/tool-updates/mali-offline-compiler-v5-0-released-supports-opencl/). Maybe the only way is to compile your kernels offline with this tool first and run the compiled binaries when running on android? – prunge Aug 28 '15 at 16:40
  • Yes, thatnks for response. Actually saw this one, but currently iam interested in online compilation – Alex Hoppus Aug 28 '15 at 16:47
  • I don't think OpenCL is supported on the Nexus 10, but it is on other devices, like http://community.arm.com/groups/arm-mali-graphics/blog/2014/12/18/installing-opencl-on-chromebook-2-in-30-minutes – Lordalcol Sep 01 '15 at 07:48
  • OpenCL is supported on Nexus 10 – Alex Hoppus Sep 01 '15 at 13:01
  • What Android version are you running? Starting from Android 4.3 Google blocked the OpenCL support. My guess is that they did that to increase the usage of RenderScript. Check here: http://streamcomputing.eu/blog/2013-08-01/google-blocked-opencl-on-android-4-3/ – VAndrei Sep 01 '15 at 19:56
  • I'am using android 5.1 – Alex Hoppus Sep 02 '15 at 05:48
  • Okay, maybe i am wrong, but i relied to this info http://malideveloper.arm.com/resources/development-platforms/google-nexus-10/ it says nexus 10 with android 5.1 is development platform for opencl – Alex Hoppus Sep 02 '15 at 06:05

1 Answers1

0

There are too many factors that could lead to the error message you showed. So we cannot really provide very specific suggestions. But the following steps may help.

Check if your platform has the OpenCL library first, on Samsung devices, it is typically located at: \system\vendor\lib\egl\libGLES_mali.so

On some of the recent Samsung devices (such as Galaxy S6), a soft symbolic link is added, so the following location also works: \system\vendor\lib\libOpenCL.so (which actually links to the above file location).

If the library does exist, it means at least you get the library. Then try to write a simple program like clinfo to query the device information using clGetDeviceInfo(). Using "CL_DEVICE_COMPILER_AVAILABLE" option with clGetDeviceInfo(), you will know if the compiler is available. (https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetDeviceInfo.html)

If the clinfo works, most likely the CL program can run well on your device. If you still cannot run it, please check your compiling/linking process, and see if you have successfully linked to the correct CL libraries.

I also suggest you should download an Android app: OpenCL-Z to check if your device has the OpenCL capability. The tool can be found from Android Play Store.


Can you find another device supporting OpenCL? Nowadays, many Android devices have the OpenCL support. It will be helpful if you can compile/link your program towards another device and test it. Any device with Qualcomm Snapdragon chips, and Samsung Exynos chips during the past 1-2 years should support OpenCL.

Robert Wang
  • 1,161
  • 9
  • 15