That is weird. If I were you I would walk through bool isDeviceCompatible() to see where it is failing.
If you haven’t built Debug then to avoid waiting for that to build you can copy the function code into a test and walk through that version instead to see why its failing.
bool isDeviceCompatible()
{
int device_id = cv::cuda::getDevice();
if (device_id < 0)
return false;
int major = 0, minor = 0;
cudaDeviceGetAttribute(&major, cudaDevAttrComputeCapabilityMajor, device_id);
cudaDeviceGetAttribute(&minor, cudaDevAttrComputeCapabilityMinor, device_id);
if (cv::cuda::TargetArchs::hasEqualOrLessPtx(major, minor))
return true;
for (int i = minor; i >= 0; i--)
if (cv::cuda::TargetArchs::hasBin(major, i))
return true;
return false;
}