# Processing image stack with CUDA function

**URL:** <https://forum.opencv.org/t/processing-image-stack-with-cuda-function/3316>\
**Category:** Uncategorized\
**Tags:** cuda\
**Created:** [May 13, 2021, 4:17am UTC](https://forum.opencv.org/t/processing-image-stack-with-cuda-function/3316 "2021-05-13T04:17:15Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [May 13, 2021, 1:38pm UTC](https://forum.opencv.org/t/processing-image-stack-with-cuda-function/3316/7 "2021-05-13T13:38:34Z")

</div>

You may find this post useful

> [@OpenCV CUDA extremely slow](https://forum.opencv.org/t/opencv-cuda-extremely-slow/3050):
>
> I made some tests comparing OpenCV performance with some basic operations with or without CUDA. I just threw in a few simple operators: greyscale conversion, thresholding, morphological operators, resizing. To my surprise, the CUDA code was 50-60 times slower than the CPU!!! I tested on my laptop (core i7 vs GeForce MX130) and on a Nvidia Nano (ARM CPU) with similar results. CUDA code took 0.6 sec on my laptop, which is really a lot for a 5MP image. CUDA 10.1/10.2 was used, and OpenCV 4.5.2 w…

Essentially there could be a lot of things at play but I would first try timing the second or third run on the GPU as it should be substantially faster than the first.

Additionally your GPU is on the lower end of Nvidia’s line up. For example an RTX 3080 has ~8x the floating point performance of your card (that’s crazy when compared to a CPU, I would really struggle to find something with 1/8 the performance of an i9). I mention this because you may not see such a great performance increase in going from a top end Intel chip to a low end Nvidia GPU.

---

_[View the full topic](https://forum.opencv.org/t/processing-image-stack-with-cuda-function/3316)._
