Unable to compile CUDA Version

I’m not sure exactly what you are doing but you need to download the wheel opencv_contrib_python_rolling-4.12.0.86-cp37-abi3-win_amd64.whl from

and then call pip install opencv_contrib_python_rolling-4.12.0.86-cp37-abi3-win_amd64.whl

You need to use forward slashes (/) in the python paths. Try the below after deleting your build directory

set CMAKE_BUILD_PARALLEL_LEVEL=4
"C:\Program Files\CMake\bin\cmake.exe" -H"C:\opencv\opencv-4.11.0" -DOPENCV_EXTRA_MODULES_PATH="C:\opencv\opencv_contrib-4.11.0\modules" -B"C:\opencv\build" -G"Visual Studio 17 2022" -DINSTALL_TESTS=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DBUILD_opencv_world=ON -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON -DWITH_CUDA=ON -DCUDA_GENERATION=Auto -DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR=C:/Users/SERVER/miniforge3/include -DPYTHON3_LIBRARY=C:/Users/SERVER/miniforge3/libs/python312.lib -DPYTHON3_EXECUTABLE=C:/Users/SERVER/miniforge3/python.exe -DPYTHON3_NUMPY_INCLUDE_DIRS=C:/Users/SERVER/miniforge3/lib/site-packages/numpy/core/include -DPYTHON3_PACKAGES_PATH=C:/Users/SERVER/miniforge3/Lib/site-packages/

Note: You need to use the latest commits from both the 4.x branches (opencv and opencv_contrib) if you want to build against CUDA 12.8.