# OpenCV 4.2.0 does not seem to work with CUDNN 8.0

**URL:** <https://forum.opencv.org/t/opencv-4-2-0-does-not-seem-to-work-with-cudnn-8-0/243>\
**Category:** Uncategorized\
**Created:** [December 10, 2020, 10:13am UTC](https://forum.opencv.org/t/opencv-4-2-0-does-not-seem-to-work-with-cudnn-8-0/243 "2020-12-10T10:13:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charlie\_R](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/charlie_r/32/135_2.png) [@Charlie\_R](https://forum.opencv.org/u/Charlie_R)\
**Post date:** [December 10, 2020, 10:13am UTC](https://forum.opencv.org/t/opencv-4-2-0-does-not-seem-to-work-with-cudnn-8-0/243/1 "2020-12-10T10:13:58Z")

</div>

I’m using an Nvidia Xavier NX wihich came with CUDNN 8.0 preinstalled. I would like to use the net.setPreferableBackend function to accelerate opencv running a dnn, but 4.2.0 does not detect CUDNN on my machine when I cmake opencv. Do I need a newer version? Or is something else wrong? (4.5.1 did not seem to work with ROS, so I would like to avoid it for now)

---

<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:** [December 10, 2020, 10:55am UTC](https://forum.opencv.org/t/opencv-4-2-0-does-not-seem-to-work-with-cudnn-8-0/243/2 "2020-12-10T10:55:01Z")

</div>

Which version of CUDA are you building against? cuDNN 8.0 is [supported](https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html) by CUDA 10.2 and 11.0 only although I would assume if its pre-installed then the correct version of CUDA would also be present? I would see [this](https://github.com/opencv/opencv/issues/16380) for cmake switches which may help you to find cudnn.

In my experience on ubuntu if its installed cmake will find it, what are your cmake commands and output and are you using the same commands as you did on 4.5.1?

---

<div class="post-metadata">

**Author:** ![Charlie\_R](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/charlie_r/32/135_2.png) [@Charlie\_R](https://forum.opencv.org/u/Charlie_R)\
**Post date:** [December 11, 2020, 3:15pm UTC](https://forum.opencv.org/t/opencv-4-2-0-does-not-seem-to-work-with-cudnn-8-0/243/3 "2020-12-11T15:15:52Z")

</div>

Thanks for the response. I have installed OCV 4.4.0 now which seems to be working smoothly and seems to work with ROS noetic

---

<div class="post-metadata">

**Author:** ![Yashas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/yashas/32/889_2.png) [@Yashas](https://forum.opencv.org/u/Yashas)\
**Post date:** [December 13, 2020, 7:01am UTC](https://forum.opencv.org/t/opencv-4-2-0-does-not-seem-to-work-with-cudnn-8-0/243/4 "2020-12-13T07:01:36Z")

</div>

cuDNN 8 changed header files and binaries names which broke CMake scripts. OpenCV 4.4.0 and above support cuDNN 8.

---

<div class="post-metadata">

**Author:** ![Charlie\_R](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/charlie_r/32/135_2.png) [@Charlie\_R](https://forum.opencv.org/u/Charlie_R)\
**Post date:** [December 15, 2020, 10:40am UTC](https://forum.opencv.org/t/opencv-4-2-0-does-not-seem-to-work-with-cudnn-8-0/243/6 "2020-12-15T10:40:48Z")

</div>

Yeah OCV 4.4.0 seems to be working well. Thanks
