2

I just installed the intel opencl sdk on ubuntu 15.10. I am trying to use it and for some reason I am only able to detect the nvidia opencl platform.

#include <CL/cl.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
    cl_uint nids;
    clGetPlatformIDs(0, NULL, &nids);
    printf("Platforms = %d\n", nids);
    cl_platform_id* plat_ids = malloc(sizeof(cl_platform_id) * nids);
    clGetPlatformIDs(nids, plat_ids, NULL);


    for(int i = 0; i < nids; i++)
    {
        char name[1000];
        clGetPlatformInfo(plat_ids[i], CL_PLATFORM_VENDOR, 1000, name, NULL);
        puts(name);
    }
    return 0;
}

This code outputs...

Platforms = 1
NVIDIA Corporation

This seems strange to me because I am not even linking with the nvidia libOpenCL.so. Here is my compile command from eclipse

make all 
Building file: ../main.c
Invoking: GCC C Compiler
gcc -I/opt/intel/intel-opencl-1.2-6.0.0.1049/opencl-1.2-sdk-6.0.0.1049/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.c"
Finished building: ../main.c

Building target: OpenCLTest
Invoking: GCC C Linker
gcc -L/opt/intel/intel-opencl-1.2-6.0.0.1049/opencl-1.2-6.0.0.1049/lib64 -o "OpenCLTest"  ./main.o   -lOpenCL
Finished building target: OpenCLTest

As you can see I only link with the Intel library.

chasep255
  • 11,745
  • 8
  • 58
  • 115
  • Any chance you have an ICD driver installed? – Mats Petersson Mar 05 '16 at 23:04
  • I do i am just starting to figure that out. – chasep255 Mar 05 '16 at 23:04
  • Right, so ICD will allow multiple drivers to pretend to be the "one" driver. This is about AMD, but I believe it applies to "any" ICD compatible driver (except for "where you go to get your driver" of course) – Mats Petersson Mar 05 '16 at 23:09
  • Is your CPU in the list of devices supported by Intel OpenCL implementation? OpenCL ICD (named opencl.dll on Windows, no experience with Linux but libOpenCL.so is probably the one) is not vendor-specific; it simply lists all OpenCL devices which are registered by their drivers. On Windows this information is read from registry; Linux should have something similar. – void_ptr Mar 07 '16 at 16:49

0 Answers0