This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OpenCL driver issue with Samsung Chromebook

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)

Parents
  • 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

Reply
  • 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

Children
  • 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.


  • 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

  • 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.

    Thanks,

    Chris

  • Hmmm interesting.  I'm using chrubuntu on the internal mmc-- boots fine w/graphics, sound, etc. though it's not stable enough to test much.  Some quick notes for anyone trying it on chrubuntu...

    • use mmcblk0p7 in the kernel command line instead of the mmcblk1 setting.  dd the resulting kernel .img to /dev/mmcblk0p6
    • for simplicity, I built xf86-video-armsoc right in chrubuntu-- no qemu needed.
    • the uboot-mkimage package is now u-boot-tools
    • manually had to add the built kernel modules to /lib/modules/3.8.11...
    • manually put the xorg libs in /lib/arm-linux-gnueabihf/  Xorg.0.log SEEMS to show them being picked up...  once I have network I'll paste it somewhere.
    • wifi doesn't work as described above, though I did have it working for a second somehow.  At least I saw the SSID pop up and say 'connnected' before everything crashed.  Problems I found so far wifi have included the regulatory domain not being set as well as the wifi modules not loading.  I need the lib80211_crypt_tkip one for example.

    I gotta figure this out too:

    • Really annoying issue:  kernel oopses in dw_mci_pre_dma_transfer.isra.13 that apparently takes out the mmc at seemingly random times.

    Any thoughts, especially on the kernel crasher? Unfortunately I haven't had enough time to track anything down- doing this in pieces when I get random time.