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)
Even I am facing the same issue. I have build the same version of kernel specified in the guide. Mali drivers on chromebook | kr blogs shows a detail logs of clinfo devcie query failures. Scott mentioned that user-space driver can't communicate with kernel space one in this case
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)
Hi krrishnarraj,
I just built the opencl.c he links to with "arm-linux-gnueabihf-gcc clInfo.c -I../../include -L../../lib -lOpenCL -o clinfo" and it runs fine for me, no out of memory errors. I notice that in the output in that blog, the PLUGIN output (see below) is not present, which seems to imply there's something dodgy about the way he's got his libraries set up.
Here's my output:
Found 1 platform(s).
platform[0x76ec1c30]: profile: FULL_PROFILE
platform[0x76ec1c30]: version: OpenCL 1.1
platform[0x76ec1c30]: name: ARM Platform
platform[0x76ec1c30]: vendor: ARM
platform[0x76ec1c30]: extensions: cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_arm_core_id cl_khr_egl_event cl_khr_egl_image
platform[0x76ec1c30]: Found 1 device(s).
[PLUGIN INFO] Plugin initializing
[PLUGIN DEBUG] './override.instr_config' not found, trying to open the process config file
[PLUGIN DEBUG] './clinfo.instr_config' not found, trying to open the default config file
[PLUGIN INFO] No configuration file found, attempting to use environment
[PLUGIN INFO] CINSTR GENERAL: Output directory set to: .
[PLUGIN INFO] No instrumentation features requested.
device[0x76eaf218]: NAME: Mali-T604
device[0x76eaf218]: VENDOR: ARM
device[0x76eaf218]: PROFILE: FULL_PROFILE
device[0x76eaf218]: VERSION: OpenCL 1.1
device[0x76eaf218]: EXTENSIONS: cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_arm_core_id cl_khr_egl_event cl_khr_egl_image
device[0x76eaf218]: DRIVER_VERSION: 1.1
device[0x76eaf218]: Type: GPU
device[0x76eaf218]: EXECUTION_CAPABILITIES: Kernel
device[0x76eaf218]: GLOBAL_MEM_CACHE_TYPE: Read-Write (2)
device[0x76eaf218]: CL_DEVICE_LOCAL_MEM_TYPE: Global (2)
device[0x76eaf218]: SINGLE_FP_CONFIG: 0x3f
device[0x76eaf218]: QUEUE_PROPERTIES: 0x3
device[0x76eaf218]: VENDOR_ID: 1767243777
device[0x76eaf218]: MAX_COMPUTE_UNITS: 4
device[0x76eaf218]: MAX_WORK_ITEM_DIMENSIONS: 3
device[0x76eaf218]: MAX_WORK_GROUP_SIZE: 256
device[0x76eaf218]: PREFERRED_VECTOR_WIDTH_CHAR: 16
device[0x76eaf218]: PREFERRED_VECTOR_WIDTH_SHORT: 8
device[0x76eaf218]: PREFERRED_VECTOR_WIDTH_INT: 4
device[0x76eaf218]: PREFERRED_VECTOR_WIDTH_LONG: 2
device[0x76eaf218]: PREFERRED_VECTOR_WIDTH_FLOAT: 4
device[0x76eaf218]: PREFERRED_VECTOR_WIDTH_DOUBLE: 0
device[0x76eaf218]: MAX_CLOCK_FREQUENCY: 533
device[0x76eaf218]: ADDRESS_BITS: 64
device[0x76eaf218]: MAX_MEM_ALLOC_SIZE: 525569024
device[0x76eaf218]: IMAGE_SUPPORT: 1
device[0x76eaf218]: MAX_READ_IMAGE_ARGS: 128
device[0x76eaf218]: MAX_WRITE_IMAGE_ARGS: 8
device[0x76eaf218]: IMAGE2D_MAX_WIDTH: 65536
device[0x76eaf218]: IMAGE2D_MAX_HEIGHT: 65536
device[0x76eaf218]: IMAGE3D_MAX_WIDTH: 65536
device[0x76eaf218]: IMAGE3D_MAX_HEIGHT: 65536
device[0x76eaf218]: IMAGE3D_MAX_DEPTH: 65536
device[0x76eaf218]: MAX_SAMPLERS: 16
device[0x76eaf218]: MAX_PARAMETER_SIZE: 1024
device[0x76eaf218]: MEM_BASE_ADDR_ALIGN: 1024
device[0x76eaf218]: MIN_DATA_TYPE_ALIGN_SIZE: 128
device[0x76eaf218]: GLOBAL_MEM_CACHELINE_SIZE: 64
device[0x76eaf218]: GLOBAL_MEM_CACHE_SIZE: 131072
device[0x76eaf218]: GLOBAL_MEM_SIZE: 2102276096
device[0x76eaf218]: MAX_CONSTANT_BUFFER_SIZE: 65536
device[0x76eaf218]: MAX_CONSTANT_ARGS: 8
device[0x76eaf218]: LOCAL_MEM_SIZE: 32768
device[0x76eaf218]: ERROR_CORRECTION_SUPPORT: 0
device[0x76eaf218]: PROFILING_TIMER_RESOLUTION: 1000
device[0x76eaf218]: ENDIAN_LITTLE: 1
device[0x76eaf218]: AVAILABLE: 1
device[0x76eaf218]: COMPILER_AVAILABLE: 1
BTW that was my blog! I had put libraries in ~/mali/fbdev as suggested. Moving it to /usr/lib/ doesn't make any difference. Even egl drivers are not working. I believe problem here is with my kernel. I had compiled 3.8.11 as suggested with the right patches. Can you please elaborate what kernel you tested it with and how you built it. Or just if its possible, could you upload your kernel (kernel.itb) and its modules here
Thanks
I think without a license agreement in place we're not allowed to upload any binaries, or we would have provided an SD card image! I used the following things:
Linux r3p0-02rel0 kernel space driver from http://malideveloper.arm.com/downloads/drivers/TX011/r3p0-02rel0/TX011-SW-99002-r3p0-02rel0.tgz
Userspace binaries from here http://malideveloper.arm.com/downloads/drivers/binary/r3p0-02rel0/linux-fbdev-hf-r3p0-02rel0.tgz (fbdev in this case, there is no reason the two shouldn't live harmoniously together but we're troubleshooting now so i suggest just using the one set to begin with).
I cloned http://git.chromium.org/chromiumos/third_party/kernel-next.git and checked out 98d6fa96d08dbb08a2150dcd48a6b2a8773172e0
I applied the patches manually (in future we will hopefully provide actual patches, but for some reason could not this time) and replaced the mali driver with the one you download.
Ran ./chromeos/scripts/prepareconfig chromeos-exynos5 and then sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=/mnt
etc. The guide you're following is what I followed to get it working, I honestly can't think of a good reason why it should not work for you on the Mali chromebook, I can only suggest giving it another try in case you jumped a step or something! It happened to me once or twice as there are bits that are quite wordy and easy to skip if you're just jumping from command to command.
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.
The steps given at Graphics and Compute Development on Samsung Chromebook « Mali Developer Center
worked for me without any issues except couple things.
1: Steps of Section 5.2.2, ensure you do not miss quotation mark echo “deb http://ports.ubuntu.com/ubuntu-ports/ precise universe” >> /etc/apt/sources.listMissing quotation mark will jeopardize the apt source list.
2: git clone git://git.linaro.org/arm/xorg/driver/xf86-video-armsoc.git won't work. Try git clone http://git.linaro.org/git-ro/arm/xorg/driver/xf86-video-armsoc.git.
3. Needed to nstall libxcb-dri2-0-dbg package on the target file system.
Though, I am unable to setup the network connections over wifi. I tried nmcli utility but it seems the wifi device is not present. Pointers??
Thanks!
Chris,
Have you got the wifi working with OpenCL BSP?
~Amit
Have left for the day so will check tomorrow, but its the same kernel to my knowledge just with the mali driver changed, so any wifi issue I´d guess would be userspace related. What is the output of ¨ip a¨?
Bizarre, git clone git://git.linaro.org/arm/xorg/driver/xf86-video-armsoc.git works fine for me at home.
"ip a" gives me:
1: lo <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00..
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
Did you use root account to execute OpenCL codes?
I found that only root account could execute the OpenCL sample codes in my case.
Does anyone know if there is a way to solve this? Thanks.
Running any program as sudo works I can live with that. Thanks for the hint
Hi j.c.,
This is because mali is set up as a misc device, and therefore under /dev/mali0 only root has rw permission. It might be possible to change the group of /dev/mali0, give that group rw permission to it, and add yourself to that group, but as you have discovered sudo also works . We're noting all these things down for future releases so thanks for the feedback!
Thanks,
Chris
Hi Amit,
I think we've spoken over email, but for the benefit of others we believe this is due to the udev daemon not being able to pick up the wifi card, probably due to an outdated version. You can either use a USB ethernet dongle, or try a more recent root filesystem, such as Arch or Ubuntu 13.04. We have it working on Arch in the office. It may also be possible to get it working on the existing rootfs we suggest in the guide, but I can't say for sure.