opencvopenclubuntu-16.04

Using OpenCL with intel UHD graphics on Linux


I am trying to use OpenCV with target OpenCL in a Ubuntu 16.04 system with intel UHD 620 graphics. I have installed ocl-icd-opencl-dev for OpenCL but cv::ocl::haveOpenCL() tells me that I do not have OpenCL

clinfo gives me

Number of platforms                               0

Then I tried installing beignet as this answer proposes. Still cv::ocl::haveOpenCL() tells me that I do not have OpenCL and now clinfo says

Number of platforms                               1
Platform Name                                   Intel Gen OCL Driver
Platform Vendor                                 Intel
Platform Version                                OpenCL 1.2 beignet 1.1.1
Platform Profile                                FULL_PROFILE
Platform Extensions                             cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_spir cl_khr_icd
Platform Extensions function suffix             Intel
beignet-opencl-icd: no supported GPU found, this is probably the wrong opencl-icd package for this hardware

Can anybody help?


Solution

  • ocl-icd-opencl-dev are development files for OCL-ICD loader. You'll need that if you want to develop (compile) against libOpenCL. If you don't want to develop, only use OpenCL programs, then you just need ocl-icd-libopencl1.

    cv::ocl::haveOpenCL() tells me that I do not have OpenCL

    ocl-icd is just a loader; you need an actual implementation. As explained on Khronos:

    The OpenCL Installable Client Driver (ICD) is a mechanism to allow OpenCL implementations from multiple vendors to coexist on a system
    

    Then I tried installing beignet

    beignet is an implementation, but it's too old for your GPU. You need either their proprietary implementation, or Intel NEO.