# \#opencl

**URL:** https://forum.opencv.org/tag/opencl/196.md

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

---

## [Opencv4 on arm64,a problem with using UMat](https://forum.opencv.org/t/opencv4-on-arm64-a-problem-with-using-umat/19555)

<div class="topic-metadata">

**Author:** [@eric.t](https://forum.opencv.org/u/eric.t)\
**Replies:** 2\
**Last updated:** [December 18, 2024, 9:24am UTC](https://forum.opencv.org/t/opencv4-on-arm64-a-problem-with-using-umat/19555 "2024-12-18T09:24:36Z")

</div>

I want to use the GPU to speed up the code and then try to use UMat.It’s right at first, then after dozens of times, it slowed down,why? CODE: int OclTest(void ) { int size = 2000; Mat mat(size, size, CV\_8UC1, cv::S…

---

## [Clarification on CALL\_HAL Usage in pyrDown and Handling of ROIs in OpenCV](https://forum.opencv.org/t/clarification-on-call-hal-usage-in-pyrdown-and-handling-of-rois-in-opencv/19265)

<div class="topic-metadata">

**Author:** [@Shyama7004](https://forum.opencv.org/u/Shyama7004)\
**Replies:** 2\
**Last updated:** [November 14, 2024, 7:31pm UTC](https://forum.opencv.org/t/clarification-on-call-hal-usage-in-pyrdown-and-handling-of-rois-in-opencv/19265 "2024-11-14T19:31:04Z")

</div>

Hello OpenCV community, I am working on understanding and potentially modifying the pyrDown function in OpenCV to ensure consistent behaviour when processing different regions of interest (ROIs). In particular, I’ve obs…

---

## [Unable to get hardware acceleration for YuNet on Windows in Python-Opencv](https://forum.opencv.org/t/unable-to-get-hardware-acceleration-for-yunet-on-windows-in-python-opencv/18551)

<div class="topic-metadata">

**Author:** [@nullbyte](https://forum.opencv.org/u/nullbyte)\
**Replies:** 4\
**Last updated:** [August 22, 2024, 11:27am UTC](https://forum.opencv.org/t/unable-to-get-hardware-acceleration-for-yunet-on-windows-in-python-opencv/18551 "2024-08-22T11:27:08Z")

</div>

Hi there, I’m building a small project around opencv in Python. The goal is to do some exploration around computer vision inside a custom made python library. I have also built a small GUI that use that library to explo…

---

## [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…

---

## [Using OpenCL on Image processing. Error in WarpAffine](https://forum.opencv.org/t/using-opencl-on-image-processing-error-in-warpaffine/18125)

<div class="topic-metadata">

**Author:** [@juan1](https://forum.opencv.org/u/juan1)\
**Replies:** 6\
**Last updated:** [July 3, 2024, 5:39pm UTC](https://forum.opencv.org/t/using-opencl-on-image-processing-error-in-warpaffine/18125 "2024-07-03T17:39:35Z")

</div>

Hi, First of all saying that I’m not an OpenCv expert… As I have been reading using object UMat instead of Mat, OpenCv will use GPU for image processing instaed of CPU whitch is used when you use Mat objects. My GPU i…

---

## [Confused about OpenCL & dnn backends](https://forum.opencv.org/t/confused-about-opencl-dnn-backends/17951)

<div class="topic-metadata">

**Author:** [@\_Kelvin](https://forum.opencv.org/u/_Kelvin)\
**Replies:** 0\
**Last updated:** [June 15, 2024, 3:15pm UTC](https://forum.opencv.org/t/confused-about-opencl-dnn-backends/17951 "2024-06-15T15:15:55Z")

</div>

Hi, this is my first post and I’m very new to OpenCV and Python. Im getting confused about if/how I could use my container hosts Intel iGPU (Core i5 14500) in my code which is all about face detection and recognition fr…

---

## [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…

---

## [How to build opencv for mali GPU in arm](https://forum.opencv.org/t/how-to-build-opencv-for-mali-gpu-in-arm/16110)

<div class="topic-metadata">

**Author:** [@carrierjoy](https://forum.opencv.org/u/carrierjoy)\
**Replies:** 0\
**Last updated:** [January 10, 2024, 8:43am UTC](https://forum.opencv.org/t/how-to-build-opencv-for-mali-gpu-in-arm/16110 "2024-01-10T08:43:50Z")

</div>

I want to use opencv in 3399 board, My os is ubuntu 18.04, but the GPU can not be invoked by umat, Wich opencv version is OK in the offical Release, or How to build to invoke GPU.

---

## [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…

---

## [UMat to Mat, how can I save time?](https://forum.opencv.org/t/umat-to-mat-how-can-i-save-time/16042)

<div class="topic-metadata">

**Author:** [@faning-wang](https://forum.opencv.org/u/faning-wang)\
**Replies:** 0\
**Last updated:** [January 4, 2024, 7:15am UTC](https://forum.opencv.org/t/umat-to-mat-how-can-i-save-time/16042 "2024-01-04T07:15:57Z")

</div>

When I convert Mat to UMat type data in the program, it basically takes no time to convert, but the conversion of UMat matrix to Mat matrix is very time-consuming (from gpu to cpu). Is there any way to speed up or save t…

---

## [OpenCV and iGPU shared memory](https://forum.opencv.org/t/opencv-and-igpu-shared-memory/4434)

<div class="topic-metadata">

**Author:** [@cheetahran](https://forum.opencv.org/u/cheetahran)\
**Replies:** 2\
**Last updated:** [November 11, 2022, 8:41pm UTC](https://forum.opencv.org/t/opencv-and-igpu-shared-memory/4434 "2022-11-11T20:41:57Z")

</div>

For the widely used systems equipped with the Intel® Processor Graphics (iGPU) Intel promotes the „zero copy“ shared use of system memory in CPU and iGPU as described in Getting the Most from OpenCL™ 1.2: How to Increase…

---

## [Deadlock occures at unloading opencv\_world481.dll (win-x64) after dnn usage; OpenCL target on Intel UHD 750](https://forum.opencv.org/t/deadlock-occures-at-unloading-opencv-world481-dll-win-x64-after-dnn-usage-opencl-target-on-intel-uhd-750/15927)

<div class="topic-metadata">

**Author:** [@PeterBP](https://forum.opencv.org/u/PeterBP)\
**Replies:** 0\
**Last updated:** [December 21, 2023, 7:09pm UTC](https://forum.opencv.org/t/deadlock-occures-at-unloading-opencv-world481-dll-win-x64-after-dnn-usage-opencl-target-on-intel-uhd-750/15927 "2023-12-21T19:09:56Z")

</div>

Hi All, Our C++ program runs correctly (win-x64) but at the end (unloading opencv dll) there is a deadlock, callstack: ntdll.dll!NtWaitForSingleObject() Unknown KernelBase.dll!WaitForSingleObjectEx() Unknown …

---

## [convertFromD3D11Texture2D throws OpenCL: Context initilized without DirectX interoperability](https://forum.opencv.org/t/convertfromd3d11texture2d-throws-opencl-context-initilized-without-directx-interoperability/15700)

<div class="topic-metadata">

**Author:** [@carl958491](https://forum.opencv.org/u/carl958491)\
**Replies:** 0\
**Last updated:** [December 1, 2023, 6:22am UTC](https://forum.opencv.org/t/convertfromd3d11texture2d-throws-opencl-context-initilized-without-directx-interoperability/15700 "2023-12-01T06:22:06Z")

</div>

cv::directx::convertFromD3D11Texture2D(ID3D11Texture2D \* pD3D11Texture2D, OutputArray dst) It seems that there is a problem with the creation of the context. Can anyone tell me what I should do. The version of opencv …

---

## [Application built with OpenCV 4.3 and openCL 1.2 failed to exit at the end](https://forum.opencv.org/t/application-built-with-opencv-4-3-and-opencl-1-2-failed-to-exit-at-the-end/7396)

<div class="topic-metadata">

**Author:** [@khtran](https://forum.opencv.org/u/khtran)\
**Replies:** 3\
**Last updated:** [November 19, 2023, 12:48pm UTC](https://forum.opencv.org/t/application-built-with-opencv-4-3-and-opencl-1-2-failed-to-exit-at-the-end/7396 "2023-11-19T12:48:51Z")

</div>

My company has a Windows application that uses Deep Neural Network and computer vision for image segmentation. The application employs OpenCV and OpenCL and has been running fine until recently we upgrade our OpenCV to v…

---

## [Use NVIDIA GeForce RTX 3070 run opencl version of cv::dft error](https://forum.opencv.org/t/use-nvidia-geforce-rtx-3070-run-opencl-version-of-cv-dft-error/15508)

<div class="topic-metadata">

**Author:** [@tenglike](https://forum.opencv.org/u/tenglike)\
**Replies:** 0\
**Last updated:** [November 14, 2023, 11:22am UTC](https://forum.opencv.org/t/use-nvidia-geforce-rtx-3070-run-opencl-version-of-cv-dft-error/15508 "2023-11-14T11:22:20Z")

</div>

I use NVIDIA GeForce RTX 3070 run opencl version of cv::dft, the code as follows. And I got error when image size is big. Mat img0 = imread("LenaGRAY.bmp", 0); resize(img0, img0, Size(8000, 4000)); img0.convertTo(img0, …

---

## [How to initialize cv::UMat by using data pointer?](https://forum.opencv.org/t/how-to-initialize-cv-umat-by-using-data-pointer/14594)

<div class="topic-metadata">

**Author:** [@tenglike](https://forum.opencv.org/u/tenglike)\
**Replies:** 4\
**Last updated:** [November 8, 2023, 6:24am UTC](https://forum.opencv.org/t/how-to-initialize-cv-umat-by-using-data-pointer/14594 "2023-11-08T06:24:57Z")

</div>

I have opencl, I don’t now how to allocate memory on device and initialize cv::UMat with data pointer. I can’t find the function to do this initialization.

---

## [OpenCL api not functioning on NVIDIA Jetson Orin](https://forum.opencv.org/t/opencl-api-not-functioning-on-nvidia-jetson-orin/13879)

<div class="topic-metadata">

**Author:** [@rmarlborough](https://forum.opencv.org/u/rmarlborough)\
**Replies:** 1\
**Last updated:** [July 16, 2023, 8:43pm UTC](https://forum.opencv.org/t/opencl-api-not-functioning-on-nvidia-jetson-orin/13879 "2023-07-16T20:43:05Z")

</div>

hasOpenCL() returns 0 even though OpenCV is built with use\_opencl flag turned on. using jetson orin with jetpack 5.1.1, opencl 1.2 and opencv 4.8. The same goes for python. cv2.ocl.hasOpenCL() returns 0 in python also.

---

## [Error during build, OpenCL kernels core](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503)

<div class="topic-metadata">

**Author:** [@esanchez](https://forum.opencv.org/u/esanchez)\
**Replies:** 6\
**Last updated:** [June 22, 2023, 5:30pm UTC](https://forum.opencv.org/t/error-during-build-opencl-kernels-core/13503 "2023-06-22T17:30:41Z")

</div>

Hello evenryone, I’m trying to use the OpenCV with cuda, but i can manage to build the OpenCV through CMake, but the Build processo finishes with many erros like: D:\\Program Files\\Microsoft Visual Studio\\2022\\Enterpri…

---

## [Usage of UMat and Mat](https://forum.opencv.org/t/usage-of-umat-and-mat/4828)

<div class="topic-metadata">

**Author:** [@Mustafa\_Bay](https://forum.opencv.org/u/Mustafa_Bay)\
**Replies:** 6\
**Last updated:** [April 24, 2023, 3:13pm UTC](https://forum.opencv.org/t/usage-of-umat-and-mat/4828 "2023-04-24T15:13:26Z")

</div>

Hi Everyone, I am using OpenCV 4.1.2 and I want to understand usage of UMat and Mat. I wonder that when I retrieve an UMat from Mat by using getUMat() function, what happen if I make a change on UMat. Is Mat changed at …

---

## [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…

---

## [OpenCV's T-API facedetect.cpp sample is hella slow and CPU intensive with OpenCL "on"](https://forum.opencv.org/t/opencvs-t-api-facedetect-cpp-sample-is-hella-slow-and-cpu-intensive-with-opencl-on/10189)

<div class="topic-metadata">

**Author:** [@Unix\_Man](https://forum.opencv.org/u/Unix_Man)\
**Replies:** 4\
**Last updated:** [November 14, 2022, 7:13pm UTC](https://forum.opencv.org/t/opencvs-t-api-facedetect-cpp-sample-is-hella-slow-and-cpu-intensive-with-opencl-on/10189 "2022-11-14T19:13:29Z")

</div>

Hello, The “ufacedetect.cpp” from T-API folder in samples folder runs super slow after compilation. When running the compiled code, OpenCL can be seen displayed as “ON” while running the compiled code. There is no diffe…

---

## [Create official samples from advanced OpenCL-Interop demos (VAAPI/OpenGL)](https://forum.opencv.org/t/create-official-samples-from-advanced-opencl-interop-demos-vaapi-opengl/10915)

<div class="topic-metadata">

**Author:** [@kallaballa](https://forum.opencv.org/u/kallaballa)\
**Replies:** 0\
**Last updated:** [November 11, 2022, 8:09pm UTC](https://forum.opencv.org/t/create-official-samples-from-advanced-opencl-interop-demos-vaapi-opengl/10915 "2022-11-11T20:09:08Z")

</div>

Hi! I have written a bunch of well crafted demos that show how to write OpenCV programs that run mostly (the part that matters) on the GPU using OpenCL interop. For the moment they rely on my OpenCV 4.x fork (refere to …

---

## [Why does convertFromImage copy image data?](https://forum.opencv.org/t/why-does-convertfromimage-copy-image-data/8774)

<div class="topic-metadata">

**Author:** [@Patman1](https://forum.opencv.org/u/Patman1)\
**Replies:** 0\
**Last updated:** [May 13, 2022, 7:30pm UTC](https://forum.opencv.org/t/why-does-convertfromimage-copy-image-data/8774 "2022-05-13T19:30:48Z")

</div>

Hey everyone, I am wondering about the decision to have cv::ocl::convertFromImage copy the image data into a new OpenCL buffer owned by a cv::UMat whereas cv::ocl::convertFromBuffer simply attaches the cl\_mem buffer to a…

---

## [Compile OpenCL kernels offline](https://forum.opencv.org/t/compile-opencl-kernels-offline/8315)

<div class="topic-metadata">

**Author:** [@lz1004](https://forum.opencv.org/u/lz1004)\
**Replies:** 0\
**Last updated:** [April 8, 2022, 5:45am UTC](https://forum.opencv.org/t/compile-opencl-kernels-offline/8315 "2022-04-08T05:45:23Z")

</div>

Is it possible to compile OpenCV’s OpenCL kernels offline? I need it, because my OpenCL (beignet 1.3) online compiler is simply too large for my embedded linux system.

---

## [Switch cv::ocl context](https://forum.opencv.org/t/switch-cv-ocl-context/7184)

<div class="topic-metadata">

**Author:** [@thehypermodernist](https://forum.opencv.org/u/thehypermodernist)\
**Replies:** 0\
**Last updated:** [January 18, 2022, 2:29pm UTC](https://forum.opencv.org/t/switch-cv-ocl-context/7184 "2022-01-18T14:29:37Z")

</div>

I am trying to understand the opencl context creation and memory allocation order. If I have a (pseudo)code of the following sequence cv::UMat oldMat; cl\_context\_properties props = {glxSharingContextForLinuxCallsHere(…

---

## [How to use custom OpenCL Queue for TAPI](https://forum.opencv.org/t/how-to-use-custom-opencl-queue-for-tapi/4491)

<div class="topic-metadata">

**Author:** [@logan](https://forum.opencv.org/u/logan)\
**Replies:** 1\
**Last updated:** [July 30, 2021, 10:26pm UTC](https://forum.opencv.org/t/how-to-use-custom-opencl-queue-for-tapi/4491 "2021-07-30T22:26:20Z")

</div>

I’m using OpenCV 4.5.2. When you use the OpenCV CUDA API you’re able to wrap a cudaStream\_t with cv::cuda::StreamAccessor::wrapStream(\<cudaStream\_t pointer\>) and all of the cv::cuda:: API takes a cv::cuda::Stream. This l…

---

## [Functions best suited for OpenCL UMat Transparent API use](https://forum.opencv.org/t/functions-best-suited-for-opencl-umat-transparent-api-use/4419)

<div class="topic-metadata">

**Author:** [@ehardin](https://forum.opencv.org/u/ehardin)\
**Replies:** 4\
**Last updated:** [July 22, 2021, 6:50pm UTC](https://forum.opencv.org/t/functions-best-suited-for-opencl-umat-transparent-api-use/4419 "2021-07-22T18:50:53Z")

</div>

I am in the process of porting from C-API OCV 2.4 to OCV 3.4 C++ API and want to take advantage of UMat and the OpenCL Transparent API. Has anyone ever compiled a list of the functions that would probably best be suite…

---

## [Using OpenCL with DNN on M1 Mac](https://forum.opencv.org/t/using-opencl-with-dnn-on-m1-mac/2517)

<div class="topic-metadata">

**Author:** [@kevin](https://forum.opencv.org/u/kevin)\
**Replies:** 4\
**Last updated:** [May 25, 2021, 6:16pm UTC](https://forum.opencv.org/t/using-opencl-with-dnn-on-m1-mac/2517 "2021-05-25T18:16:53Z")

</div>

I am new to using OpenCV. I have a python script that uses the DNN to do some video processing and it does not use the GPU when running. I am using an M1 MacBook, which supports OpenCL. I added these lines into my code…

---

## [Enhance feature: ocl::setUseOpenCL(false) releases refcount/resources](https://forum.opencv.org/t/enhance-feature-ocl-setuseopencl-false-releases-refcount-resources/1522)

<div class="topic-metadata">

**Author:** [@diablodale](https://forum.opencv.org/u/diablodale)\
**Replies:** 4\
**Last updated:** [February 13, 2021, 8:34am UTC](https://forum.opencv.org/t/enhance-feature-ocl-setuseopencl-false-releases-refcount-resources/1522 "2021-02-13T08:34:17Z")

</div>

In OpenCV 4.5 or later and on all platforms…after any successful ocl::setUseOpenCL(true) and use of that OpenCL computing device, the managed OpenCL resources (buffers, queues, etc.) are not released when ocl::setUseOpen…
