Reputation: 157
I think I have an interesting issue here and would love to get some help.
Hardware
2x Identical Machines
Software
As the title says, when I try to create an OpenCV GpuMat
(cv::gpu::Gpumat
), the program will "hang." What I mean by this is that no further executions will occur. What makes this interesting is that CUDA installed successfully, the OpenCV headers were compiled using CMake and have been verified on other computers (and gpu::setDevice()
does not return an error on the current machine), and the program will occasionally run. The code below is what I am testing with.
In the below implementation, the code will hang at gpuMat_1.upload(cpuMat_1)
. Previously (when tested as a benchmark to make sure that certain parts were working), gpuMat.upload
would complete. After confirming that on two identical machines (each with a GTX 750) both were brought up to having 2 uploads and one add (currently displayed) and will not finish the first upload. When the second upload is removed, and the add with it, it still hangs during the first upload.
Thank you for your help. If there is anything else that I should add, or would help clarify the problem, please ask.
#include <iostream>
#include <opencv2\gpu\gpu.hpp>
int main()
{
std::cout << "Number of gpu devices: " << cv::gpu::getCudaEnabledDeviceCount() << std::endl;
cv::Mat cpuMat_1, cpuMat_2;
cv::gpu::GpuMat gpuMat_1, gpuMat_2, gpuMat_3;
cpuMat_1 = cv::Mat::ones(4, 4, CV_8SC1);
cpuMat_2 = cv::Mat::ones(4, 4, CV_8SC1);
gpuMat_1.upload(cpuMat_1);
std::cout << "Help." << std::endl;
gpuMat_2.upload(cpuMat_2);
std::cout << "Please, help." << std::endl;
cv::gpu::add(gpuMat_1, gpuMat_2, gpuMat_3);
std::cout << "Help has come." << std::endl;
system("PAUSE");
return 0;
}
Update: I recently re-compiled OpenCV on one of these units (to account for hardware changes) and am getting the same issues.
Upvotes: 2
Views: 2802
Reputation: 157
The issue turned out to be an incompatibility with OpenCV 2.4.5 and the new Maxwell architecture. I was able to get my hands onto a Quadro 600 and installed that to test it, and it worked fine. I then tested it with a GTX 650, which also worked. I then tested it using the mog2 motion detection libraries on the 650, which also work.
Upvotes: 2