I got an error when performing "surf(img1, cv::cuda::GpuMat(), keypoints1GPU, descriptors1GPU);" which exactly refers to https://github.com/opencv/opencv/blob/3.4/samples/gpu/surf_keypoint_matcher.cpp The c++ code is:
{
...
cv::cuda::GpuMat img1, img2;
img1.upload(imread("query.jpg", IMREAD_GRAYSCALE));
CV_Assert(!img1.empty());
img2.upload(imread("ref.jpg", IMREAD_GRAYSCALE));
CV_Assert(!img2.empty());
cv::cuda::printShortCudaDeviceInfo(cv::cuda::getDevice());
cv::cuda::SURF_CUDA surf;
cv::cuda::GpuMat keypoints1GPU, keypoints2GPU;
cv::cuda::GpuMat descriptors1GPU, descriptors2GPU;
surf(img1, GpuMat(), keypoints1GPU, descriptors1GPU);
surf(img2, GpuMat(), keypoints2GPU, descriptors2GPU);
...
}
The error details: OpenCV Error: Gpu API call (invalid device symbol) in loadGlobalConstants, file /tmp/opencv/opencv/opencv_contrib/modules/xfeatures2d/src/cuda/surf.cu, line 109
Device info.: Device 0: "Tesla V100-SXM2-32GB" 32256Mb, sm_70, Driver/Runtime ver.10.10/10.0 Driver Version: 418.39 CUDA Version: 10.1
OpenCV info.: version 3.2.0
Any ideas would be greatly appreciated.