Opencv-cuda error after updating cuda from version 12.3 to 12.4

I am getting an error when I try to run “make”

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find CUDA: Found unsuitable version "12.4", but required is exact
  version "12.3" (found /opt/cuda)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:598 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindCUDA.cmake:1291 (find_package_handle_standard_args)
  /usr/lib/cmake/opencv4/OpenCVConfig.cmake:86 (find_package)
  /usr/lib/cmake/opencv4/OpenCVConfig.cmake:108 (find_host_package)
  CMakeLists.txt:3 (find_package)

-- Configuring incomplete, errors occurred!

I believe this is beacuse of updating cuda from 12.3 to 12.4.

I am on Arch and I used Pacman to install opencv-cuda and cuda, so I cannot go back to a previous version as well.

I’m not sure exactly what’s causing your error, it looks like a CMake configuration error. You probably need to clean your build directory. That said it doesn’t matter as OpenCV does not support 12.4 yet.