Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top