Hi
I've recently got over the Compute Library OPenCL.so problem and have moved on to trying to run the examples. I compiled natively on an Odroid XU4 with neon=1 and opencl=1 using "scons Werror=1 -j8 debug=0 neon=1 opencl=1 os=linux arch=armv7a build=native"
I could run the neon example ok:-
odroid@odroid:~/ComputeLibrary-17.12/build/examples$ LD_LIBRARY_PATH=~/ComputeLibrary-17.12/build ./neon_convolution
./neon_convolution
Usage: ./build/neon_convolution [input_image.ppm]
No input_image provided, creating a dummy 640x480 image
Test passed
When trying the opencl version :-
odroid@odroid:~/ComputeLibrary-17.12/build/examples$ LD_LIBRARY_PATH=~/ComputeLibrary-17.12/build ./cl_convolution
./cl_convolution
Usage: ./build/cl_convolution [input_image.ppm]
No input_image provided, creating a dummy 640x480 image !!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR in load_program src/core/CL/CLKernelLibrary.cpp:765: Kernel file ./cl_kernels/convolution3x3.cl does not exist. No such file or directory !!!!!!!!!!!!!!!!!!!!!!!!!!!
Test FAILED
This looks like an OpenCL run/compile failure!I copied the cl_kernels directory from ~/ComputeLibrary-17.12/src/core/CL into ~/ComputeLibrary-17.12/build/examples and ran it again:-
Is there some $PATH or other ENV value that needs set up, so that the scons compiled build code points to the original source directory rather than in the build directory or is there something I've missed in the Scons command?
Dave
Hi,
This seems related to the embed_kernels=1 build option.
embed_kernels: For OpenCL / GLES_COMPUTE only: set embed_kernels=1 if you want the OpenCL / GLES_COMPUTE kernels to be built in the library's binaries instead of being read from separate ".cl" / ".cs" files. If embed_kernels is set to 0 then the application can set the path to the folder containing the OpenCL / GLES_COMPUTE kernel files by calling CLKernelLibrary::init() / GCKernelLibrary::init(). By default the path is set to "./cl_kernels" / "./cs_shaders".
Maybe try to build again with embed_kernels=1
Thanks,
Jason
Thanks Jason
You must be telepathic!! Yesterday morning I started looking at the Compute Library documentation and realised that in the "Building for Linux" section, one of the scons examples for cross compiling for opencl on linux had that option but the native one that I had copied and used for the XU4, didn't. I looked up the build option and the realisation hit! Recompiled and now it works ok!!
Thanks again
Hi, recently I want to compile Compute Library on odroid-xu4, ubuntu14.04, but I can't find libopencl.so on my odroid. Where can I find this file?
zk
Hi zk
There's another topic that gives more historical background to this "Mali OpenCL SDK not found", opened by Santy on 23/11/2017. This will give a bit more background and way forward.
After that I started to look around to find a libOpenCL.so on my Odroid eg
sudo find / -name libOpenCL.so
This found one in the arm gnueabihf compiler directory and came back with:
/usr/lib/arm-linux-gnueabihf/libOpenCL.so/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so
The first a symlink to libOpenCL.so in mali_egl directory ! In order to find out if this was a OpenCL v1.2 version , cd'd to the mali_egl directory and used the strings command but using it on OpenCL.so didn't give any reference to OpenCL but further detective work showed that libOpenCL references libmali.so, where using:-
strings libmali.so | grep OpenCL
The first line of the output gave me what I wanted:-
OpenCL 1.2 v1.r17p0-01rel0.a881d28363cdb20f0017ed13c980967e
So you can put a symlink in your ComputeLibrary/build directory to wherever your libOpenCL.so is located!
hope this helps!
Thank you, this really help,but I got error after that, here is the detail:
I've find libOpencL.so in the above directory, when I run:
string libmali.so | grep Opencl,
I got :
OpenCL 1.1
but when I compile Compute Library, I got error:
./arm_compute/core/Coordinates.h:37:7: error: base class 'class arm_compute::Dimensions<int>' has a non-virtual destructor [-Werror=effc++]
class Coordinates : public Dimensions<int>
In this issue: Compiling error on allwinner A20 board , AnthonyARM said it might be a toolchain version problem.
After that, I change my odroid to ubuntu16.04 mate, and the OpenCL version is 1.2. I use :
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so libOpenCL.so
to put a symlink in my ComputeLibrary/build directory, and then run:
scons Werror=1 -j8 debug=0 neon=1 opencl=1 os=linux arch=armv7a build=native embed_kernels=1
got error:
build/src/graph/Graph.os: In function `cl::CommandQueue::makeDefault()': Graph.cpp:(.text._ZN2cl12CommandQueue11makeDefaultEv[_ZN2cl12CommandQueue11makeDefaultEv]+0xc6): undefined reference to `clCreateCommandQueue' build/src/graph/Graph.os: In function `cl::Device::makeDefault()': Graph.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0x94): undefined reference to `clGetContextInfo' Graph.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xc8): undefined reference to `clGetContextInfo' build/src/graph/Graph.os: In function `cl::Context::makeDefault()': Graph.cpp:(.text._ZN2cl7Context11makeDefaultEv[_ZN2cl7Context11makeDefaultEv]+0x7e): undefined reference to `clCreateContextFromType' collect2: error: ld returned 1 exit status build/examples/neoncl_scale_median_gaussian.o: In function `cl::CommandQueue::makeDefault()': neoncl_scale_median_gaussian.cpp:(.text._ZN2cl12CommandQueue11makeDefaultEv[_ZN2cl12CommandQueue11makeDefaultEv]+0xf0): undefined reference to `clCreateCommandQueue' build/examples/neoncl_scale_median_gaussian.o: In function `cl::Device::makeDefault()': neoncl_scale_median_gaussian.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xaa): undefined reference to `clGetContextInfo' neoncl_scale_median_gaussian.cpp:(.text._ZN2cl6Device11makeDefaultEv[_ZN2cl6Device11makeDefaultEv]+0xde): undefined reference to `clGetContextInfo' build/examples/neoncl_scale_median_gaussian.o: In function `cl::Context::makeDefault()': neoncl_scale_median_gaussian.cpp:(.text._ZN2cl7Context11makeDefaultEv[_ZN2cl7Context11makeDefaultEv]+0x92): undefined reference to `clCreateContextFromType' collect2: error: ld returned 1 exit status
my ComputeLibrary version is 17.12. do you have any advice about this? Or how do you compile ComputeLibaray on odroid-xu4?
thanks
I finally handle it by " sudo apt-get install mali-fbdev ".