Start New Discussion within our Software Development Community

I am proceeding with parallel processing using GPU, while installing CUDA, I did build the dll files in CMAKE to have GPU support. I did include all the CUDA files and now when I am trying to rebuild the following solution:

#include <iostream>
#include <stdio.h>
#include "C:\Users\admin\Documents\opencv\build\include\opencv2\opencv.hpp"
#include "C:\Users\admin\Documents\opencv\build\include\opencv2\gpu\gpu.hpp"

using namespace std;

int main (int argc, char* argv[])
{
    try
    {
        cv::Mat src_host = cv::imread("image2.jpg", CV_LOAD_IMAGE_GRAYSCALE); //read in image
        cv::gpu::GpuMat dst, src; //allocate space
        src.upload(src_host); //upload

        cv::gpu::threshold(src, dst, 128.0, 255.0, CV_THRESH_BINARY); //threshold

        cv::Mat result_host;
        dst.download(result_host);
        cv::imshow("Result", result_host); //display
        cv::waitKey(5000);
    }
    catch(const cv::Exception& ex) 
    {
        std::cout << "Error: " << ex.what() << std::endl;
    }
    char a;
    std::cin >> a;
    return 0;
}

I am getting the following message:

OpenCV Error: No GPU support (The library is compiled without CUDA support) in EmptyFuncTable::mallocPitch, file C:\buildslave64\win64_amdocl\2_4_PackSlave-win32-vc11-shared\opencv\modules\dynamicuda\include\opencv2/dynamicuda/dynamicuda.hpp, line 126
Error: C:\buildslave64\win64_amdocl\2_4_PackSlave-win32-vc11-shared\opencv\modules\dynamicuda\include\opencv2/dynamicuda/dynamicuda.hpp:126: error: (-216) The l
ibrary is compiled without CUDA support in function EmptyFuncTable::mallocPitch

I don't understand "buildslave64\win64_amdoc1" since the code is being compiled in 32-bit mode. Any help would be appreciated.

The problem seems to be that you are not linking against the correct library. You need to link against the gpu-enabled library, as shown here.

This article has been dead for over six months. Start a new discussion instead.