2

I trying to get my OpenCL project compile in Ubuntu. I have a Core i5 and AMD HD 5660 which are both compatible.

when I execute the following code

cl_int status;
// Retrieve the number of platforms
cl_uint numPlatforms = 0;
status = clGetPlatformIDs(0, NULL, &numPlatforms);
if (status != CL_SUCCESS)
{
    std::cout << "Error: Getting platforms!" << std::endl;
    std::cin.get();
}

I get Error: Getting platforms!

When I execute clinfo, I get: terminate called after throwing an instance of 'cl::Error \n what(): clGetPlatformIDs'

I am using AMD driver 14.4 and SDK 2.9 (it is mentioned in AMD installation guide, that setting up these two file will handle registration of icd and environmental variables)

What am I doing wrong that I cannot get my prog working?

Note that I am using Eclipse with correct path to lib (/opt/AMDAPP/lib/x86_64). The program compiles correctly.

EDIT

Installation procedure

  1. first install x64 driver 14.4

  2. i installed AMD-APP-SDK-v2.9-lnx64.tgz (Untar the SDK and than executed sudo ./Install-AMD-APP.sh.) as recommended in the install guide.

  3. validated AMDAPPSDKROOT 'andLD_LIBRARY_PATH` are correct.

  4. created symlink to /usr/lib64/OpenCL/vendors/amd/libOpenCl.so.1 in /use/lib (since it is a x64 bit PC and for some reason opencl looks for x64 driver in /lib)
Milan Jaric
  • 5,556
  • 2
  • 26
  • 34
user3622675
  • 29
  • 1
  • 3
  • What is version of your Ubuntu? – osgx May 10 '14 at 06:56
  • hi, i use ubuntu 13.10 and 14.04. both have the same issue :( – user3622675 May 10 '14 at 07:22
  • And how did you install amd driver and sdk? Are there system (installed via ubuntu's apt-get) amd driver and sdk? – osgx May 10 '14 at 07:24
  • 2
    first install x64 driver 14.4 i installed `AMD-APP-SDK-v2.9-lnx64.tgz` (Untar the SDK and than executed `sudo ./Install-AMD-APP.sh`.) as recommended in the install guide. `AMDAPPSDKROOT` and `LD_LIBRARY_PATH` are correct. created symlink to `/usr/lib/OpenCL/vendors/amd/libOpenCl.so.1` in `/use/lib` – user3622675 May 10 '14 at 07:29
  • 1
    Can you verify that `/etc/OpenCL/vendors/amdocl64.icd` exists and contains the name of a library (probably `libamdocl64.so`) that is in a directory on your `LD_LIBRARY_PATH`? – jprice May 10 '14 at 09:49
  • Did you ever figure out how to get this to work? I'm having the issue myself. – Dr.Knowitall Jun 01 '15 at 01:52
  • What's the value of the status? – Tim Child Jun 13 '15 at 02:28

1 Answers1

-1

I think on at least Ubuntu 15.04, you can just install fglrx or fglrx-updates and dependencies. You can see all the right OpenCL libraries in the core package. I don't think you need the AMD SDK business at all if you have fglrx installed. Andreas gives a lot of useful information.

dpkg -L fglrx-updates-core | grep -v kcl | grep cl
/usr/bin/atiodcli
/usr/bin/clinfo
/usr/lib/libamdocl12cl64.so
/usr/lib/libamdocl64.so
/usr/lib/libaticalcl.so
/usr/lib32/libaticalcl.so
/usr/lib32/libamdocl32.so
/usr/lib32/libamdocl12cl32.so
/etc/OpenCL/vendors/amdocl64.icd

You need to have the flgrx driver loaded and running.

Jack Wasey
  • 3,360
  • 24
  • 43