# \[Resolved\] VS2022 CUDA Memory Exception Error

**URL:** <https://forum.opencv.org/t/resolved-vs2022-cuda-memory-exception-error/12903>\
**Category:** C++\
**Tags:** dnn, windows, cuda\
**Created:** [April 21, 2023, 10:59am UTC](https://forum.opencv.org/t/resolved-vs2022-cuda-memory-exception-error/12903 "2023-04-21T10:59:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RadionWave](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@RadionWave](https://forum.opencv.org/u/RadionWave)\
**Post date:** [April 21, 2023, 10:59am UTC](https://forum.opencv.org/t/resolved-vs2022-cuda-memory-exception-error/12903/1 "2023-04-21T10:59:58Z")

</div>

**System Informations**

- OpenCV =\> 4.7.0
- OpenCV Modules =\> 4.7.0
- Cuda =\> v12.1
- CUDNN =\> 8.9.0
- OS =\> Windows 64bit
- IDE =\> Visual Studio 2022
- GPU =\> NVIDIA RTX 2080

**Description**  
I have recently installed openCV with Cuda and DNN support, I did this with Cmake,  
The Cmake installation didn’t return me any error messages.

When I try to execture the program below, an error pops up

The Program :

```auto
> #include <iostream>
> #include <opencv2/dnn.hpp>
> #include <opencv2/imgproc.hpp>
> #include <opencv2/highgui.hpp>
> #include <opencv2/core/cuda.hpp>
> 
> int main()
> {
> cv::cuda::printCudaDeviceInfo(0);
> }

```

The error :

> Unhandled exception at 0x00007FFFEAACCB69 in OpenCVGPUTest.exe: Microsoft C++ exception: cv::Exception at memory location 0x0000009AB04FF540.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/opencv/original/2X/9/90f83188983996ea784ecafae45b7d1ac39be471.png)

I have search everywhere and i can’t find anything on this error.  
I’ve tried to reinstall everything multiple times, it didn’t do anything.

**Note**  
I’m a beginner with openCV and CMAKE, so if there is any informations missing please let me know so that I can provide them.

Thank you.

**EDIT** :

I just found a fix for it !  
I put those two files into my solution where my .exe is located :

> opencv\_world470.dll  
> opencv\_world470.lib

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [April 21, 2023, 11:02am UTC](https://forum.opencv.org/t/resolved-vs2022-cuda-memory-exception-error/12903/2 "2023-04-21T11:02:59Z")

</div>

catch the exception, inspect it. what does it say?

---

<div class="post-metadata">

**Author:** ![RadionWave](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@RadionWave](https://forum.opencv.org/u/RadionWave)\
**Post date:** [April 21, 2023, 11:20am UTC](https://forum.opencv.org/t/resolved-vs2022-cuda-memory-exception-error/12903/3 "2023-04-21T11:20:41Z")

</div>

There is what it return me :

> error: (-216:No CUDA support) The library is compiled without CUDA support in function ‘throw\_no\_cuda’

---

<div class="post-metadata">

**Author:** ![RadionWave](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@RadionWave](https://forum.opencv.org/u/RadionWave)\
**Post date:** [April 21, 2023, 11:34am UTC](https://forum.opencv.org/t/resolved-vs2022-cuda-memory-exception-error/12903/4 "2023-04-21T11:34:52Z")

</div>

I just found a fix for it !  
I put those two files into my solution where my .exe is located :

> opencv\_world470.dll  
> opencv\_world470.lib

Thanks a lot for your help !  
(I didn’t know how to catch the exception and inspect it so i didn’t have the error code)
