# Opencv with cuda support installation

**URL:** <https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533>\
**Category:** Jetson Orin Nano\
**Tags:** opencv\
**Created:** [July 9, 2025, 9:32pm UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533 "2025-07-09T21:32:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxyesno](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@maxyesno](https://forums.developer.nvidia.com/u/maxyesno)\
**Post date:** [July 9, 2025, 9:32pm UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533/1 "2025-07-09T21:32:22Z")

</div>

Hi

I followed the instructions from [Install OpenCV on Jetson Nano - Q-engineering](https://qengineering.eu/install-opencv-on-jetson-nano.html) to install open cv with cuda support on my jetson orin nano. And after completing the all the steps, I include the following given code : #include \<opencv2/dnn/dnn.hpp\>

…  
// load some network  
net = cv::dnn::readNetFromCaffe(“ResNet-50.prototxt”, “ResNet-50.caffemodel”);

```
// check
if(net.empty()){
    std::cout << "init the model net error" << std::endl;
    return -1;
}

// enable CUDA support
net.setPreferableBackend(cv::dnn::DNN_BACKEND_CUDA);
net.setPreferableTarget(cv::dnn::DNN_TARGET_CUDA);

```

… in my main project code in order to activate and test cuda support. However,  
when I run the code, it returns “CUDA devices availability : 0” and “CUDA not available”.

And I have no idea what’s going on and I don’t know how to fix it.

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 10, 2025, 5:33am UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533/3 "2025-07-10T05:33:11Z")

</div>

Hi,

You can build OpenCV with CUDA support from the source with the below script:

> **[JEP/script at master · AastaNV/JEP](https://github.com/AastaNV/JEP/tree/master/script)**
>
> Contribute to AastaNV/JEP development by creating an account on GitHub.

Or we also provide the prebuilt package in the link below:  
[https://pypi.jetson-ai-lab.dev/jp6/cu126](https://pypi.jetson-ai-lab.dev/jp6/cu126)

Thanks.

---

<div class="post-metadata">

**Author:** ![maxyesno](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@maxyesno](https://forums.developer.nvidia.com/u/maxyesno)\
**Post date:** [July 10, 2025, 10:32pm UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533/5 "2025-07-10T22:32:39Z")

</div>

Hi I have successfully installed cuda is there any way I can test it

thanks

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 14, 2025, 8:08am UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533/6 "2025-07-14T08:08:45Z")

</div>

Hi,

You can find a simple example in the below comment:

> [@Missing CUDA support for opencv-python build from jetson-ai-lab](https://forums.developer.nvidia.com/t/missing-cuda-support-for-opencv-python-build-from-jetson-ai-lab/331311/4):
>
> The container nvcr.io/nvidia/l4t-cuda:12.6.11-runtime does not include libcudnn.so.9, which is required by /usr/local/lib/python3.10/dist-packages/cv2/cv2.abi3.so. As an alternative, you can use the nvcr.io/nvidia/deepstream-l4t:7.1-triton-multiarch container. Below is a description of how to use it. docker run sudo docker run --gpus all -it -v /tmp/:/tmp/ nvcr.io/nvidia/deepstream-l4t:7.1-triton-multiarch /bin/bash install opencv pip install \ opencv-contrib-python==4.11.0.86 \ opencv-py…

Thanks.

---

<div class="post-metadata">

**Author:** ![maxyesno](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@maxyesno](https://forums.developer.nvidia.com/u/maxyesno)\
**Post date:** [July 15, 2025, 1:25pm UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533/7 "2025-07-15T13:25:08Z")

</div>

Hi,

When I run the example code: import cv2  
import os

input\_file = “/opt/nvidia/deepstream/deepstream-7.1/samples/streams/sample\_720p.jpg”  
output\_file = “/tmp/flipped\_output.jpg”

# Load the image from disk (on CPU)

image = cv2.imread(input\_file, cv2.IMREAD\_COLOR)  
if image is None:  
raise RuntimeError(f"Failed to load the image file: {input\_file}")

# Upload the image to GPU memory

gpu\_image = cv2.cuda\_GpuMat()  
gpu\_image.upload(image)

# Flip the image horizontally on the GPU (flipCode = 1)

gpu\_flipped = cv2.cuda.flip(gpu\_image, 1)

# Download the flipped image from GPU to CPU

flipped\_image = gpu\_flipped.download()

# Save the result as a new file

cv2.imwrite(output\_file, flipped\_image)  
print(f"Flipped image saved to: {output\_file}")

it returns this “Traceback (most recent call last):  
File “/home/jetsonorin/Desktop/fira/ball\_zone/testcudaforum.py”, line 14, in   
gpu\_image.upload(image)  
cv2.error: OpenCV(4.12.0) /io/opencv/modules/core/include/opencv2/core/private.cuda.hpp:106: error: (-216:No CUDA support) The library is compiled without CUDA support in function ‘throw\_no\_cuda’”

it said there’s error regarding opencv(4.12.0) and chatgpt told me that I do not have open cv with cuda support. But on my jtop it said "opencv 4.10.0 with CUDA: YES "

I am really confused at this point and I am wondering is there any other online accessible library that will boost the fps of my camera?

Any help would be greatly appreciated!!!

---

<div class="post-metadata">

**Author:** ![AastaLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/aastalll/32/14043_2.png) [@AastaLLL](https://forums.developer.nvidia.com/u/AastaLLL)\
**Post date:** [July 16, 2025, 5:38am UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533/8 "2025-07-16T05:38:45Z")

</div>

Hi,

It looks like you have multiple OpenCV versions in the environment.  
The one with CUDA support is 4.10, and the one imported and reports “No CUDA support” is 4.12.

For other libraries, you can check Deesptream SDK below:

> **[DeepStream SDK](https://developer.nvidia.com/deepstream-sdk)**
>
> Develop and deploy AI-powered intelligent video analytics apps and services faster anywhere.

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [August 13, 2025, 1:29am UTC](https://forums.developer.nvidia.com/t/opencv-with-cuda-support-installation/338533/10 "2025-08-13T01:29:47Z")

</div>

Closed on August 13, 2025, 1:29am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
