View Full Version : Open-source libOpenCL.so

06-22-2011, 02:38 AM
I'm part of a group of developers of open-source library for volume data processing. We're using (amongs others) OpenCL for computations on GPUs. We're using openSUSE's Open Build Service (OBS) for creating packages for various Linux distributions. Our problem is that OpenCL drivers are proprietary and thus unavailable at OBS forcing us to omit OpenCL version of the library from building/packaging.

Upon inspecting the OpenCL drivers present at our systems (from AMD & nVidia) we observed, that libOpenCL.so library contains just code for localising of ICD files installed in the system and redirecting the requests to library with real implementation (it seems to do only and just this).

If this library (libOpenCL.so) was to be released as open-source, it would be possible to build and distribute OpenCL applications without need of any proprietary library or application. To execute the OpenCL application, some full-featured implementation of the OpenCL standard would be still necessary.

My question is, whether it would be possible to open-source your code (just this one library - libOpenCL.so)? I have already written to the AMD and they replied that libOpenCL.so is owned by Khronos.

05-15-2012, 10:21 PM
We (the Open Grid Scheduler/Grid Engine http://gridscheduler.sourceforge.net/ project) were looking for the same thing, and we found that libOpenCL.so is based on the ICD Loader specification:

http://www.khronos.org/registry/cl/exte ... hr_icd.txt (http://www.khronos.org/registry/cl/extensions/khr/cl_khr_icd.txt)

One can easily write an open source implementation of it, and in fact we found one at:


- not sure if you granxarixia have already found a solution, but at least others who wanted to do the same thing would benefit. (I was doing ldd, nm, nm -D, strings, gdb, etc... to find out what's inside libOpenCL.so)

- not that we think it is a big deal to link against any closed source libraries, but many Linux distributions don't ship closed source libraries, and that's why I was trying to roll my own!

06-14-2012, 08:29 AM
We implemented a free (BSD Licence) ICD Loader. The project is here:
And I uploaded it into Debian (so it is also available into Ubuntu).

It is based on the specification available here:
http://www.khronos.org/registry/cl/exte ... hr_icd.txt (http://www.khronos.org/registry/cl/extensions/khr/cl_khr_icd.txt)
And missing information have been guessed by observation of current implementation
(all is in the sources, so new functions can easily be added when a non-free ICD Loader implement them)

Feedback and patches welcome.

11-01-2012, 01:29 PM
Of possible interest, we are developing a backward compatible loader (libocl.so) that adds additional features such as allowing ocl.conf files to be more precise in system configuration (/etc/OpenCL/vendors/ remains as a fallback) and supporting OpenCL RPC. Code is part of the COPRTHR SDK. Open-source L/GPLv3 licensed. Current code is available now on our 'current' branch and will be in release version before end of year. https://github.com/browndeer/coprthr

11-01-2012, 02:05 PM
Just a follow-on post - none of the third-party solutions (including ours) are a substitute for an open-source libOpenCL.so reference implementation. We should not have to guess at the call vector order for an open standard. Please release the official loader open-source for 2.0. Thanks.