Skip to content

Convolve/matchTemplate very slow with some CUDA versions #3385

Description

@r2d3
System information (version)
  • OpenCV => 4.5.5 and master
  • Operating System / Platform => Ubuntu 20
  • Compiler => g++ 9.4.0
  • CUDA Toolkit => 11.4.4
Detailed description

We observed a slow cv::cuda::matchTemplate with CUDA 11.4.4 due to slow Convolve
It works OK with CUDA 10.1 and CUDA 11.7/11.8

Steps to reproduce
./bin/opencv_perf_cudaarithm --gtest_filter="Sz_KernelSz_Ccorr_Convolve.Convolve/2?"
[ RUN      ] Sz_KernelSz_Ccorr_Convolve.Convolve/20, where GetParam() = (1920x1080, 32, false)
[ PERFSTAT ]    (samples=16   mean=32.96   median=32.56   min=32.04   stddev=0.97 (2.9%))
[       OK ] Sz_KernelSz_Ccorr_Convolve.Convolve/20 (569 ms)
[----------] 1 test from Sz_KernelSz_Ccorr_Convolve (569 ms total)

I have a patch to solve this issue (I will open a PR for it)... after applying the patch

[ RUN      ] Sz_KernelSz_Ccorr_Convolve.Convolve/20, where GetParam() = (1920x1080, 32, false)
[ PERFSTAT ]    (samples=13   mean=1.32   median=1.32   min=1.30   stddev=0.01 (1.1%))
[       OK ] Sz_KernelSz_Ccorr_Convolve.Convolve/20 (82 ms)
[----------] 1 test from Sz_KernelSz_Ccorr_Convolve (82 ms total)
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions