OpenCV (with CUDA enabled) should only use Cuda Runtime API functions (Feature #3981)
Description
I have compiled OpenCV 2.4.9 with CUDA enabled (Cuda Toolkit 5.0) with Visual Studio 2008 (64bit) in Windows. When I was checking with the Windows Dependency Walker the dependencies of the 'opencv_core' DLL, I noticed that in OpenCV (at least in the 'opencv_core' library) unfortunately one function (cuDeviceGetAttribute) from the CUDA driver API is used. Due to this, the 'opencv_core' DLLT has a dependency against 'nvcuda.dll'. This is a BIG problem if you want to deploy this OpenCV variant on machines with either no CUDA GPU or on virtual machines. Because on those systems, 'nvcuda.dll' will not be found and the application will NOT start, even if NO GPU-accelerated OpenCV function is used within the application !
My proposal would be to use the equivalent function 'cudaGetDeviceProperties' from the CUDA runtime API instead of the fn 'cuDeviceGetAttribute' . By this, appliciations using the OpenCV variant (with CUDA enabled) will run also on machines with NO CUDA GPU installed (if no GPU-accelerated function is called). Note the alternative - the usage of two different OpenCV libraries (with CUDA, without CUDA) is software-technically NOT desired in our department.
Associated revisions
Merge pull request #3981 from patrikhuber:vs2015-support
History
Updated by Ilya Lavrenov over 10 years ago
- Assignee set to Vladislav Vinogradov
Updated by Vladislav Vinogradov over 10 years ago
Hello Hannes,
The usage of cuDeviceGetAttribute
function was removed in https://github.com/Itseez/opencv/commit/ae6266e101871796526748950d3ef149319acf3d
The change should be included into the last stable release (2.4.10).
Please try to use the latest release.
For sureness I removed all cuda driver API usage from gpu module : https://github.com/Itseez/opencv/pull/3445
But it is just a macros.
Please note, that CUDA driver API still will be used, if OpenCV is built with NVCUVID support (WITH_NVCUVID
CMake flag).
Please check that in your CMake configuration the WITH_NVCUVID
option is disabled.
- Pull request set to https://github.com/Itseez/opencv/pull/3445
- Target version set to 2.4.11
- Category set to gpu (cuda)
Updated by Vladislav Vinogradov over 10 years ago
- Status changed from New to Done