title: Do i need to install Nvidia's SDK(CUDA) for OpenCL to detect Nvidia GPU?
body: <p>I have a code written in C (using opencl specs) to list all the available devices. My PC has an AMD FirePro as well as Nvidia's Tesla graphics card installed. I first installed <a href="http://developer.amd.com/tools-and-sdks/opencl-zone/amd-accelerated-parallel-processing-app-sdk/#" rel="nofollow" title="MD-APP-SDK-v3.0-0.113.50-Beta-linux64.tar.bz2">AMD-APP-SDK-v3.0-0.113.50-Beta-linux64.tar.bz2</a> but it didn't seem to work so thereafter I installed OpenCL™ Runtime 15.1 for Intel® Core™ and Intel® Xeon® Processors for Red Hat* and SLES* Linux* OS (64-bit) &amp; then <a href="https://software.intel.com/en-us/articles/opencl-drivers#sdk" rel="nofollow" title="OpenCL™ Code Builder">OpenCL™ Code Builder</a> .
  But the following code lists only the CPU and does not detect the 2 graphics card. 
  </p>
  
  <pre><code>int main() {
  int i, j;
  char* value;
  size_t valueSize;
  cl_uint platformCount;
  cl_platform_id* platforms;
  cl_uint deviceCount;
  cl_device_id* devices;
  cl_uint maxComputeUnits;
  cl_device_type* dev_type;
  
  // get all platforms
  clGetPlatformIDs(2, NULL, &amp;platformCount);
  platforms = (cl_platform_id*) malloc(sizeof(cl_platform_id) * platformCount);
  clGetPlatformIDs(platformCount, platforms, NULL);
  
  for (i = 0; i &lt; platformCount; i++) {
  
      // get all devices
      clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_ALL, 0, NULL, &amp;deviceCount);
      devices = (cl_device_id*) malloc(sizeof(cl_device_id) * deviceCount);
      clGetDeviceIDs(platforms[i], CL_DEVICE_TYPE_ALL, deviceCount, devices, NULL);
  
  
  
  clGetPlatformInfo(platforms[i], CL_PLATFORM_NAME, 0, NULL, &amp;valueSize);
          value = (char*) malloc(valueSize);
          clGetPlatformInfo(platforms[i], CL_PLATFORM_NAME, valueSize, value, NULL);
          printf("\n%d. Platform: %sn", j+1, value);
          free(value);
  
      // for each device print critical attributes
      for (j = 0; j &lt; deviceCount; j++) {
  
          // print device name
          clGetDeviceInfo(devices[j], CL_DEVICE_NAME, 0, NULL, &amp;valueSize);
          value = (char*) malloc(valueSize);
          clGetDeviceInfo(devices[j], CL_DEVICE_NAME, valueSize, value, NULL);
          printf("\n%d.%d Device: %sn", j+1,1, value);
          free(value);
  
          // print hardware device version
          clGetDeviceInfo(devices[j], CL_DEVICE_TYPE, 0, NULL, &amp;valueSize);
          dev_type = (cl_device_type*) malloc(valueSize);
          clGetDeviceInfo(devices[j], CL_DEVICE_TYPE, valueSize, dev_type, NULL);
          if(*dev_type==CL_DEVICE_TYPE_CPU)
          printf("\nIts a CPU.");
          if(*dev_type==CL_DEVICE_TYPE_GPU)
          printf("\nIts a GPU.");
          if(*dev_type==CL_DEVICE_TYPE_ACCELERATOR)
          printf("\nIts a ACCELERATOR.");
  
          free(dev_type);
  
          // print software driver version
          clGetDeviceInfo(devices[j], CL_DRIVER_VERSION, 0, NULL, &amp;valueSize);
          value = (char*) malloc(valueSize);
          clGetDeviceInfo(devices[j], CL_DRIVER_VERSION, valueSize, value, NULL);
          printf(" \n%d.%d Software version: %sn", j+1, 2, value);
          free(value);
  
  
          // print parallel compute units
          clGetDeviceInfo(devices[j], CL_DEVICE_MAX_COMPUTE_UNITS,
                  sizeof(maxComputeUnits), &amp;maxComputeUnits, NULL);
          printf(" \n%d.%d Parallel compute units: %dn\n", j+1, 4, maxComputeUnits);
  
      }
  
      free(devices);
  
  }
  
  free(platforms);
  return 0;}
  </code></pre>
  
  <p>This is what it returns:</p>
  
  <pre><code>gcc -lOpenCL 1.c -o 1 &amp;&amp; ./1
  1. Platform: AMD Accelerated Parallel Processingn
  1.1 Device: Intel(R) Xeon(R) CPU           X5660  @ 2.80GHzn
  Its a CPU. 
  1.2 Software version: 1642.5 (sse2)n 
  1.4 Parallel compute units: 24n
  </code></pre>
  
  <p>Do I need to install any other driver or is there anything wrong with the code?</p>