1

The output of the following program on my machine with ATI Firepro V8750 is as follows:

"Couldn't find any devices:No error" 

(this happens at the call of first clGetDeviceIDs). the error code returned is -30. What does that mean?

I am not able to understand why it is unable to find the device. I have checked that CLinfo.exe lists my GPU along with the Intel CPU I am having. Can some one give my some pointers as to what is wrong here?

Additional info:

AMD APP SK 2.4

Firepro Driver: 8.911.3.3_VistaWin7_X32X64_135673

12-4_vista_win7_32_dd_ccc

Windows 7 Also I must mention that the firePro Driver's some componenets failed to get install.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef MAC
#include <OpenCL/cl.h>
#else
#include <CL/cl.h> 
#endif

int main() {

 /* Host/device data structures */
 cl_platform_id platform;
 cl_device_id *devices;
 cl_uint num_devices, addr_data;
 cl_int i, err;

 /* Extension data */
 char name_data[48], ext_data[4096];

 /* Identify a platform */
 err = clGetPlatformIDs(1, &platform, NULL);            
 if(err < 0) {          
  perror("Couldn't find any platforms");
  exit(1);
  }

  /* Determine number of connected devices */
  err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, NULL, &num_devices);
   if(err < 0) {                
   perror("Couldn't find any devices");
    exit(1);
   }

    /* Access connected devices */
   devices = (cl_device_id*)                    
     malloc(sizeof(cl_device_id) * num_devices);        
   clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU,             
     num_devices, devices, NULL);               

    /* Obtain data for each connected device */
    for(i=0; i<num_devices; i++) {

    err = clGetDeviceInfo(devices[i], CL_DEVICE_NAME,       
        sizeof(name_data), name_data, NULL);            
    if(err < 0) {       
      perror("Couldn't read extension data");
     exit(1);
   }
   clGetDeviceInfo(devices[i], CL_DEVICE_ADDRESS_BITS,  
        sizeof(ext_data), &addr_data, NULL);            

   clGetDeviceInfo(devices[i], CL_DEVICE_EXTENSIONS,        
        sizeof(ext_data), ext_data, NULL);          

   printf("NAME: %s\nADDRESS_WIDTH: %u\nEXTENSIONS: %s", 
        name_data, addr_data, ext_data);
}

free(devices);
return 0;
}

Here is CLINFO output: GPU: enter image description here

CPU: enter image description here

Why are the two highlighted versions different?

Community
  • 1
  • 1
gpuguy
  • 4,607
  • 17
  • 67
  • 125

1 Answers1

2

Could it be that you have multiple OpenCL platforms installed on your system? So, perhaps your first platform is a CPU-only playform, so the query for a GPU device fails.

EDIT:

Here's the problem: The first call to clGetDeviceIDs passes 1 for num_entries, but NULL for the devices pointer. I think you want to pass in 0 for num_entries.

boiler96
  • 1,167
  • 1
  • 8
  • 12
  • I have only one AMD platform. also I changed to sdk 2.4 – gpuguy May 01 '12 at 04:44
  • clGetDeviceIDs(...) returns -30, what does it mean? – gpuguy May 01 '12 at 05:38
  • I just saw in the output of Clinfo that under Device_GPU the version mentioned is:OpenCl 1.0 AMD-APP<923.1>, while under device_CPU... it is OpenCl 1.2 AMD-APP <923.1>. why this is so? – gpuguy May 01 '12 at 06:03
  • Here's the problem: The first call to clGetDeviceIDs passes 1 for num_entries, but NULL for the devices pointer. I think you want to pass in 0 for num_entries. – boiler96 May 01 '12 at 23:26
  • Great, worked!!. But now the program is terminating at first clGetDeviceInfo. I tried changing the size of name_data size but no gain. I am getting CL_INVALID_VALUE error which occurs if param_name is not one of the supported values or if size in bytes specified by param_value_size is < size of return type as specified in table 4.3 and param_value is not a NULL value.: [specification](http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetDeviceInfo.html) – gpuguy May 07 '12 at 04:07
  • Solved: Just increased the size of name_data to 64 it worked now, (though earlier changing the size did not work) – gpuguy May 07 '12 at 04:48