# \#gpu

**URL:** https://forum.opencv.org/tag/gpu/209.md

[Latest](https://forum.opencv.org/latest.md) · [Categories](https://forum.opencv.org/categories.md) · [Tags](https://forum.opencv.org/tags.md)

---

## [Why are the supported opencl related functions slower on gpu than on cpu](https://forum.opencv.org/t/why-are-the-supported-opencl-related-functions-slower-on-gpu-than-on-cpu/18174)

<div class="topic-metadata">

**Author:** [@Lurie\_Qian](https://forum.opencv.org/u/Lurie_Qian)\
**Replies:** 0\
**Last updated:** [July 5, 2024, 8:34am UTC](https://forum.opencv.org/t/why-are-the-supported-opencl-related-functions-slower-on-gpu-than-on-cpu/18174 "2024-07-05T08:34:19Z")

</div>

Here is my output of clinfo: Device #0 Name: Mali-G310 r0p0 Type: GPU Version: OpenCL 3.0 r47p0-01eac0.01561d4.3a706e57d4ed330…

---

## [OpenCV+CUDA+VS 2022: fatal error LNK1120: 1 unresolved externals \[opencv\_world.vcxproj\]](https://forum.opencv.org/t/opencv-cuda-vs-2022-fatal-error-lnk1120-1-unresolved-externals-opencv-world-vcxproj/18128)

<div class="topic-metadata">

**Author:** [@StevenW807](https://forum.opencv.org/u/StevenW807)\
**Replies:** 1\
**Last updated:** [July 1, 2024, 7:49am UTC](https://forum.opencv.org/t/opencv-cuda-vs-2022-fatal-error-lnk1120-1-unresolved-externals-opencv-world-vcxproj/18128 "2024-07-01T07:49:18Z")

</div>

Hi, I would like to use CUDA to speed up my OpenCV python script. System: win 11 Hardware: laptop with NVIDIA RTX 2000 Ada Generation I follow this video1 and video2 to setup CUDA. Basically, here are my steps: Inst…

---

## [How to use ocl library for gpu acceleration in opencv？](https://forum.opencv.org/t/how-to-use-ocl-library-for-gpu-acceleration-in-opencv/15506)

<div class="topic-metadata">

**Author:** [@PDLAOZEI](https://forum.opencv.org/u/PDLAOZEI)\
**Replies:** 4\
**Last updated:** [January 29, 2024, 8:40am UTC](https://forum.opencv.org/t/how-to-use-ocl-library-for-gpu-acceleration-in-opencv/15506 "2024-01-29T08:40:44Z")

</div>

I want to deploy OpenCV to achieve image stitching in rk3588. I am verifying how much time difference is required between CPU processing and GPU processing. However, I find that GPU is not used in the process of image…

---

## [Converting UMat to Mat data type takes too long. How to solve this problem](https://forum.opencv.org/t/converting-umat-to-mat-data-type-takes-too-long-how-to-solve-this-problem/16093)

<div class="topic-metadata">

**Author:** [@faning-wang](https://forum.opencv.org/u/faning-wang)\
**Replies:** 0\
**Last updated:** [January 8, 2024, 2:38pm UTC](https://forum.opencv.org/t/converting-umat-to-mat-data-type-takes-too-long-how-to-solve-this-problem/16093 "2024-01-08T14:38:18Z")

</div>

I find that when using the filter2D function, the larger the convolution kernel, the longer it takes to convert from UMat to Mat after filter2D convolution. Why? These are the results of my experiments After 13\*13 convo…

---

## [Can't build OpenCV with CUDA support](https://forum.opencv.org/t/cant-build-opencv-with-cuda-support/16079)

<div class="topic-metadata">

**Author:** [@Leonid\_Usyatinskiy](https://forum.opencv.org/u/Leonid_Usyatinskiy)\
**Replies:** 4\
**Last updated:** [January 8, 2024, 10:00am UTC](https://forum.opencv.org/t/cant-build-opencv-with-cuda-support/16079 "2024-01-08T10:00:53Z")

</div>

Made a lot of efforts with different parameters to build the OpenCV with CUDA support but everytime got the error: FAILED: bin/opencv\_world490.dll lib/opencv\_world490.lib C:\\windows\\system32\\cmd.exe /C “cd . && “C:\\Pr…

---

## [Convert h264 file to mp4 with \`cv::cudacodec\`](https://forum.opencv.org/t/convert-h264-file-to-mp4-with-cv-cudacodec/14313)

<div class="topic-metadata">

**Author:** [@mamsds](https://forum.opencv.org/u/mamsds)\
**Replies:** 27\
**Last updated:** [November 25, 2023, 9:34pm UTC](https://forum.opencv.org/t/convert-h264-file-to-mp4-with-cv-cudacodec/14313 "2023-11-25T21:34:39Z")

</div>

I am experimenting OpenCV’s integration with CUDA (cv::cudacodec) using the official example here. The sample code works. However, it seems to me that the resultant file generated by cv::Ptr\<cv::cudacodec::VideoWriter\> i…

---

## [Pyd python error building cuda gpu windows](https://forum.opencv.org/t/pyd-python-error-building-cuda-gpu-windows/14831)

<div class="topic-metadata">

**Author:** [@Maths\_Electronics\_Tu](https://forum.opencv.org/u/Maths_Electronics_Tu)\
**Replies:** 13\
**Last updated:** [October 13, 2023, 5:47pm UTC](https://forum.opencv.org/t/pyd-python-error-building-cuda-gpu-windows/14831 "2023-10-13T17:47:49Z")

</div>

I followed the tutorial opencv windows 10 cuda gpu, and everything worked perfectly. but inside the build \\ lib\\ no python folder with pyd file , and imprt cv2 , version no attribute error message opencv4.5.1 n python3…

---

## [Can OpenCV process DirectX Texture2D directly on GPU?](https://forum.opencv.org/t/can-opencv-process-directx-texture2d-directly-on-gpu/14791)

<div class="topic-metadata">

**Author:** [@rbaleksandar](https://forum.opencv.org/u/rbaleksandar)\
**Replies:** 4\
**Last updated:** [October 10, 2023, 7:08am UTC](https://forum.opencv.org/t/can-opencv-process-directx-texture2d-directly-on-gpu/14791 "2023-10-10T07:08:34Z")

</div>

Given a Direct3D Texture2D I would like to process it using OpenCV cv::GpuMat. I am currently building 4.7 with CUDA 11.7 and CUDNN 8.9. I am having some difficulties getting around CUDA’s interop with Direct3D 11 hence…

---

## [Is it possible to assign GPU instead of CPU to do algorithms that already implemented inside OpenCV](https://forum.opencv.org/t/is-it-possible-to-assign-gpu-instead-of-cpu-to-do-algorithms-that-already-implemented-inside-opencv/14472)

<div class="topic-metadata">

**Author:** [@Lukita](https://forum.opencv.org/u/Lukita)\
**Replies:** 1\
**Last updated:** [September 7, 2023, 3:00pm UTC](https://forum.opencv.org/t/is-it-possible-to-assign-gpu-instead-of-cpu-to-do-algorithms-that-already-implemented-inside-opencv/14472 "2023-09-07T15:00:19Z")

</div>

Hi all, I’m using a bunch of OpenCV’s algorithms such as SIFT, perspectiveTransform,… The speed of the program is kinda slow despite the result of each algorithm is good. I had read some documents about using GPU (on J…

---

## [Can I get opencv to use gpu on python without using visual studio?](https://forum.opencv.org/t/can-i-get-opencv-to-use-gpu-on-python-without-using-visual-studio/13375)

<div class="topic-metadata">

**Author:** [@giwonkim](https://forum.opencv.org/u/giwonkim)\
**Replies:** 2\
**Last updated:** [May 31, 2023, 6:58pm UTC](https://forum.opencv.org/t/can-i-get-opencv-to-use-gpu-on-python-without-using-visual-studio/13375 "2023-05-31T18:58:20Z")

</div>

Visual studio cannot be used because of the company’s security. I made a Python program using k-means with opencv to cluster colors, but the cpu consumption is too high. Can I use gpu on opencv without visual studio? Pl…

---

## [Help for OpenCV Tracking](https://forum.opencv.org/t/help-for-opencv-tracking/12828)

<div class="topic-metadata">

**Author:** [@muphiri73](https://forum.opencv.org/u/muphiri73)\
**Replies:** 5\
**Last updated:** [April 18, 2023, 11:32am UTC](https://forum.opencv.org/t/help-for-opencv-tracking/12828 "2023-04-18T11:32:02Z")

</div>

I am trying to use the tracking library in OpenCV. Actually, I only get 1-2 FPS. cv::Ptr\<Tracker\> m\_tracker; m\_tracker = TrackerMIL::create(); m\_VideoCap.read(m\_matFrame); m\_tracker-\>init(m\_matFrame, m\_RectROI); iSta…

---

## [Opencv cuda enabled build example for CUDA compute capability 8.9, such as RTX 4090](https://forum.opencv.org/t/opencv-cuda-enabled-build-example-for-cuda-compute-capability-8-9-such-as-rtx-4090/12479)

<div class="topic-metadata">

**Author:** [@puff\_vayne](https://forum.opencv.org/u/puff_vayne)\
**Replies:** 1\
**Last updated:** [March 22, 2023, 9:27am UTC](https://forum.opencv.org/t/opencv-cuda-enabled-build-example-for-cuda-compute-capability-8-9-such-as-rtx-4090/12479 "2023-03-22T09:27:32Z")

</div>

I want to ask how to build opencv with CUDA enabled with some new GPU, such like RTX 4090 which compute capability is 8.9. My building os will be in ubuntu 18.04 or 20.04, or 22.04

---

## [Opencv debayering using pyopencl](https://forum.opencv.org/t/opencv-debayering-using-pyopencl/12166)

<div class="topic-metadata">

**Author:** [@ankit\_kumar](https://forum.opencv.org/u/ankit_kumar)\
**Replies:** 0\
**Last updated:** [February 28, 2023, 11:03am UTC](https://forum.opencv.org/t/opencv-debayering-using-pyopencl/12166 "2023-02-28T11:03:04Z")

</div>

Hi There, I am using python + opencv for getting camera frames (RAW 4K) and debayering using opencv (cv2.cvtColor()). But FPS are around 42 (i7 + RAM 16 GB + 4GB 3050Ti GPU). Anyone please help to increase FPS for 4K d…

---

## [Running detection on GPU using CUDA backend crashes JVM without error](https://forum.opencv.org/t/running-detection-on-gpu-using-cuda-backend-crashes-jvm-without-error/10407)

<div class="topic-metadata">

**Author:** [@tony.wijnhard](https://forum.opencv.org/u/tony.wijnhard)\
**Replies:** 2\
**Last updated:** [October 8, 2022, 4:56pm UTC](https://forum.opencv.org/t/running-detection-on-gpu-using-cuda-backend-crashes-jvm-without-error/10407 "2022-10-08T16:56:00Z")

</div>

I am trying to build openCV 460 from source with cuda support for java. I’ve run thru the build process a million times in the past week and have run out of bright ideas on how to ever get this running so I can start the…

---

## [Reading Video Signal with CPU vs GPU](https://forum.opencv.org/t/reading-video-signal-with-cpu-vs-gpu/9593)

<div class="topic-metadata">

**Author:** [@data](https://forum.opencv.org/u/data)\
**Replies:** 1\
**Last updated:** [July 22, 2022, 10:37am UTC](https://forum.opencv.org/t/reading-video-signal-with-cpu-vs-gpu/9593 "2022-07-22T10:37:04Z")

</div>

Hello, I am still new to OpenCV and CV in general. I have some beginner questions regarding the VideoIO with CPU and GPU: Is it possible to read a video signal directly via the GPU? Does it make sense to do so or is …

---

## [CUDA flag to create a cv::cuda::Stream that supports asynchronous calls](https://forum.opencv.org/t/cuda-flag-to-create-a-cv-stream-that-supports-asynchronous-calls/9542)

<div class="topic-metadata">

**Author:** [@fijoy](https://forum.opencv.org/u/fijoy)\
**Replies:** 1\
**Last updated:** [July 20, 2022, 6:52am UTC](https://forum.opencv.org/t/cuda-flag-to-create-a-cv-stream-that-supports-asynchronous-calls/9542 "2022-07-20T06:52:43Z")

</div>

Do I need to pass any CUDA flags to create a cv::cuda::Stream object that supports asynchronous calls? I see from doc under “Detailed Description” here: https://docs.opencv.org/4.6.0/d9/df3/classcv\_1\_1cuda\_1\_1Stream.ht…

---

## [Qt+OpenCV use cv::ogl::texture2D::copyFrom( cv::cuda::GpuMat) to get texture directly](https://forum.opencv.org/t/qt-opencv-use-cv-copyfrom-cv-gpumat-to-get-texture-directly/9400)

<div class="topic-metadata">

**Author:** [@Touch](https://forum.opencv.org/u/Touch)\
**Replies:** 8\
**Last updated:** [July 7, 2022, 2:29am UTC](https://forum.opencv.org/t/qt-opencv-use-cv-copyfrom-cv-gpumat-to-get-texture-directly/9400 "2022-07-07T02:29:59Z")

</div>

I am writing a module which gets cv::cuda::GpuMat data on gpu and draw it on QOpenGLWidget. To accelarate the speed, I want to avoid downloading data from device to host. This is the main code void MyPainter::drawImage…

---

## [Can I use opencv-python with GPU?](https://forum.opencv.org/t/can-i-use-opencv-python-with-gpu/8947)

<div class="topic-metadata">

**Author:** [@titaniumwhite](https://forum.opencv.org/u/titaniumwhite)\
**Replies:** 1\
**Last updated:** [May 28, 2022, 2:30pm UTC](https://forum.opencv.org/t/can-i-use-opencv-python-with-gpu/8947 "2022-05-28T14:30:58Z")

</div>

Hi everybody, I’n new in using OpenCV. Lately, I joined a big project where they process some images by using opencv-python. I’m trying to optimize this code since it consumes all the CPU memory and I’d like to perform …

---

## [Why some Mats don't need to be uploaded when using GPU?](https://forum.opencv.org/t/why-some-mats-dont-need-to-be-uploaded-when-using-gpu/8716)

<div class="topic-metadata">

**Author:** [@fijoy](https://forum.opencv.org/u/fijoy)\
**Replies:** 1\
**Last updated:** [May 10, 2022, 9:08am UTC](https://forum.opencv.org/t/why-some-mats-dont-need-to-be-uploaded-when-using-gpu/8716 "2022-05-10T09:08:32Z")

</div>

Hello, I’m a newbie researching and experimenting with using OpenCV’s GPU interface. I notice that some Mat arguments to cv::cuda routines need to be uploaded to GPU while some others don’t. Why is that? In cv::cuda::w…

---

## [Utilise 100% GPU resource for YOLO v3 detection using python](https://forum.opencv.org/t/utilise-100-gpu-resource-for-yolo-v3-detection-using-python/7769)

<div class="topic-metadata">

**Author:** [@Shubham\_Chouksey](https://forum.opencv.org/u/Shubham_Chouksey)\
**Replies:** 0\
**Last updated:** [March 2, 2022, 5:07am UTC](https://forum.opencv.org/t/utilise-100-gpu-resource-for-yolo-v3-detection-using-python/7769 "2022-03-02T05:07:53Z")

</div>

Hello @AlexeyAB, thank you for the amazing repo. My System Configuration : I’m working on a Yolov3 model with GeForce RTX 2080 Ti GPU with 11 GB GPU memory and Intel(R) Core™ i9-9900KF CPU with 6 core and 64GB of RAM. W…

---

## [Using opencv on Intel graphics](https://forum.opencv.org/t/using-opencv-on-intel-graphics/7170)

<div class="topic-metadata">

**Author:** [@ELSH](https://forum.opencv.org/u/ELSH)\
**Replies:** 1\
**Last updated:** [January 17, 2022, 1:33pm UTC](https://forum.opencv.org/t/using-opencv-on-intel-graphics/7170 "2022-01-17T13:33:44Z")

</div>

Hello, i’ve been using the Nvidia Jetson for a while now, and i will have access to program on a NUC soon, but the NUC does not have Nvidia GPU, but rather Intel iGPU and i was wondering if it is possible using and runn…

---

## [OpenCV DNN module is slower on GPU than on CPU (Jetson Nano)](https://forum.opencv.org/t/opencv-dnn-module-is-slower-on-gpu-than-on-cpu-jetson-nano/6386)

<div class="topic-metadata">

**Author:** [@trojek](https://forum.opencv.org/u/trojek)\
**Replies:** 2\
**Last updated:** [November 24, 2021, 10:22am UTC](https://forum.opencv.org/t/opencv-dnn-module-is-slower-on-gpu-than-on-cpu-jetson-nano/6386 "2021-11-24T10:22:30Z")

</div>

Hi. I play around with the OpenCV dnn module on both CPU and GPU on Jetson Nano. I make a very similar post on the Nvidia forum Poor performance of CUDA GPU, using OpenCV DNN module - Jetson Nano - NVIDIA Developer Foru…

---

## [Cv::undistort gpu acceleration](https://forum.opencv.org/t/cv-undistort-gpu-acceleration/5721)

<div class="topic-metadata">

**Author:** [@Aros](https://forum.opencv.org/u/Aros)\
**Replies:** 8\
**Last updated:** [October 25, 2021, 8:56pm UTC](https://forum.opencv.org/t/cv-undistort-gpu-acceleration/5721 "2021-10-25T20:56:25Z")

</div>

Hi, in my app I am using camera calibration and I use cv::undistort to compensate for massive barrel distortion of the camera. It works but it’s kind of too slow to be done real-time with acceptable frame-rate. I’d exp…

---

## [Opencv-gpu version and cuda（and cudnn） version？](https://forum.opencv.org/t/opencv-gpu-version-and-cuda-and-cudnn-version/5416)

<div class="topic-metadata">

**Author:** [@nistarlwc](https://forum.opencv.org/u/nistarlwc)\
**Replies:** 0\
**Last updated:** [September 30, 2021, 6:52am UTC](https://forum.opencv.org/t/opencv-gpu-version-and-cuda-and-cudnn-version/5416 "2021-09-30T06:52:09Z")

</div>

Used pytorch 1.8 with cuda10.2 and cudnn8, which version opencv-gpu can install? If another cuda version, how to determine the correspondence between opencv-gpu version and cuda（and cudnn） version？

---

## [SURF GPU with FLANN?](https://forum.opencv.org/t/surf-gpu-with-flann/3109)

<div class="topic-metadata">

**Author:** [@PommePomme](https://forum.opencv.org/u/PommePomme)\
**Replies:** 15\
**Last updated:** [May 4, 2021, 11:34am UTC](https://forum.opencv.org/t/surf-gpu-with-flann/3109 "2021-05-04T11:34:00Z")

</div>

Hi all, I am currently using SURF with the FLANN descriptor, and I would like to test SURF in its GPU version. But I don’t find any informations about FLANN with SURF GPU. Since FLANN use the descriptors function “dete…

---

## [How to use opencv\_traincascade with CUDA](https://forum.opencv.org/t/how-to-use-opencv-traincascade-with-cuda/1433)

<div class="topic-metadata">

**Author:** [@Aki](https://forum.opencv.org/u/Aki)\
**Replies:** 0\
**Last updated:** [February 9, 2021, 2:55am UTC](https://forum.opencv.org/t/how-to-use-opencv-traincascade-with-cuda/1433 "2021-02-09T02:55:43Z")

</div>

Hello everyone, I’m new here. I am developing an application for face recognition using RPi. I would like to train cascade to recognize masked faces using “opencv\_traincascade” on Ubuntu 18.04 with GPU. Is it possible…
