OAID / Caffe-HRT

Heterogeneous Run Time version of Caffe. Added heterogeneous capabilities to the Caffe, uses heterogeneous computing infrastructure framework to speed up Deep Learning on Arm-based heterogeneous embedded platform. It also retains all the features of the original Caffe architecture which users deploy their applications seamlessly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OpenCL initialization failed

anwesha94 opened this issue · comments

Hi,
I was able to build CaffeOnACL in my machine. It has ARM Mali-T628 GPU. But when I tried to run Caffe, it says " OpenCL initialization failed". I could not trace back the possible reason for this.
Also,the operating system I am using is ubuntu 14.04. Is it necessary to have ubuntu 16.04 to install CAffeOnACL? If that is the case how am I able to build it in the first place?
Thank you.

If it's not obvious where the issue comes from maybe try to use the Compute Library on its own to start with ? Have you successfully used your OpenCL driver in the past on your platform ?

No, this is the first time I am trying to use openCL in my device. Mine is a 32 bit system. So I used the following command:

arm-linux-gnueabihf-gcc opencl-1.2-stubs/opencl_stubs.c -Iinclude -shared -o build/libOpenCL.so
scons Werror=1 -j8 debug=0 asserts=1 neon=1 opencl=1 embed_kernels=1 os=linux arch=armv7a

It seems that libOpenCL.so did not get built properly.Initially it was saying: " cannot open output file build/libOpenCL.so: no such file or directory". Then I explicitly created build directory "mkdir build". After that I got the error: "error adding symbols: Bad value".
So I installed the opencl library files using "apt install ocl-icd-opencl-dev" and it got installed in /usr/lib.

However, I am getting the same error "OpenCL initialization failed" after building CaffeOnACL again.

@anwesha94

As my understanding, this error message didn't prevent CaffeOnACL's running, and the CaffeOnACL should use CPU instead of GPU. Is it right?

The file build/libOpenCL.so is stub library just for compile. If you doesn't export LD_LIBRARY_PATH=..., CaffeOnACL should use the libOpenCL.so in /usr/lib in runtime.

Can you help check the symbol of the two libOpenCL.so by the below commands?
readelf -s build/libOpenCL.so
readelf -s /usr/lib/libOpenCL.so

Hi, I closed this thread thinking CaffeOnACL is built. But it failed in unit_tests. I do not know if it is a issue of libOpenCL.so
@joey2014
I executed the above commands. Should I get the same results for both?
Also I have libOpenCL.so in multiple locations:
`locate libOpenCL.so

/home/odroid/ComputeLibrary/build/opencl-1.2-stubs/libOpenCL.so
/home/odroid/Downloads/wayland/libOpenCL.so
/home/odroid/Downloads/wayland/libOpenCL.so.1
/usr/lib/arm-linux-gnueabihf/libOpenCL.so
/usr/lib/arm-linux-gnueabihf/libOpenCL.so.1
/usr/lib/arm-linux-gnueabihf/libOpenCL.so.1.0.0
/usr/lib/arm-linux-gnueabihf/libOpenCL.so.1.1
/usr/lib/arm-linux-gnueabihf/mali-egl-current/libOpenCL.so
/usr/lib/arm-linux-gnueabihf/mali-egl-current/libOpenCL.so.1
/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so
/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so.1
/usr/lib/arm-linux-gnueabihf/mali-egl/libOpenCL.so.1.1
/usr/share/mali/libs/libOpenCL.so
/usr/share/mali/libs/libOpenCL.so.1
/usr/share/mali/libs/libOpenCL.so.1.1
/usr/share/man/man7/libOpenCL.so.7.gz
`
How do I know the correct opencl path to build?
Another issue I am getting while executing clinfo command.It gives "number of platforms 0"

closing this issue