cuda4dnn: catch common build mistakes early and better diagnostics#17788
cuda4dnn: catch common build mistakes early and better diagnostics#17788opencv-pushbot merged 2 commits intoopencv:masterfrom
Conversation
|
Would it be possible to store the CUDA version and cuDNN version somewhere so that this can be verified at runtime? This mismatch often causes runtime errors.
|
|
I believe this change is fine (errors can be caused by non-default variable value). |
7422ba5 to
ee7dcef
Compare
eece025 to
1949056
Compare
|
I tested the patch with Ubuntu 18.04 and CUDA 10.2. There is some other CuBLAS and NPP search issue in CMake, but it's not relevant to DNN. |
|
|
||
| auto d2h_stream = cuda4dnn::csl::Stream(true); // stream for background D2H data transfers | ||
| cudaInfo = std::unique_ptr<CudaInfo_t>(new CudaInfo_t(std::move(context), std::move(d2h_stream))); | ||
| cuda4dnn::checkVersions(); |
There was a problem hiding this comment.
Massive facepalm. This is a very embarrassing mistake. If a version mismatch occurs, exceptions will be thrown even before it reaches this line. This makes this version check mechanism completely useless.
It's not a bug that breaks things. It just makes this version check useless.
There was a problem hiding this comment.
Could you move the check to proper place with another PR then?
There was a problem hiding this comment.
Yes, I am planning to do that. This time I am trying to test by making lots of containers with broken builds. So this will take some time.
OPENCV_DNN_CUDAbut cuDNN, cuBLAS or CUDA dependencies haven't been resolvedDNN_TARGET_CUDA_FP16CUDA_ARCH_BINorCUDA_ARCH_PTX)initCUDABackend(see cuda4dnn(concat): fix stream not being set for concat wrappers after fusion #17359)Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.