Skip to content

Use different namespace for cuda 13.2#4097

Merged
asmorkalov merged 2 commits intoopencv:4.xfrom
JohnZhang-Tetra:use_different_namespace_for_cuda_13.2
Mar 30, 2026
Merged

Use different namespace for cuda 13.2#4097
asmorkalov merged 2 commits intoopencv:4.xfrom
JohnZhang-Tetra:use_different_namespace_for_cuda_13.2

Conversation

@JohnZhang-Tetra
Copy link
Copy Markdown
Contributor

@JohnZhang-Tetra JohnZhang-Tetra commented Mar 24, 2026

Pull Request Readiness Checklist

Hi Alexander, you mentioned we should define the namespace in CMake and keep the original namespace but after reviewing the new CUDA 13.2 namespaces with coworker @daniel-mitchell-tt, we think the new namespace should be used to replace old namespace.

CUDA 13.2 namespace:
/usr/local/cuda-13.2/targets/sbsa-linux/include/cccl/cuda/std/__internal/namespaces.h:45:# define _CCCL_BEGIN_NAMESPACE_CUDA_STD _LIBCUDACXX_PROLOGUE_INCLUDE_CHECK() namespace cuda::std { inline namespace _LIBCUDACXX_ABI_NAMESPACE {

CUDA 12.6 namespace:
/usr/local/cuda-12.6/targets/x86_64-linux/include/cuda/std/detail/libcxx/include/__config:1216:# define _LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION namespace cuda { namespace std {

Comment Daniel made: #4091 (comment)

Fix: #4091
Related to: #4095 (closed PR)

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@daniel-mitchell-tt
Copy link
Copy Markdown

I was able to build with these changes with CUDA 13.2.

@asmorkalov asmorkalov self-requested a review March 25, 2026 04:37
@asmorkalov asmorkalov self-assigned this Mar 25, 2026
@JohnZhang-Tetra
Copy link
Copy Markdown
Contributor Author

@asmorkalov Hi Alexander, I think one of the check failed due to container initialization failure. I looked at the check log and it says
Error response from daemon: could not select device driver "" with capabilities: [[gpu]]
failed to start containers: 8deba6087a677258bcfee19abed4158bf15648d934521207ac4b7cbd4cce9a58

If you are not too busy, could you take a look at this? Thanks!

@asmorkalov
Copy link
Copy Markdown
Contributor

Tested manually with Cuda 13.2 on Ubuntu Linux. Works fine for me.

@asmorkalov asmorkalov merged commit f2854f4 into opencv:4.x Mar 30, 2026
34 of 37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot compile OpenCV 4.13.0 with CUDA 13.2 : _LIBCUDACXX_BEGIN_NAMESPACE_STD seems to be missing

3 participants