Hi,
I had an issue with the OpenCL Driver on my Chomebook.
I followed ARM's instruction and successfully boot into Linux. However, I got an error message said that libxcb-dri2.so missing. After install libxcb-dri2.0-dev, I can compile Mali OpenCL SDK sample codes. But they won't be executed correctly under X11 or via fbdev. I past error message below. Any suggestion? Thanks.
> ./hello_world_opencl OpenCL error: CL_OUT_OF_HOST_MEMORY Creating an OpenCL context failed. common.cpp:248 Failed to create an OpenCL context. hello_world_opencl.cpp:39 > ldd hello_world_opencl libOpenCL.so => /opt/mali/fbdev/libOpenCL.so (0x76efc000) libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76e4a000) libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76e39000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76d55000) /lib/ld-linux-armhf.so.3 (0x76f07000) libmali.so => /opt/mali/fbdev/libmali.so (0x76304000) libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x762e9000) libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x7627e000) librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76270000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76265000)
> ./hello_world_opencl
OpenCL error: CL_OUT_OF_HOST_MEMORY
Creating an OpenCL context failed. common.cpp:248
Failed to create an OpenCL context. hello_world_opencl.cpp:39
> ldd hello_world_opencl
libOpenCL.so => /opt/mali/fbdev/libOpenCL.so (0x76efc000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76e4a000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76e39000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76d55000)
/lib/ld-linux-armhf.so.3 (0x76f07000)
libmali.so => /opt/mali/fbdev/libmali.so (0x76304000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x762e9000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x7627e000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x76270000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x76265000)
Hi j.c.
The SDK samples don't depend on libxcb-dri2 (the x11 mali driver does), so I cant explain why they won't compile natively until you install it. I've just tested both cross compilation and native compilation and both methods work for me and produce binaries, which run fine. (native compilation you simply edit platform.mk and remove the arm-none-linux-gnueabi- prefix. And also, to cross compile hard float, you must replace it with arm-linux-gnueabihf- if using the linaro toolchain, but I assume you already did one of these)
My X11 libs are in /usr/lib so when i run ldd i get:
$ ldd hello_world_opencl
libOpenCL.so => /usr/lib/libOpenCL.so (0x764fd000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76455000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76444000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76360000)
/lib/ld-linux-armhf.so.3 (0x76f58000)
libX11.so.6 => /usr/lib/arm-linux-gnueabihf/libX11.so.6 (0x7627b000)
libX11-xcb.so.1 => /usr/lib/arm-linux-gnueabihf/libX11-xcb.so.1 (0x76271000)
libdrm.so.2 => /usr/lib/arm-linux-gnueabihf/libdrm.so.2 (0x76260000)
libxcb.so.1 => /usr/lib/arm-linux-gnueabihf/libxcb.so.1 (0x76246000)
libxcb-render.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-render.so.0 (0x76238000)
libxcb-dri2.so.0 => /usr/lib/arm-linux-gnueabihf/libxcb-dri2.so.0 (0x7622d000)
libXext.so.6 => /usr/lib/arm-linux-gnueabihf/libXext.so.6 (0x7621b000)
libXau.so.6 => /usr/lib/arm-linux-gnueabihf/libXau.so.6 (0x7620f000)
libXfixes.so.3 => /usr/lib/arm-linux-gnueabihf/libXfixes.so.3 (0x76203000)
libXdmcp.so.6 => /usr/lib/arm-linux-gnueabihf/libXdmcp.so.6 (0x761f7000)
libXcomposite.so.1 => /usr/lib/arm-linux-gnueabihf/libXcomposite.so.1 (0x761ed000)
libXrender.so.1 => /usr/lib/arm-linux-gnueabihf/libXrender.so.1 (0x761df000)
libXrandr.so.2 => /usr/lib/arm-linux-gnueabihf/libXrandr.so.2 (0x761d1000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x761c3000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x761a8000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x7619d000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76133000)
My mali libs are in /root/malifbdev, so to get ldd for that I run:
$ LD_LIBRARY_PATH=/root/malifbdev/ ldd hello_world_opencl
libOpenCL.so => /root/malifbdev/libOpenCL.so (0x76f7d000)
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76ecd000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76ebc000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76dd8000)
/lib/ld-linux-armhf.so.3 (0x76f88000)
libmali.so => /root/malifbdev/libmali.so (0x76387000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x7636c000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76301000)
librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x762f3000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x762e8000)
Thanks for sharing your information, krrishnarraj and Chris.
Let me list my build environment to help us clarify the problem.
I build the kernel under Linuxmint 15 xfce 64-bit with kernel v.3.8.0.32-generic on my host machine. AMD catalyst 13.8beta is installed. Since I am working on my Android app development, the essential packages for building Android are all installed on this machine.
I am assuming that none of these installed packages should cause problems while building Mali driver.
I manually applied the kernel patch by following the instruction from Mali website. I install the X11/Fbdev libraries under /opt/mali/{x11,fbdev}. And create a regular user account to build Mali OpenCL SDK samples. It reported that libxcb-dri2.so* missing in my case.
Then, I installed the libxcb-dri-2.0-dev package, and recompiled the sample codes again. Now, the "OUT_OF_HOST_MEMORY" error show up.
No clues for this in the meantime. I will try to start the whole progress again today to see if there is any difference.