Missing CUDA support for opencv-python build from jetson-ai-lab

I’m using a Jetson Orin Nano and have created a docker image using nvcr.io/nvidia/l4t-cuda:12.6.11-runtime as a base image and installed opencv-python from here: https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/e6d/a8e91fd7e5f79/opencv_python-4.11.0-py3-none-any.whl#sha256=e6da8e91fd7e5f79509500808b38b616af4d3a8da4a8e0a3de6fa1d4da2f4fc8

However, testing gives:
$ python3
Python 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import cv2
print(cv2.cuda.getCudaEnabledDeviceCount())
0

I checked the availability of the GPU inside the container using the deviceQuery executable.

files.zip (9.3 KB)

Hi,

Could you double-check if you are using the installed OpenCV instead of the default one first?

>>> print(cv2.getBuildInformation())

Thanks.

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-python==4.11.0 \
--index-url https://pypi.jetson-ai-lab.dev/jp6/cu126/+simple/

check missing libs

ldd /usr/local/lib/python3.10/dist-packages/cv2/cv2.abi3.so | grep "not found"

install libs

apt update
apt install -y \
  libtesseract-dev \
  libtbb2 \
  libmpg123-0 \
  libatlas3-base \
  libgtk-3-0 \
  libavcodec-extra58 \
  libavformat-dev \
  libswscale-dev

apt install --reinstall -y \
  libavutil56 \
  libvpx7 \
  libmp3lame0 \
  libx264-163 \
  libx265-199 \
  libxvidcore4

check missing libs

ldd /usr/local/lib/python3.10/dist-packages/cv2/cv2.abi3.so | grep "not found"

check cv2

python3 -c "import cv2; print(cv2.cuda.getCudaEnabledDeviceCount()); print(cv2.getBuildInformation())"
1

General configuration for OpenCV 4.11.0 =====================================
  Version control:               4.11.0

  Extra modules:
    Location (extra):            /opt/opencv-python/opencv_contrib/modules
    Version control (extra):     4.11.0

  Platform:
    Timestamp:                   2025-03-05T16:32:02Z
    Host:                        Linux 5.15.148-tegra aarch64
    CMake:                       3.31.6
    CMake generator:             Ninja
    CMake build tool:            /usr/local/bin/ninja
    Configuration:               RELEASE
    Algorithm Hint:              ALGO_HINT_ACCURATE

  CPU/HW features:
    Baseline:                    NEON FP16
      requested:                 DETECT
      required:                  NEON
    Dispatched code generation:  NEON_DOTPROD NEON_FP16 NEON_BF16
      requested:                 NEON_FP16 NEON_BF16 NEON_DOTPROD
      NEON_DOTPROD (1 files):    + NEON_DOTPROD
      NEON_FP16 (2 files):       + NEON_FP16
      NEON_BF16 (0 files):       + NEON_BF16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /usr/bin/c++  (ver 11.4.0)
    C++ flags (Release):         -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /usr/bin/cc
    C flags (Release):           -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:          /usr/lib/aarch64-linux-gnu/liblapack.so /usr/lib/aarch64-linux-gnu/libcblas.so /usr/lib/aarch64-linux-gnu/libatlas.so /usr/lib/aarch64-linux-gnu/libjpeg.so /usr/lib/aarch64-linux-gnu/libpng.so /usr/lib/aarch64-linux-gnu/libz.so Iconv::Iconv m pthread cudart_static dl rt nppc nppial nppicc nppidei nppif nppig nppim nppist nppisu nppitc npps cublas cudnn cufft -L/usr/local/cuda/lib64 -L/usr/lib/aarch64-linux-gnu
    3rdparty dependencies:       libprotobuf ade ittnotify libwebp libtiff libopenjp2 IlmImf tegra_hal

  OpenCV modules:
    To be built:                 alphamat aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape signal stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    freetype world
    Disabled by dependency:      -
    Unavailable:                 cannops cvv fastcv hdf java julia matlab ovis python2 sfm ts viz
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         YES

  GUI:                           GTK3
    GTK+:                        YES (ver 3.24.33)
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
    JPEG:                        /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
    WEBP:                        build (ver decoder: 0x0209, encoder: 0x020f, demux: 0x0107)
    AVIF:                        NO
    PNG:                         /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.6.0)
    JPEG 2000:                   build (ver 2.5.0)
    OpenEXR:                     build (ver 2.3.0)
    GIF:                         NO
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    FFMPEG:                      YES
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                NO
    GStreamer:                   YES (1.20.3)
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            TBB (ver 2020.3 interface 11103)

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Lapack:                      YES (/usr/lib/aarch64-linux-gnu/liblapack.so /usr/lib/aarch64-linux-gnu/libcblas.so /usr/lib/aarch64-linux-gnu/libatlas.so)
    Eigen:                       YES (ver 3.4.0)
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  NVIDIA CUDA:                   YES (ver 12.6, CUFFT CUBLAS FAST_MATH)
    NVIDIA GPU arch:             87
    NVIDIA PTX archs:

  cuDNN:                         YES (ver 9.4.0)

  Python 3:
    Interpreter:                 /usr/bin/python3.10 (ver 3.10.12)
    Libraries:                   /usr/lib/aarch64-linux-gnu/libpython3.10.so (ver 3.10.12)
    Limited API:                 YES (ver 0x03060000)
    numpy:                       /tmp/pip-build-env-ytul3b_k/overlay/local/lib/python3.10/dist-packages/numpy/_core/include (ver 2.2.3)
    install path:                python/cv2/python-3

  Python (for build):            /usr/bin/python3.10

  Java:                          
    ant:                         NO
    Java:                        NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /opt/opencv-python/_skbuild/linux-aarch64-3.10/cmake-install
-----------------------------------------------------------------

example code

vi test.py
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}")

run test.py

python3 test.py

The output will be saved as /tmp/flipped_output.jpg.

Since the Docker container is started with the -v /tmp/:/tmp/ option, you can access the result directly from the Jetson Orin Nano.

This gives me the following:

\n
\n

General configuration for OpenCV 4.11.0 =====================================
Version control: 4.11.0-dirty

Extra modules:
Location (extra): /io/opencv_contrib/modules
Version control (extra): 4.11.0

Platform:
Timestamp: 2025-01-16T09:59:40Z
Host: Linux 6.8.0-51-generic aarch64
CMake: 3.31.1
CMake generator: Unix Makefiles
CMake build tool: /bin/gmake
Configuration: Release
Algorithm Hint: ALGO_HINT_ACCURATE

CPU/HW features:
Baseline: NEON FP16
requested: DETECT
Dispatched code generation: NEON_DOTPROD NEON_FP16 NEON_BF16
requested: NEON_FP16 NEON_BF16 NEON_DOTPROD
NEON_DOTPROD (1 files): + NEON_DOTPROD
NEON_FP16 (2 files): + NEON_FP16
NEON_BF16 (0 files): + NEON_BF16

C/C++:
Built as dynamic libs?: NO
C++ standard: 11
C++ Compiler: /opt/rh/devtoolset-10/root/usr/bin/c++ (ver 10.2.1)
C++ flags (Release): -Wl,-strip-all -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
C++ flags (Debug): -Wl,-strip-all -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
C Compiler: /opt/rh/devtoolset-10/root/usr/bin/cc
C flags (Release): -Wl,-strip-all -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
C flags (Debug): -Wl,-strip-all -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
Linker flags (Release): -L/ffmpeg_build/lib -Wl,–gc-sections -Wl,–as-needed -Wl,–no-undefined
Linker flags (Debug): -L/ffmpeg_build/lib -Wl,–gc-sections -Wl,–as-needed -Wl,–no-undefined
ccache: YES
Precompiled headers: NO
Extra dependencies: /lib64/libopenblas.so Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /usr/lib64/libz.so Qt5::Core Qt5::Gui Qt5::Widgets Iconv::Iconv dl m pthread rt
3rdparty dependencies: libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf tegra_hal

OpenCV modules:
To be built: aruco bgsegm bioinspired calib3d ccalib core cvv datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape signal stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
Disabled: world
Disabled by dependency: -
Unavailable: alphamat cannops cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev fastcv freetype hdf java julia matlab ovis python2 sfm ts viz
Applications: -
Documentation: NO
Non-free algorithms: NO

GUI: QT5
QT: YES (ver 5.15.16 )
QT OpenGL support: NO
GTK+: NO
VTK support: NO

Media I/O:
ZLib: /usr/lib64/libz.so (ver 1.2.7)
JPEG: build-libjpeg-turbo (ver 3.0.3-70)
SIMD Support Request: YES
SIMD Support: YES
WEBP: build (ver decoder: 0x0209, encoder: 0x020f, demux: 0x0107)
AVIF: NO
PNG: /usr/local/lib/libpng.so (ver 1.6.44)
TIFF: build (ver 42 - 4.6.0)
JPEG 2000: build (ver 2.5.0)
OpenEXR: build (ver 2.3.0)
GIF: NO
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
FFMPEG: YES
avcodec: YES (59.37.100)
avformat: YES (59.27.100)
avutil: YES (57.28.100)
swscale: YES (6.7.100)
avresample: NO
GStreamer: NO
v4l/v4l2: YES (linux/videodev2.h)

Parallel framework: pthreads

Trace: YES (with Intel ITT)

Other third-party libraries:
Lapack: YES (/lib64/libopenblas.so)
Eigen: NO
Custom HAL: YES (carotene (ver 0.0.1))
Protobuf: build (3.19.1)
Flatbuffers: builtin/3rdparty (23.5.9)

OpenCL: YES (no extra features)
Include path: /io/opencv/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python 3:
Interpreter: /opt/python/cp39-cp39/bin/python3.9 (ver 3.9.20)
Libraries: libpython3.9m.a (ver 3.9.20)
Limited API: YES (ver 0x03060000)
numpy: /home/ci/.local/lib/python3.9/site-packages/numpy/_core/include (ver 2.0.2)
install path: python/cv2/python-3

Python (for build): /opt/python/cp39-cp39/bin/python3.9

Java:
ant: NO
Java: NO
JNI: NO
Java wrappers: NO
Java tests: NO

Install to: /io/_skbuild/linux-aarch64-3.9/cmake-install

\n
\n

So install path is python/cv2/python-3. What makes me suspicious is that all the cuda modules are listed as unavailable.

I doubt that. Running strace -o file.txt python3 -c “import cv2; cv2.cuda.getCudaEnabledDeviceCount()” does not mention cudnn.

Hi,

Do you use Python3.9?
The package shared above is built for default Python 3.10.

Thanks.

No I’m using the default python 3.10.12. I’m running this in a docker container for which I provided the image.

I assume that:

Python 3:
Interpreter: /opt/python/cp39-cp39/bin/python3.9 (ver 3.9.20)
Libraries: libpython3.9m.a (ver 3.9.20)
Limited API: YES (ver 0x03060000)
numpy: /home/ci/.local/lib/python3.9/site-packages/numpy/_core/include (ver 2.0.2)
install path: python/cv2/python-3

specifies how opencv was built, neither the interpreter nor the numpy path exist in the container.

Hi, are there any updates?

Hi,

Sorry for the late update.

Another common issue is related to the GPU access within the container.
Could you share how you launched the l4t-cuda image? Do you run in on a JetPack 6.2 environment?

Have you tried a simple CUDA app to see if GPU works well inside the image?
Thanks.

I run the container with: docker run --runtime=nvidia -it image_name

Using the deviceQuery executable I can see that the container can access the GPU:

oot@2ba05b0166ef:/# ./deviceQuery
./deviceQuery Starting…

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: “Orin”
CUDA Driver Version / Runtime Version 12.6 / 12.6
CUDA Capability Major/Minor version number: 8.7
Total amount of global memory: 7620 MBytes (7990009856 bytes)
(008) Multiprocessors, (128) CUDA Cores/MP: 1024 CUDA Cores
GPU Max Clock rate: 1020 MHz (1.02 GHz)
Memory Clock rate: 918 Mhz
Memory Bus Width: 128-bit
L2 Cache Size: 2097152 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total shared memory per multiprocessor: 167936 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1536
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 2 copy engine(s)
Run time limit on kernels: No
Integrated GPU sharing Host Memory: Yes
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
Device supports Unified Addressing (UVA): Yes
Device supports Managed Memory: Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: Yes
Supports MultiDevice Co-op Kernel Launch: Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 0 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 12.6, CUDA Runtime Version = 12.6, NumDevs = 1
Result = PASS

opencv does however not find the gpu:

root@2ba05b0166ef:/# python3
Python 3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
mport cv2
print(cv2.cuda.getCudaEnabledDeviceCount())
0

Have you tried with the image I provided?

Hi,

You should be able to use GPU in the l4t-cuda:12.6.11-runtime.
We will give it a try and provide more info to you.

Thanks.

Hi,

The package can work with GPU on the container you used.
Please check:

Pull

$ sudo docker run -it --rm --runtime=nvidia nvcr.io/nvidia/l4t-cuda:12.6.11-runtime

Install dependencies

Edit /etc/apt/sources.list.d/nvidia-l4t-apt-source.list

deb https://repo.download.nvidia.com/jetson/common r36.4 main
deb https://repo.download.nvidia.com/jetson/t234 r36.4 main
# apt-key adv --fetch-key https://repo.download.nvidia.com/jetson/jetson-ota-public.asc
# apt update
# apt install -y wget python3 python3-pip
# apt install -y tesseract-ocr libgtk-3-0 libgstreamer1.0-0 libgstreamer-plugins-base1.0-0
# apt install -y libavcodec-dev libavformat58 ffmpeg libtbb2 libatlas-base-dev
# apt-get install libcudnn9-cuda-12
# wget https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/cdb/12863a72a693d/opencv_contrib_python-4.11.0.86-cp310-cp310-linux_aarch64.whl#sha256=cdb12863a72a693d265da77fb8c8379fcd55cf5f67af2594724ef4005949d4f1
# pip3 install opencv_contrib_python-4.11.0.86-cp310-cp310-linux_aarch64.whl 

Test

root@f7c50be90622:/# python3 
Python 3.10.12 (main, Feb  4 2025, 14:57:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.cuda.getCudaEnabledDeviceCount())
1
>>>

Thanks.

Hi!

I can confirm that this works. However, I’m trying to build a lightweight production container (for several different use cases) where, in general, I definitely do not need opencv-contrib-python with all its extra dependencies.

Why doesn’t opencv-python from https://pypi.jetson-ai-lab.dev/jp6/cu126/+f/e6d/a8e91fd7e5f79/opencv_python-4.11.0-py3-none-any.whl#sha256=e6da8e91fd7e5f79509500808b38b616af4d3a8da4a8e0a3de6fa1d4da2f4fc8 work?

Hi,

The CUDA-related implementation is in the opencv_contrib instead of opencv repo.

So you will need the contrib package to get the CUDA support.

Thanks.

Yes you are right about that!

Thanks for clarifying!!

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