From bfd93b73a03a6b2c1e8bb298f7085f90c30337c1 Mon Sep 17 00:00:00 2001 From: Soumith Chintala Date: Tue, 18 Sep 2018 19:50:23 -0700 Subject: 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 --- Modules/FindCUDA/select_compute_arch.cmake | 3 +++ 1 file changed, 3 insertions(+) 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} -- cgit v0.12