title: OpenCV 3.1 OpenCL performance on Nvidia GPU
body: <p>I am learning OpenCV and one of the first thing I wanted to do was testing GPU utilization using new transparent API which uses OpenCL.
  So I ran a sample code with using UMat and the CPU usage decreased by half.
  Than I realized it's using my integrated Intel GPU so changed the environment variable OPENCV_OPENCL_DEVICE to :GPU:1 so that it could run on more powerful dedicated nVidia GPU but the result was even worse than using only CPU with Mat and no OpenCL.</p>
  
  <p>Here's my system specifications :</p>
  
  <p>CPU : Intel core-i7 4510U 2.6 - 3.1 GHz</p>
  
  <p>iGPU : Intel HD whith 20 shaders</p>
  
  <p>dGPU : nVidia GeForce 840M with 384 shaders</p>
  
  <p>And the code i ran is :</p>
  
  <pre><code>VideoCapture cap(0);
  if (!cap.isOpened()) return -1;
  UMat frame, edges;
  namedWindow("edges", 1);
  for (;;)
  {
      cap &gt;&gt; frame;
      cvtColor(frame, edges, CV_BGR2GRAY);
      GaussianBlur(edges, edges, Size(7, 7), 1.5, 1.5);
      Canny(edges, edges, 0, 30, 3);
      imshow("edges", edges);
      if (waitKey(33) &gt;= 0) break;
  }
  return 0;
  </code></pre>
  
  <p>When I run the code, CPU and GPU usage is :</p>
  
  <p>No OpneCV : CPU usage 17%</p>
  
  <p>With OpenCV-Intel : CPU usage 5% - GPU usage 9%</p>
  
  <p>With OpenCV-nVidia : CPU usage 38% - GPU usage 9%</p>
  
  <p>I am wondering why the more powerful GPU causes worse results ?</p>