Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCL initialization failed #11

Closed
anwesha94 opened this issue Oct 3, 2017 · 5 comments
Closed

OpenCL initialization failed #11

anwesha94 opened this issue Oct 3, 2017 · 5 comments

Comments

@anwesha94
Copy link

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.

@AnthonyBarbier
Copy link

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 ?

@anwesha94
Copy link
Author

anwesha94 commented Oct 4, 2017

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.

@joey2014
Copy link

joey2014 commented Oct 9, 2017

@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

@anwesha94 anwesha94 reopened this Oct 11, 2017
@anwesha94 anwesha94 reopened this Oct 12, 2017
@anwesha94
Copy link
Author

anwesha94 commented Oct 12, 2017

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"

@anwesha94
Copy link
Author

closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants