Closed
Conversation
CUDNN_VERSION variable setting needs to be forced as often re-running the make file causes the previous cache to give an invalid/old value, this is reproducible, especially with CUDNN 8.x as CUDA and CUDNN are decoupled and auto-detect doesn't work and a regular user might run without setting CUDNN_LIBRARY and CUDNN_INCLUDE_DIR which leads to value of CUDNN_VERSION being set to ".." and in cache. Hence when the user finally figures out the path setting, the cache prevents the version detection as keeps on giving ".." even if its able to derive the actual version, as due to the cache not overriding it keeps on giving the value ".." thereby confusing the user, thus FORCE will refresh this value ensuring successful pre-build if correct CUDNN_LIBRARY and CUDNN_INCLUDE_DIR are giving in next run of cmake.
alalek
reviewed
Sep 2, 2022
| STRING | ||
| FORCE | ||
| "cuDNN version" | ||
| ) |
Member
There was a problem hiding this comment.
According to CMake documentation FORCE is the last option.
set(<variable> <value>... CACHE <type> <docstring> [FORCE])
https://cmake.org/cmake/help/latest/command/set.html
To avoid mess - it makes sense to replace STRING->INTERNAL (similar to CUDNN_VERSION_MAJOR/MINOR/PATCH versions).
Member
There was a problem hiding this comment.
See also this comment: #19452 (comment)
Based on standard:
CUDNN_VERSION should be moved out of the cache
Merged
6 tasks
Contributor
|
Replaced by #22521 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CUDNN_VERSION variable setting needs to be forced as often re-running the make file causes the previous cache to give an invalid/old value, this is reproducible, especially with CUDNN 8.x as CUDA and CUDNN are decoupled and auto-detect doesn't work and a regular user might run without setting CUDNN_LIBRARY and CUDNN_INCLUDE_DIR which leads to the value of CUDNN_VERSION being set to ".." and in the cache.
Hence when the user finally figures out the path setting, the cache prevents the version detection as keeps on giving ".." even if it's able to derive the actual version, as due to the cache not overriding it keeps on giving the value ".." thereby confusing the user, thus FORCE will refresh this value ensuring successful pre-build if correct CUDNN_LIBRARY and CUDNN_INCLUDE_DIR are giving in next run of CMake.
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.