Ask Your Question

OpenCL Performance (or lack of)

asked 2019-07-26 10:41:38 -0600

Hi, I'm experimenting with the TAPI for OpenCL with OpenCV version 4.1.0. My main approach is to use UMat rather than Mat and see what performance differences exist. So far, it is very disappointing. Pretty much every image processing function I've tried runs slower with UMat than Mat. The only exception I can find is cvtColor() which runs quicker but pretty much everything else is at least twice as slow using the GPU. I've also tried this on different hardware with similar results and on prebuilt and source built OpenCV.

OpenCL is definitely present and running and I can observe the GPU loading when enabled, so I am reasonably certain that my configuration is fine. I'm running Windows 7, MSVC2017, Intel i7-4790 CPU, NVS 510 GPU running OpenCL 1.2 CUDA.

So my question is: Which OpenCV functions actually have a GPU implementation and which types of OpenCV functions are likely to benefit from GPU performance over the CPU?

Ta, Dave

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-07-26 10:46:12 -0600

holger gravatar image

My own experience(highly subjective):

Opencv has the fastest algorithm for running on cpu(high optimized) - if it does not run well there - go for the native solution of your problem using a gpu.

So for me this means i do all my dnn stuff directly on the gpu(using yolo or tensorflow) - for the rest(preprocessing) i use opencv. So i personally just forget about open cl at all.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-07-26 10:41:38 -0600

Seen: 379 times

Last updated: Jul 26 '19