ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

Crashing at CLScheduler::get().default_init();

Open Subarukun opened this issue 9 years ago • 7 comments

Hi,

I am trying to run the cl_convolution on Helloworld AndroidStudio Project.I am invoking the the call from JNI in onCreate.(This approach worked for armcompute neon and there were no issues)

Crash is happening in the below bold code cl_int clRetainContext(cl_context context) { auto func = CLSymbols::get().clRetainContext; if(func != nullptr) { **return func(context);** } else { return CL_OUT_OF_RESOURCES; } } Device I am using is Samsung Galaxy A5 2016(A510F). It has LibGLES_mali.so in system/vendor/ . Mali chip used is Mali-T720 MP2(probably).

We are using the CMakefile concept in Android and attached the CMakeFile. CMakeLists.txt

Please let me know what could be the cause. Let me know if you need any further info.

Thanks..

Subarukun avatar May 26 '17 09:05 Subarukun

The problem is you're trying to build the library using your own build system and because of that you're missing several flags. Instead you should build the library using SCons and simply link against it in your Makefile. Also the library dynamically load the OpenCL symbols at runtime from libOpenCL.so using dlopen / dlsym, so you shouldn't link against libGLES_mali directly.

AnthonyBarbier avatar May 26 '17 09:05 AnthonyBarbier

Hi Anthony,

This dlopen in opencl.cpp will try to open the opencl library that is provided by vendor or the OpenCL stub library that we are linking. I think it will open the vendor provided OpenCL library?

If Yes , then it should open the libGLES_mali.so which is mali opencl library for MALI gpu.

If no,then may be the libopencl.so is actual implementation for Opencl.so in my mobile.

All this confusion ia araising since I have 2 .so's as mentioned above..

Thanks.

Subarukun avatar May 27 '17 03:05 Subarukun

It will try to open libOpenCL.so which usually is a symlink to libGLES_mali. (The stub is only for linking, shouldn't be on the target device)

AnthonyBarbier avatar May 27 '17 09:05 AnthonyBarbier

ok Thanks. Crash could be due to OpenCL version . I have in my phone is Opencl 1.1 . Where as the ARM compute requires the OpenCL 1.2.

Subarukun avatar May 29 '17 04:05 Subarukun

Hi Anthony,

I just wanted to confirm. Does ARM Compute CL library expects the OpenCL 1.2 or 1.1 library?.

Thanks.

Subarukun avatar May 30 '17 09:05 Subarukun

1.1 should be enough (r8p0 and above) As far as I know, no 2 entry point is used yet.

AnthonyBarbier avatar May 30 '17 09:05 AnthonyBarbier

ok thanks

Subarukun avatar May 30 '17 11:05 Subarukun