Another reason for clGetPlatformIDs to fail

Discussion created by nomac on Feb 18, 2011
Latest reply on Feb 18, 2011 by genaganna
Proceed when you get CL_PLATFORM_NOT_FOUND_KHR (-1001), on Linux

Hello everyone,

I finally figured out why OpenCL programs fail to run on the cluster I use. So If you also get CL_PLATFORM_NOT_FOUND_KHR (-1001) and clGetPlatformIDs() fails, even though you have a a correct ICD registration, you might miss some library on which the client driver or depends.

The problem is, that the client driver is somehow loaded at runtime, and it fails in silence if a library is missing or the ICD registration (which is a textfile that specifies to load libatiocl[32|64].so) is wrong. Normally, you would get an error from the operating system if a dynamically linked library like libOpenCL is missing, but the client driver and it's loading mechanism introduces a kind of indirection.

In my case libGLU was missing on the cluster's nodes.

So If your ICD registration is correct and you encouter the type of failure above, you should check the output of (analog for 32 bit):


ldd $ATISTREAMSDKROOT/lib/x86_64/

which reported: => /lib64/ (0x00002ad7a2789000) => /usr/lib64/ (0x00002ad7a298d000) => /usr/lib64/ (0x00002ad7a2c99000) => not found => /lib64/ (0x00002ad7a2f14000) => /usr/lib64/ (0x00002ad7a311d000) => /lib64/ (0x00002ad7a341e000) => /lib64/ (0x00002ad7a36a1000) => /lib64/ (0x00002ad7a38af000) => /lib64/ (0x00002ad7a3aca000)
    /lib64/ (0x0000003961e00000) => /usr/lib64/ (0x00002ad7a3e1d000) => /usr/lib64/ (0x00002ad7a401f000) => /usr/lib64/ (0x00002ad7a4225000) => /usr/lib64/ (0x00002ad7a4436000) => /usr/lib64/ (0x00002ad7a463b000)

Every "not found" means a missing library, against which the driver is linked. After identifying the missing library you only need to find the corresponding package for your distribution and install it. For example:


yum install mesa-libGLU.x86_64

on CentOS, RedHat or Fedora.

I hope this post will help someone not to waste as many hours as I did by narrowing down the problem and fixing it.

It would also be a great idea for the AMD developers to add some helpfull error message to the whole ICD loading mechanism.