Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey. 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

C++
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'

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?

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

1 solution

hi. so i found the solution. it seems there is a order according to which u should set up opencl support.

even when u are using intel processor, first thing we have to do is install AMDAPP SDK 2.9.
than restart PC
run `clinfo` to confirm that CPU is being detected.
than for GPU, install the AMD 14.4 driver pack x64.
restart and run `clinfo` to confirm that GPU is being detected.

To be able to get header without linking:

sudo cp -r /opt/AMDAPP/include/* /usr/include/

some dependencies

sudo apt-get install libglu1-mesa-dev

than in Eclipse, add the correct lib location and -lOpenCL flag
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900