CUDA: choose supported CC automatically#17432
Conversation
alalek
left a comment
There was a problem hiding this comment.
Thank you for contribution!
Basically looks good to me 👍
* cache the result * DRY * brush up based on review
|
Thank you for the review @alalek |
|
I looked in the log of build machine This shows that CC has been specified manually. What I expect is something like this I 'guess' |
|
@tomoaki0705 Yes, it is fixed in this builder (to reduce build time and binaries size - only basic build checks are performed here). Without forcing of So results are same to yours. |
|
Hi, I get this error with CMake 3.16.2, 3.4 branch. Would you please take a look? The error is gone if I set |
|
Hmmm, that's interesting, @nglee.
Additionally, what happens if you invoke NVCC manually ? I assume that this test command here somehow fails and filter outs all the available My comment is to run the nvcc manually, and see whats happens. If my assumption is correct, additional information which might be useful is what will be shown if you remove |
|
Thank you, @tomoaki0705, for taking your time on this issue.
|
|
Thank you, @nglee |
|
It would be nice to dump "target_arch" in foreach for investigation: +message(STATUS "CC_LIST='${CC_LIST}'")
foreach(target_arch ${CC_LIST})
+ message(STATUS "Testing '${target_arch}' ...")Also could you try this in your environment (add quotes): -string(REPLACE "." "" target_arch_short ${target_arch})
+string(REPLACE "." "" target_arch_short "${target_arch}")
...
-string(STRIP ${${result_list}} ${result_list})
+string(STRIP "${${result_list}}" ${result_list}) |
|
@tomoaki0705 I do not find any different result by removing @alalek This is what I get if I add Adding quotes as suggested by @alalek seems to remove this error message. |
|
For me dont resolve this (#17544) I still get an error Full log: DetailsLog files: |
|
@Bleach665 Please try to add quotes in one more place: -string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} ${${_arch_bin_list}})
+string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} "${${_arch_bin_list}}")(but probably |
|
And @Bleach665, your log seems that you re-run cmake on some build environment. |
|
Sorry, nglee mentioned it was 3.16.2
Let me get this version if this reproduces |
|
Sorry, also Bleach665 had his CMake version in his log.
nglee was seeing this issue on 3.16.2 + 3.4 branch |
|
@alalek, afet this changes Cmake configuration was successful. CUDA_ARCH_BIN was empty. @tomoaki0705. |
|
@Bleach665 , I appreciate if you could have a look on patch #17571 |
|
@tomoaki0705, with this patch the CMake configuration and build in Win10, CUDA 10.2, CMake 3.18 was successful for me. CUDA_ARCH_BIN was empty, so I set it to |
|
Sorry @Bleach665 , could you describe more detail about this point, please ?
CUDA_ARCH_BIN is supposed to have some value, and it is not supposed to be empty. |
Yes. I tested with the default configuration, set only |
|
@Bleach665 could you add more details: OS, CUDA version, compiler, etc. |
|
@asmorkalov. Win10, CUDA 10.2, CMake 3.18, VS 2017 15.9.22. Also reproduced this on Win10, CUDA 10.1, CMake 3.12, VS 2017 15.9.11. |
|
@Bleach665 , things are getting bit crazy.
No, this is not expected. I don't think I can throw any more patches by shooting the air blindly.
|
|
|
@Bleach665 unfortunately, there's nothing more I can do.
This is something critical. |
|
I reproduced this (empty CUDA_ARCH_BIN) on clean VBox machine (Win7, CMake 3.18, VS 2017 Community, CUDA 10.2). |
|
Again, |
That's what I meant. On clean default installation |
Pull Request Readiness Checklist
First of all, I'm writing this PR on my personal interest.
No intend to represent my work or the company I belong.
NVIDIA announced CUDA 11
Adding another line here every time CUDA is released, it's just increasing chaos.
opencv/cmake/OpenCVDetectCUDA.cmake
Lines 117 to 123 in c6b60e2
This PR will let available CC to be chosen by nvcc automatically.
Patch to opencv_extra has the same branch name.