Commit bfd93b73 authored by Soumith Chintala's avatar Soumith Chintala Committed by Brad King

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
parent 7162630b
......@@ -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}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment