cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

musa
Journeyman III

Error Getting Platform OpenCL

hi ,

my system configuration is

Ubuntu 14.04

no Gpu

intel i5 processor 3rd generation

RAM 4GB

using opencl -> AMDAPPSDK-3.0

I am new into OpenCL. i ran a simple program to check the no. of platform got error.

CODE:

#include <CL/cl.h>

#include <string.h>

#include <stdio.h>

#include <stdlib.h>

#include <iostream>

#include <string>

#include <fstream>

#define SUCCESS 0

#define FAILURE 1

using namespace std;

int main()

{

    /*Step1: Getting platforms and choose an available one.*/

    cl_uint numPlatforms;    //the NO. of platforms

    cl_platform_id platform = NULL;    //the chosen platform

    cl_int    status = clGetPlatformIDs(0, NULL, &numPlatforms);

    cout << "No ofPlatforms: "<< numPlatforms<<endl;

    if (status < 1)

    {

        cout << "Error: Getting platforms!" << endl;

        return FAILURE;

    }

}

ERROR:

Error: Getting platforms!

KINDLY PROVIDE SOME SOLUTION TO THIS.

0 Likes
11 Replies
dipak
Big Boss

Hi Sumit,

After installing the APP  SDK, did you check the clinfo output? If not, please check and share your observation.

cl_int    status = clGetPlatformIDs(0, NULL, &numPlatforms);
...
if (status < 1) { ...}

Btw, above statements are not the correct way to check the error. The value of CL_SUCCESS, which means that function is executed successfully, is 0 (zero). So, it satisfies your error checking condition too.

Regards,

0 Likes
musa
Journeyman III

Hi Deepak,

Thanks for looking into the problem.

yes i have checked the output of CLINFO: output was and is

$ clinfo

terminate called after throwing an instance of 'cl::Error'

  what():  clGetPlatformIDs

Aborted (core dumped)

Content of my .bashrc file:

export LD_LIBRARY_PATH=/home/roadeo/AMDAPPSDK-3.0/lib/x86_64/

export AMDAPPSDKROOT="/home/roadeo/AMDAPPSDK-3.0"

export OPENCL_VENDOR_PATH="/etc/OpenCL/vendors/"

inside vendor folder i have amdocl64.icd file and the file has libamdocl64.so.

0 Likes

Hi,

It seems that the application is unable to load the required libraries. It might be an installation issue.

It looks like you've installed the SDK as non-root user. Please run the clinfo (or application) with sudo and check [just for debugging purpose only].

Anyway, I would suggest you to perform a fresh installation (remove the driver also if any) and see whether you still observe the issue or not.

Regards,

0 Likes
musa
Journeyman III

this is the error when i do sudo clinfo

I: ICD loader reports no usable platforms

0 Likes
musa
Journeyman III

AFTER FRESH INSTALLATION THIS ERROR OCCURRED::

clinfo: error while loading shared libraries: libOpenCL.so.1: cannot open shared object file: No such file or directory

0 Likes

This looks similar to the broken link issues reported here:

OpenCL SDK 3.0 installs with a broken link

AMD DEVS - bug in AMDAPPSDK-3.0 Installer (linux x64)? 

As a quick workaround, could you please try the solutions described there and let me know whether those steps work for you or not? Accordingly I'll check with the installer team for their suggestions.

Regards,

0 Likes
musa
Journeyman III

ok i will let you know

0 Likes
musa
Journeyman III

when i installed ocl-icd-dev this library issue is solved.

But again when i tried clinfo i got this error:

clinfo

terminate called after throwing an instance of 'cl::Error'

  what():  clGetPlatformIDs

Aborted (core dumped)

roadeo@roadeo:~$ sudo clinfo

[sudo] password for roadeo:

terminate called after throwing an instance of 'cl::Error'

  what():  clGetPlatformIDs

0 Likes

Okay. Let me try the same at my end and I'll come back to you shortly.

Regards,

0 Likes
musa
Journeyman III

Hi Deepak ,

i tried installing prevision version of AMD-SDK 2.8 and its working fine. The problem is something with the 3.0. SDK.

Thanks for your support.

0 Likes

I also observed the similar problem with APP SDK 3.0. I've reported the same to the concerned team.

Regards,

0 Likes