You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when enable WITH_CUDA, the opencv_core actually requires cudart, due to the gpuMat functions. However, opencv_core target does not expose the required cudart at all. So anything link to opencv_core will fail.
ENABLE_CUDA_FIRST_CLASS_LANGUAGE=OFF is also broken, although it expose all the cuda libs, however only the cudart is static but all other is dynamic.
cmake_minimum_required(VERSION 3.30)
project(OpenCV_CUDA_Example)
# Find OpenCV (this will use the OpenCVConfig.cmake from the build directory)find_package(OpenCV REQUIRED)
add_executable(opencv_core_example core_example.cpp)
# Link only opencv_coretarget_link_libraries(opencv_core_example opencv_core)
// core_example.cpp
#include<opencv2/core.hpp>// Only include opencv_core
#include<iostream>intmain() {
// Create two 3x3 matrices filled with 1.0 and 2.0 respectively
cv::Mat mat1 = cv::Mat::ones(3, 3, CV_32FC1) * 1.0f; // 3x3 matrix filled with 1.0
cv::Mat mat2 = cv::Mat::ones(3, 3, CV_32FC1) * 2.0f; // 3x3 matrix filled with 2.0// Perform matrix addition
cv::Mat result;
cv::add(mat1, mat2, result);
// Print the result matrix to the console
std::cout << "Matrix 1:" << std::endl << mat1 << std::endl;
std::cout << "Matrix 2:" << std::endl << mat2 << std::endl;
std::cout << "Result (Matrix 1 + Matrix 2):" << std::endl << result << std::endl;
return0;
}
mkdir -p ./build
set -e
set -x
cmake --version
cmake -B build -G Ninja \
-DOpenCV_DIR=../opencv-4.11.0/build \
2>&1| tee cmake.log
ninja -C ./build 2>&1| tee build.log
Issue submission checklist
I report the issue, it's not a question
I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
I updated to the latest OpenCV version and the issue is still there
There is reproducer code and related data files (videos, images, onnx, etc)
The text was updated successfully, but these errors were encountered:
opencv/opencv#26963
System Information
when enable WITH_CUDA, the opencv_core actually requires cudart, due to the gpuMat functions. However, opencv_core target does not expose the required cudart at all. So anything link to opencv_core will fail.
ENABLE_CUDA_FIRST_CLASS_LANGUAGE=OFF is also broken, although it expose all the cuda libs, however only the cudart is static but all other is dynamic.
Detailed description
Steps to reproduce
Build the opencv 4.11.0 with following cmd:
Then build a simple project
Issue submission checklist
The text was updated successfully, but these errors were encountered: