OpenCL on Samsung Chromebook (Chrubuntu OR ChromeOS)

Discussion in 'GPGPU Technology & Programming' started by toddthompson, Feb 18, 2013.

  1. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    Question: How to get OpenCL drivers installed on either Chrubuntu or ChromeOS?

    Background: I am able to successfully compile and execute OpenCL code (using Chrubuntu on sdcard + Mali SDK + Code::Blocks) but every example/sample and simple 'hello, world' app returns an error when using clGetPlatformIDs. The code compiles and runs just fine, but I'm not getting a CL_SUCCESS so I am thinking this must mean there is no proper driver.

    For example,

    cl_int err;
    cl_platform_is platform_id = NULL;
    err = clGetPlatformIDs(1,&platform_id,NULL);

    returns 2123707424

    Any help is appreciated.

    Thanks,

    Todd Thompson

    mhouston,

    This page...

    http://malideveloper.arm.com/develop-for-mali/development-platforms/samsung-chromebook/

    ...implies that the Samsung Chromebook is a "Development Platform" so wouldn't you expect an ICD to be available from somewhere? I am hoping that this is a reasonable assumption and that someone has found or knows a timeframe on the drivers for OpenCL on a Chromebook. It would then be an ideal platform for me to develop,debug and test OpenCL code prior to execution on expensive resources.

    Does that make sense or am I missing something?

    Thanks for responding,

    Todd Thompson
     
  2. mhouston

    mhouston A little of this and that
    Regular

    Joined:
    Oct 7, 2005
    Messages:
    344
    Likes Received:
    38
    Location:
    Cupertino
    Perhaps there is no ICD?
     
  3. Dade

    Newcomer

    Joined:
    Dec 20, 2009
    Messages:
    206
    Likes Received:
    20
    Try to check /etc/OpenCL/vendors directory: there should a text file with the name of the library (i.e. driver) the ICD has to load.
     
  4. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    Dade,

    I can confirm that there is no dir, /etc/OpenCL/

    Even after ARM released a Mali SDK, it appears that Samsung + Google + ARM have not released drivers for it. What's the point? I have no idea. I just want to learn OpenCL on Mali T604. I thought that's what Samsung, ARM, et al. wants us developers to do, exploit their hardware beyond the current sequential programming paradigm.

    If anyone else has any suggestions, I am ready and willing.

    Thanks for responding,

    Todd
     
  5. Dade

    Newcomer

    Joined:
    Dec 20, 2009
    Messages:
    206
    Likes Received:
    20
    It may be still an installation-only issue. You could try to just create a "/etc/OpenCL/vendors/arm.icd" file; the content must be just one line with the name of OpenCL ARM dynamic link library. For instance, this is the content of my "/etc/OpenCL/vendors/amdocl64.icd":

    libamdocl64.so

    where "libamdocl64.so" is a library installed with Catalyst drivers. If you look among the .so installed by ARM SDK , you may able to find the right library.

    I have installed Intel OpenCL driver on my Ubuntu Linux following this trick (Intel directly support RedHat but not Ubuntu).
     
  6. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    Dade,

    I will definitely try that today and post my results.

    Thanks for the suggestion and feedback.

    Cheers,

    Todd

    Dade,

    I created the file and folder as directed and then I ran the following...

    export OPENCL_VENDOR_PATH=/etc/OpenCL/vendors

    For whatever reason it is not effective and I still return the same error code from clGetPlatformIDs.

    Did I miss something?

    Thanks again,

    Todd
     
  7. codedivine

    Regular

    Joined:
    Jan 22, 2009
    Messages:
    271
    Likes Received:
    0
    I am trying to guess here, but lets try this:

    Is there a libGLES_mali.so somewhere in the standard library paths (perhaps /usr/lib or /usr/local/lib)?
     
  8. pgk

    pgk
    Newcomer

    Joined:
    Feb 22, 2013
    Messages:
    3
    Likes Received:
    0
    I'm in the same boat Todd. I have archlinux embedded in user space; or something. This thread (http://beyond3d.com/showthread.php?t=63071) indicates there is already an OpenCL driver (libGLES_mali.so) in the Nexus 10. Alas the post author, bearon, avoids a thorough explanation.

    As for the chromebook, libEGL.so, libmali.so, and libGLESv2.so are all there in /usr/lib/. I tried running:
    nm -D /mnt/Downloads/xxxx.so | grep -i cl
    but none show any OpenCL function names.

    By the way, running file on these reports: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically BuildID[sha1]=0x175b882333ff60877cbef81e1bc5f9cc864246d3, stripped

    I wonder what libGLES_mali.so from the Nexus 10 would report?
     
  9. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    codedevine,

    libmali.so, libgl.so both exist but not a lib with both GL and mali in filename

    I found these both in ChromeOS /usr/lib/

    Chrubuntu does not have these installed by default and the Mali SDK does not include anything like it either

    I think I'm going to have to try PortableCL and/or Co-Processing Threads SDK

    https://launchpad.net/pocl

    https://github.com/browndeer/coprthr

    I wish someone had already done this in advance, although it would be fun to be the first to make it work

    Thanks
     
  10. bearon

    Newcomer

    Joined:
    Feb 13, 2013
    Messages:
    4
    Likes Received:
    0
    It could be worth checking whether ChromeOS's libmali.so has entry points for OpenCL functions.
     
  11. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    bearon,

    I'm not sure how to do this on ChromeOS but I searched and found this...

    http://echelog.com/logs/browse/chromium-os/1360710000

    They mention just one OpenCL function is in libmali.so.

    Feel free to provide more info if you think I can test in ChromeOS.

    Thanks
     
  12. pgk

    pgk
    Newcomer

    Joined:
    Feb 22, 2013
    Messages:
    3
    Likes Received:
    0
    I replied on this topic last week, but somehow it hasn't appeared. Basically I have an embedded archlinux on my Samsung Chromebook. I used nm -D to look at the symbols in libmali.so, but found no OpenCL references - including opencl_rewrite_image_sampler. Could we see the output of nm on the libGLES_mali.so from the Nexus 10?

    $ nm -D /mnt/Downloads/libmali.so | grep cl
    U clock_gettime
    U close
    U dlclose
    U fclose
    0003abc8 T osu_noninline_dlclose
    0003ab50 T osu_noninline_sync_object_clear
     
  13. Rys

    Rys PowerVR
    Moderator Veteran Alpha

    Joined:
    Oct 9, 2003
    Messages:
    4,156
    Likes Received:
    1,433
    Location:
    Beyond3D HQ
    Was there any doubt it was there? Et voila...

    Code:
    $ nm -D libGLES_mali.so | grep "T cl"
    001966fc T clBuildProgram
    00195670 T clCreateBuffer
    001953c0 T clCreateCommandQueue
    00195138 T clCreateContext
    00195218 T clCreateContextFromType
    00195a60 T clCreateImage2D
    00195cb0 T clCreateImage3D
    00196910 T clCreateKernel
    00196988 T clCreateKernelsInProgram
    0019652c T clCreateProgramWithBinary
    00196458 T clCreateProgramWithSource
    001962b0 T clCreateSampler
    001957a8 T clCreateSubBuffer
    00196df8 T clCreateUserEvent
    001993a0 T clEnqueueBarrier
    001978b4 T clEnqueueCopyBuffer
    00197a88 T clEnqueueCopyBufferRect
    001984f8 T clEnqueueCopyBufferToImage
    00197f2c T clEnqueueCopyImage
    0019826c T clEnqueueCopyImageToBuffer
    00198788 T clEnqueueMapBuffer
    0019896c T clEnqueueMapImage
    001992d8 T clEnqueueMarker
    00198d3c T clEnqueueNDRangeKernel
    00199038 T clEnqueueNativeKernel
    0019706c T clEnqueueReadBuffer
    001971d4 T clEnqueueReadBufferRect
    00197dec T clEnqueueReadImage
    00198f38 T clEnqueueTask
    00198c28 T clEnqueueUnmapMemObject
    00199324 T clEnqueueWaitForEvents
    00197490 T clEnqueueWriteBuffer
    001975f8 T clEnqueueWriteBufferRect
    00197e8c T clEnqueueWriteImage
    0019702c T clFinish
    00196fec T clFlush
    00195560 T clGetCommandQueueInfo
    00195364 T clGetContextInfo
    00195034 T clGetDeviceIDs
    001950dc T clGetDeviceInfo
    00196d98 T clGetEventInfo
    00196f90 T clGetEventProfilingInfo
    001993e0 T clGetExtensionFunctionAddress
    001961c0 T clGetImageInfo
    00196c00 T clGetKernelInfo
    00196c60 T clGetKernelWorkGroupInfo
    00196164 T clGetMemObjectInfo
    00194f9c T clGetPlatformIDs
    00194fec T clGetPlatformInfo
    00196874 T clGetProgramBuildInfo
    00196814 T clGetProgramInfo
    001963f8 T clGetSamplerInfo
    00195ff8 T clGetSupportedImageFormats
    00195520 T clReleaseCommandQueue
    00195324 T clReleaseContext
    00196e9c T clReleaseEvent
    00196a14 T clReleaseKernel
    00195fb8 T clReleaseMemObject
    001966bc T clReleaseProgram
    001963b8 T clReleaseSampler
    001954e0 T clRetainCommandQueue
    001952e4 T clRetainContext
    00196e5c T clRetainEvent
    001969d4 T clRetainKernel
    00195f78 T clRetainMemObject
    0019667c T clRetainProgram
    00196378 T clRetainSampler
    001955c0 T clSetCommandQueueProperty
    00196f38 T clSetEventCallback
    00196a54 T clSetKernelArg
    00196264 T clSetMemObjectDestructorCallback
    00196edc T clSetUserEventStatus
    0019417c T clUnloadCompiler
    00196d54 T clWaitForEvents
     
  14. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    Rys,

    So it looks like Nexus 10 is the only Mali consumer platform that is OpenCL "ready". I now have a $249 paperweight that will get donated to a family member.

    Are you running a terminal from Android or on a linux distro? If linux, what has been your experience? Is there a clamshell keyboard case available?

    It looks like the Nexus 10 is my next target platform.

    Thanks,

    Todd
     
  15. Dade

    Newcomer

    Joined:
    Dec 20, 2009
    Messages:
    206
    Likes Received:
    20
  16. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    Dade,

    Yes, my goal to is to have a "perfect" mobile platform to develop, test and debug OpenCL applications prior to execution on large scale compute platforms (remote). So, I chose Samsung Chromebook because of supposed OpenCL support in Mali SDK but ARM+Google+Samsung has not released drivers for Chromebook.

    It's very frustrating to be stopped by this obstacle considering how easy it is to resolve if ARM+Google+Samsung chose to help...if Nexus 10 gets OpenCL drivers, why not Chromebook?

    Pgk,

    Please let me know if you make any progress...thanks.

    todd(dot)thompson(at)utdallas(dot)edu
     
  17. tuna

    Veteran

    Joined:
    Mar 10, 2002
    Messages:
    3,142
    Likes Received:
    359
    Isn't there someone making free drivers for mali graphic chips?
     
  18. toddthompson

    Newcomer

    Joined:
    Feb 18, 2013
    Messages:
    8
    Likes Received:
    0
    tuna,

    There are DDKs and SDKs available for the Mali platform from ARM, however my issue is that they (Samsung+Google) have not compiled an OpenCL driver for ARM-based linux or ChromeOS.

    I am looking into generic OpenCL drivers like PoCL and COPRTHR but I have not had the time to invest yet.

    I'm hoping that someone has/will implement.

    Thanks,

    Todd
     
  19. tuna

    Veteran

    Joined:
    Mar 10, 2002
    Messages:
    3,142
    Likes Received:
    359
    Why do you need a compiled driver? Can't you compile it yourself?
     
  20. pgk

    pgk
    Newcomer

    Joined:
    Feb 22, 2013
    Messages:
    3
    Likes Received:
    0
    Hi Todd,

    The Nexus 4 and also the Sony Xperia Z (Qualcomm chipset) are also now found to have OpenCL. I think there are even benchmarks available for them on the OpenCLBecnhmarks website (I forget the url).

    One suggestion you may consider if you're keen, is to switch from the stable ChromeOS update stream. There are three such channels - roughly Stable; Beta and Unstable. It occurs to me that if the drivers were to be made available, they might appear there first?

    I'll keep an eye on this thread.

    Cheers,
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...