0
votes

I've been using some OpenCV for a while now and I'm just starting to delve into the multi threading aspects although I'm having some difficulty getting the following code to work:

#include "opencv2/ocl/ocl.hpp"

int main(int argc, char *argv[])
{   
    cv::ocl::DevicesInfo devices;
    cv::ocl::getOpenCLDevices(devices, cv::ocl::CVCL_DEVICE_TYPE_CPU);

    return 0;
}

Returns

OpenCV Error: Gpu API call (-1001) in initializeOpenCLDevices, file /path/to/opencv/src/opencv-2.4.9/modules/ocl/src/cl_context.cpp, line 455

I definitely built OpenCV with OCL, if I go into my build directory it has the lib files: libopencv_ocl.so etc. and I checked with ldd to make sure the executable was linking correctly.

Note: the same thing happens when I try the:

cv::ocl::getOpenCLPlatforms

function.

Thanks in advance

OpenCV OCL API Link

1
Error -1001 indicates that the OpenCL ICD loader failed to find any OpenCL platforms on your system. Which OpenCL platform(s) are you using?jprice
How do I check? I installed OpenCL through ubuntu synaptic package manageruser3102241
Which package did you install? That was probably just the OpenCL ICD loader. You actually need some real OpenCL platforms, e.g. from NVIDIA, Intel or AMD. What device are you trying to run on?jprice
Intel to start me off then I would like to use NVidiauser3102241
The packages I installed were: opencl, opencl-headers, nvidia-opencl-dev and python-pyopencl I can't see any other packages for Inteluser3102241

1 Answers

0
votes

The Intel OpenCL runtime is not available from the Ubuntu package manager; you need to download and install it from their website:

https://software.intel.com/en-us/articles/opencl-drivers#philinux