OpenCV 4.13.0 (with contrib) fails to build with CUDA 13.2 on Jetson Orin Nano (JetPack 7.2) — cudev tuple incompatibility

Hello, Everyone! Nice to meet you.

I’m trying to build OpenCV 4.13.0 (with opencv_contrib) with CUDA support on a Jetson Orin Nano, but the build consistently fails during compilation of opencv_core, specifically in the cudev module.

## Environment

  • - Device: Jetson Orin Nano
  • - JetPack: 7.2 (L4T R39.2)
  • - CUDA: 13.2 (V13.2.78)
  • - OS: Ubuntu 24.04 LTS, aarch64
  • - OpenCV: 4.13.0 (opencv and opencv_contrib, same tag)
    • Build method: built from source (cmake + make)
  • - GCC: 13.3.0

## CMake configuration

cmake -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=/usr/local \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D WITH_CUDA=ON \
      -D WITH_CUDNN=ON \
      -D WITH_CUBLAS=ON \
      -D CUDA_ARCH_BIN=8.7 \
      -D WITH_GSTREAMER=ON \
      -D WITH_LIBV4L=ON \
      -D OPENCV_GENERATE_PKGCONFIG=ON \
      -D BUILD_EXAMPLES=OFF ..

CMake correctly detects CUDA and cuDNN:

--   NVIDIA CUDA:                   YES (ver 13.2, CUFFT CUBLAS)
--     NVIDIA GPU arch:             87
--   cuDNN:                         YES (ver 9.20.0)

## Build error

The build fails while compiling gpu_mat.cu / gpu_mat_nd.cu in modules/core, with errors originating in opencv2/cudev/ptr2d/zip.hpp:

opencv_contrib/modules/cudev/include/opencv2/cudev/grid/../ptr2d/zip.hpp(182): error: this declaration has no storage class or type specifier
  _LIBCUDACXX_BEGIN_NAMESPACE_STD
  ^

opencv_contrib/modules/cudev/include/opencv2/cudev/grid/../ptr2d/zip.hpp(184): error: expected a ";"
  template< class... Types >
  ^

opencv_contrib/modules/cudev/include/opencv2/cudev/grid/../ptr2d/zip.hpp(189): error: tuple is not a template
  struct tuple_size< cv::cudev::ZipPtrSz<tuple<Types...> > >
                                         ^

opencv_contrib/modules/cudev/include/opencv2/cudev/grid/../ptr2d/zip.hpp(190): error: identifier "tuple" is undefined
  : tuple_size<tuple<Types...> > { };

100 errors detected in the compilation of "gpu_mat.cu".

This looks like a conflict between CUDA 13.2's libcu++ tuple implementation (cuda::std::tuple) and the tuple implementation cudev expects.

## What I’ve tried

  1. OpenCV 4.10.0 — same error
  2. OpenCV 4.13.0 (latest tagged release) — same error
  3. Disabling cudev-dependent modules individually (cudaarithm, cudafilters, cudaimgproc, cudafeatures2d, cudaoptflow, cudastereo, cudabgsegm, cudalegacy, cudaobjdetect, cudawarping, cudacodec) via BUILD_opencv_* = OFF — still fails, because gpu_mat.cu/gpu_mat_nd.cu live inside opencv_core itself and cudev is a hard dependency there, not something that can be excluded per-module.

## Related issues I found

  • opencv/opencv_contrib#3690 — CUDA Toolkit 12.4.0 tuple incompatibility (thrust tuple implementation changed from a 10-parameter template to a variadic template)
  • opencv/opencv_contrib#3773 — similar build errors reported with CUDA 12.6
  • opencv/opencv_contrib#3752 — “cuda/std/tuple: No such file or directory” with OpenCV 4.10.0
  • A related NVIDIA forum thread (Jetson Orin NX, JetPack 6.2, CUDA 12.6) where an NVIDIA staff member recommended building OpenCV 4.10+ to avoid this issue — but I’m hitting the same class of error on OpenCV 4.13.0 with CUDA 13.2, which is newer than what that recommendation covered. - opencv/opencv#28136 — a separate CUDA 13.x compatibility issue (cudaDeviceProp missing kernelExecTimeoutEnabled), suggesting CUDA 13.x support in OpenCV is still a work in progress as of the 4.13.0 release.

## Questions

  1. Is the CUDA 13.x / cudev tuple incompatibility a known issue that’s being tracked for Jetson/JetPack builds specifically?
  2. Is there a recommended, verified combination of CUDA and OpenCV versions for JetPack 7.2 (CUDA 13.2) that avoids this?
  3. Is there a patch or workaround (similar to the fix mentioned in opencv/opencv_contrib#3690) that’s known to work on Jetson/aarch64 specifically?

For context: the CPU-only build of OpenCV 4.13.0 (WITH_CUDA=OFF) builds and runs fine on this same system, so this appears isolated to the CUDA/cudev interaction. Thanks in advance for any pointers.

Hello @IT_beginner_jp22!

Based on the title and content of your topic, it looks like it may receive better visibility and feedback in a different category. We took the liberty of moving it for you.

If this was an incorrect assessment, please send me a direct message.

Disclaimer: this moderation suggestion and message were generated with AI assistance.

Hi,

It looks like this issue is fixed in a recent update.
Please try to get the latest source and build it again:

Thanks.