# Cuda safe call error

**URL:** <https://forum.opencv.org/t/cuda-safe-call-error/3951>\
**Category:** Python\
**Tags:** stereo, cuda\
**Created:** [June 21, 2021, 7:13am UTC](https://forum.opencv.org/t/cuda-safe-call-error/3951 "2021-06-21T07:13:17Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [June 22, 2021, 8:47am UTC](https://forum.opencv.org/t/cuda-safe-call-error/3951/6 "2021-06-22T08:47:22Z")

</div>

> [@yunfei](#):
>
> the NVIDIA CUDA miss NVCUVID and FAST\_MATH, even if I turned these option on while cmake, the output still less them, can you tell me how to add them to compile? thank you~

I wouldn’t worry about that. The main thing is you have compiled for 70 and you need to compile for 72. I am not sure why since CUDA 10.2 should support compute capability up to 7.5 you are passing -DCUDA\_ARCH\_BIN=7.2. It may be a bug in OpenCV preventing compute capability 7.2 on CUDA 10.2 or some other miss configuration.

First I would confirm that passing -DCUDA\_ARCH\_BIN=7.2 results in

> [@yunfei](#):
>
> – NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS)  
> – NVIDIA GPU arch: 70

and not

```auto
– NVIDIA CUDA: YES (ver 10.2, CUFFT CUBLAS)
– NVIDIA GPU arch: 72

```

as that should take a minute. **I would use a fresh build directory to ensure none of the previous options stick.**

If that doesn’t work I would try passing -DCUDA\_ARCH\_PTX=7.0 if the

```auto
NVIDIA PTX archs:  

```

is blank in your CMake output. That should force the ptx code to be JIT compiled to compute capability 7.2 code on the fly before your program executes.

If that works it might be worth upgrading your version of CUDA or digging into the CMake rules to see why compute capability 7.2 is not being selected.

---

_[View the full topic](https://forum.opencv.org/t/cuda-safe-call-error/3951)._
