Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

getCudaEnabledDeviceCount return 0

i,m use cuda. cudaError_t error = cudaGetDeviceCount(&count); count is 1

and getCudaEnabledDeviceCount() return 0

why getCudaEnabledDeviceCount() return 0? i don't know reason. Is not define HAVE_CUDA?? I,m CMake WITH_CUDA checked build OK.

---code--- cuda_info.cpp int cv::cuda::getCudaEnabledDeviceCount() {

ifndef HAVE_CUDA

return 0;

else

int count;
cudaError_t error = cudaGetDeviceCount(&count);

if (error == cudaErrorInsufficientDriver)
    return -1;

if (error == cudaErrorNoDevice)
    return 0;

cudaSafeCall( error );
return count;

endif

}

click to hide/show revision 2
No.2 Revision

getCudaEnabledDeviceCount return 0

i,m I use cuda. cuda.

cudaError_t error = cudaGetDeviceCount(&count);
count 

count is 1

and getCudaEnabledDeviceCount() return 0getCudaEnabledDeviceCount() returns 0 and I do not understand why...

why getCudaEnabledDeviceCount() return 0? i don't know reason. Is not define HAVE_CUDA?? I,m it linked to HAVE_CUDA? I have build OpenCV with CMake WITH_CUDA checked build OK.checked.

---code--- cuda_info.cpp int cv::cuda::getCudaEnabledDeviceCount() {

ifndef HAVE_CUDA

//cuda_info.cpp
int cv::cuda::getCudaEnabledDeviceCount()
{
#ifndef HAVE_CUDA
    return 0;

else

#else
    int count;
 cudaError_t error = cudaGetDeviceCount(&count);

 if (error == cudaErrorInsufficientDriver)
     return -1;

 if (error == cudaErrorNoDevice)
     return 0;

 cudaSafeCall( error );
 return count;
#endif
}

endif

}