ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

unable to run examples using issue with usage of arm mali APIs

Open mkamrao opened this issue 9 years ago • 10 comments

Hello

I was trying to run an example using openCL for Mali GPU from compute lib as below and encountered errors while running. (Able to compile compute lib with opencl option and the example code) aarch64-oe-linux-g++ examples/cl_convolution.cpp test_helpers/Utils.cpp -I. -Iinclude -std=c++11 -L. -lOpenCL -lmali -larm -o cl_convolution -Wl,-rpath,.

./cl_convolution !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: clGetPlatformIDs from stub libOpenCL.so library called! This library can be used to resolve OpenCL symbols at compile time but must not be in your runtime path (You need to use a real OpenCL implementation, this one is empty) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! terminate called after throwing an instance of 'cl::Error' what(): empty Aborted

Could you suggest where I can get the compatible libOpenCL.so or corresponding opencl source needed for testing OpenCL on Mali using ARM Compute library. (Note: I am using ARM Juno h/w platform rev0).

Thanks kamrao

mkamrao avatar Apr 21 '17 10:04 mkamrao

Hi, If you have a libmali.so on your platform you can just create a symlink libOpenCL.so You also need to make sure that the stub libOpenCL.so you used to compile the example does not appear in your path before your real library.

AnthonyBarbier avatar Apr 21 '17 11:04 AnthonyBarbier

Hello

The libmali.so (-lmali ) in above command is actually ARM Compute library compiled with OpenCL enabled.

Could you suggest how to get appropriate OpenCL library for testing the ARM Compute library on Mali? Do you expect libOpenCL.so already available on the platform?

Thanks

mkamrao avatar Apr 21 '17 11:04 mkamrao

Instead of linking against mali just link against the stub OpenCL. Then create a symlink between libmali and libOpenCL and make sure the stub is not in your path when you run the example (At the moment the error message you see is because the stub libOpenCL.so library is getting loaded instead of the real libmali.)

AnthonyBarbier avatar Apr 21 '17 12:04 AnthonyBarbier

Hello, I created a symlink between libGLES_mali.so and libOpenCL.so in /system/lib64/, however encountered errors like this:

CANNOT LINK EXECUTABLE "/data/local/tmp/cl_convolution": cannot locate symbol "clGetContextInfo" referenced by "/data/local/tmp/cl_convolution"... Aborted

Could you suggest how to solve this problem?

thanks

fyhtea avatar May 12 '17 13:05 fyhtea

Could you please post the command you used to build the example ?

Could you also double check your version of libmali has been compiled with OpenCL: strings libGLES_mali.so | grep clGet

Thanks

AnthonyBarbier avatar May 12 '17 13:05 AnthonyBarbier

I compiled compute lib with opencl option and the example was build by:

aarch64-linux-android-g++' examples/cl_convolution.cpp test_helpers/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute-static -L. -o cl_convolution_aarch64 -static-libstdc++ -pie -lOpenCL

After running

string libGLES_mali.so | grep clGet

there is no output.... So my libmali was not compiled with OpenCL? How can i update it?

Thanks

fyhtea avatar May 12 '17 13:05 fyhtea

Yes, looks like you don't have OpenCL enabled on your platform:

You probably want to get in touch with Linaro for more details, I've found the latest Android image I also found some information on the ARM Community

AnthonyBarbier avatar May 12 '17 13:05 AnthonyBarbier

OK,i will have a look at that.

Thank you very much.

fyhtea avatar May 12 '17 14:05 fyhtea

I have enabled opencl on my platform and it can't run

(gdb) run
Starting program: /home/root/ComputeLibrary/cl_convolution
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".

/home/root/ComputeLibrary/cl_convolution

warning: the debug information found in "/usr/lib/libxshmfence.so.1.0.0" does not match "/usr/lib/libxshmfence.so.1" (CRC mismatch).

terminate called after throwing an instance of 'cl::Error'
  what():  empty

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.24-r0/git/sysdeps/unix/sysv/linux/raise.c:58
58      }
(gdb)

ghost avatar Sep 13 '17 14:09 ghost

Closing issue. Reopen if this haven't been resolved yet.

GeorgeARM avatar Sep 29 '17 12:09 GeorgeARM