summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoumith Chintala <soumith@gmail.com>2018-09-19 02:50:23 (GMT)
committerBrad King <brad.king@kitware.com>2018-09-19 14:55:02 (GMT)
commitbfd93b73a03a6b2c1e8bb298f7085f90c30337c1 (patch)
tree7bf0a68656a6a7727afba422eb24688b2a743651
parent7162630beebeac105c1cd90270d26f29aa8c118f (diff)
downloadCMake-bfd93b73a03a6b2c1e8bb298f7085f90c30337c1.zip
CMake-bfd93b73a03a6b2c1e8bb298f7085f90c30337c1.tar.gz
CMake-bfd93b73a03a6b2c1e8bb298f7085f90c30337c1.tar.bz2
FindCUDA: Filter unrelated content in compute capabilities output
Working around CUDA-level nvrm_gpu log statements to stdout on some embedded platforms (ex. Drive PX2). See-also: https://github.com/pytorch/pytorch/issues/11518#issue-359113249
-rw-r--r--Modules/FindCUDA/select_compute_arch.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index cf4fc39..1baf051 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -109,6 +109,9 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
RUN_OUTPUT_VARIABLE compute_capabilities)
endif()
+ # Filter unrelated content out of the output.
+ string(REGEX MATCHALL "[0-9]+\\.[0-9]+" compute_capabilities "${compute_capabilities}")
+
if(run_result EQUAL 0)
string(REPLACE "2.1" "2.1(2.0)" compute_capabilities "${compute_capabilities}")
set(CUDA_GPU_DETECT_OUTPUT ${compute_capabilities}