Problem with Opencl implementation in Opencv 3.2

asked 2017-04-05 14:40:03 -0600

Hi all, I am trying to implement Opencl in OpenCV3.2 but i'm confused.

I have 2 graphic cards, ones for Intel and another is AMD,

  1. I download Intel Opencl SDK and install it.
  2. I build Opencv 3.2 using cmake with contrib module and without IPP.

my problem is in the setting system variable that how to do it. I searched google and find this similar question but not realize how to do it. for example they said set system variable as below : OPENCV_OPENCL_DEVICE=":GPU:0". is this means that create a new system variable or user variable? and then?

I also run this simple program and it say that I have opencl:

#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/ocl.hpp>

#include <iostream>
#include <conio.h>

 using namespace std;
 using namespace cv;


 void main()
 {

if (!cv::ocl::haveOpenCL())
{
    cout << "OpenCL is not avaiable..." << endl;
    return;
}


else
{
    cout << "OpenCL is avaiable" << endl;
}
_getch();   

   }

OS: Win7(x64), OpenCV 3.2,Visual Studio 2012

best regard.

edit retag flag offensive close merge delete

Comments

try with this

LBerger gravatar imageLBerger ( 2017-04-06 00:45:09 -0600 )edit

I run the code . but it gives error. here is the error: https://ibb.co/e0R6fa

opencvtrain gravatar imageopencvtrain ( 2017-04-06 01:07:40 -0600 )edit

I cannot testwith AMD card. With my nvidia I can't see dll in oput windows of vs 2015 :

loaded C:\Windows\System32\OpenCL.dll
loaded 'C:\Windows\System32\nvopencl.dll'

Have you got something similar like amdopencl.dll?

LBerger gravatar imageLBerger ( 2017-04-06 01:17:46 -0600 )edit

I have OpenCL.dll, IntelOpenCL64.dll, Intelopencl64_2_1.dll and IntelOpenCLProfiler.dll. I want to implement with Intel not AMD.

opencvtrain gravatar imageopencvtrain ( 2017-04-06 01:30:28 -0600 )edit

I have found a computer with a hd 520 (only one graphics card) and i cannot reproduce your issue. What is graphics card name?

LBerger gravatar imageLBerger ( 2017-04-06 04:53:01 -0600 )edit

In the device Manager --> Display adapter are 2 ; AMD Radeon HD 7450 and Mobile Intel(R) HD Graphics. Is it your question answer?

opencvtrain gravatar imageopencvtrain ( 2017-04-06 04:58:03 -0600 )edit

Can anyone say the steps of running an example of OpenCV using OpenCL in any graphic card? regards.

opencvtrain gravatar imageopencvtrain ( 2017-04-06 06:27:40 -0600 )edit