AnsweredAssumed Answered

Linking clAmdFft with something other than AMDAPPSDK?

Question asked by munsiers on Aug 10, 2012
Latest reply on Aug 10, 2012 by munsiers

I posted this question on stackoverflow, but got nothing.

Basically, I have a program that uses clAmdFft, and I want it to run on arbitrary machines, i.e. AMD GPUs, CPUs and nVidia GPUs. nVidia users will have a that doesn't come with version information for some reason, everything is tagged as "Base" there (as does Intel's library), AMD's library does come with version tags, and since is intended for use with AMDAPP-SDK, it explicitly requires a version.

But that would add a dependency on the AMDAPP-SDK for me, while it should be possible to use Khronos' OpenCL headers and the GPU-driver provided libOpenCL, and only depend on clAmdFft.

$ objdump -x

Dynamic Section:


Version References:

  required from

    0x028568b0 0x00 05 OPENCL_1.0

On one machine, I'm using the AMD driver, which comes with a that includes version information, like this:

a$ objdump -T /opt/AMDAPP/lib/x86_64/

0000000000002610 g    DF .text  0000000000000018  OPENCL_1.0  clGetSamplerInfo

00000000000032e0 g    DF .text  0000000000000018  OPENCL_1.1  clSetEventCallback

0000000000002350 g    DF .text  0000000000000018  OPENCL_1.2  clCreateSubDevices

Everything is fine on this machine.

On another machine, I'm using the nVidia driver, which comes with a that doesn't include version information, like this (same with Intel driver)

b$ objdump -T /usr/lib/ # -> /usr/lib/nvidia-current/

00000000000021f0 g    DF .text  0000000000000018  Base        clGetSamplerInfo

0000000000002a40 g    DF .text  0000000000000018  Base        clSetEventCallback

Linking a program with fails here, since clAmdFft wants to link to the tagged symbols: undefinded reference to `clCreateBuffer@OPENCL_1.0` 

The dynamic linker also generates this complaint:

b$ ldd …/ no version information available …

Since the nVidia driver implements OpenCL 1.1 and AmdFFT only needs 1.0, it should work, if I can convince it that Base = OPENCL_1.0. Is that possible?

I can't force nVidia-users to install another version, since the libOpenCL is part of the driver, like libGL.

Linking with --unresolved-symbols=ignore-in-shared-libs succeeds, but the resulting binary doesn't find the FFT-library anymore.

Since OpenCL splits off the device-dependent parts into ICD libraries, it would work if I supplied the from the AMD driver, even on nVidia machines, where it dynamically loads the correct ICD from /etc/OpenCL/vendors/nvidia.icd, but I'm not sure if this is actually portable, the directory is hard-coded for example.