How to install opencv(with CUDA) on Jetson Orin NX(8GB)?

Hi,
I have a Jetson Orin NX with Jetpack 5.1.2 installed on it.
I need to use opencv with CUDA, but it seems like preinstalled version doesn’t support CUDA.
I ran this script:

import cv2
print(“OpenCV version:”, cv2.version)
print(“CUDA enabled:”, cv2.cuda.getCudaEnabledDeviceCount() > 0)
print(“GStreamer support:”, “YES” if “GStreamer” in cv2.getBuildInformation() else “NO”)

And got:
OpenCV version: 4.2.0
CUDA enabled: False
GStreamer support: YES

Thanks a lot in advance

Hello @Xun

Could you please take a look at Compiling OpenCV from Source? It could work for your case or take it as a reference.

I hope this helps!
Regards!
Eduardo Salazar
Embedded SW Engineer at RidgeRun

Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com/
Website: www.ridgerun.com

Thank you so much! That helped!