From d8e7d25274fa7afb4b8f1aadb032bf2a256653a4 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Tue, 26 Nov 2019 19:02:26 +0800 Subject: [PATCH] make CUDA_ARCH_NAME default Auto (#21352) * make CUDA_ARCH_NAME default Auto test=develop * refine warning test=develop --- cmake/cuda.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 09d713642a..d10d401377 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -62,7 +62,7 @@ endfunction() function(select_nvcc_arch_flags out_variable) # List of arch names set(archs_names "Kepler" "Maxwell" "Pascal" "Volta" "Turing" "All" "Manual") - set(archs_name_default "All") + set(archs_name_default "Auto") list(APPEND archs_names "Auto") # set CUDA_ARCH_NAME strings (so it will be seen as dropbox in CMake-Gui) @@ -73,7 +73,7 @@ function(select_nvcc_arch_flags out_variable) # verify CUDA_ARCH_NAME value if(NOT ";${archs_names};" MATCHES ";${CUDA_ARCH_NAME};") string(REPLACE ";" ", " archs_names "${archs_names}") - message(FATAL_ERROR "Only ${archs_names} architeture names are supported.") + message(FATAL_ERROR "Only ${archs_names} architectures names are supported.") endif() if(${CUDA_ARCH_NAME} STREQUAL "Manual") @@ -98,6 +98,12 @@ function(select_nvcc_arch_flags out_variable) elseif(${CUDA_ARCH_NAME} STREQUAL "All") set(cuda_arch_bin ${paddle_known_gpu_archs}) elseif(${CUDA_ARCH_NAME} STREQUAL "Auto") + message(STATUS "WARNING: This is just a warning for publishing release. + You are building GPU version without supporting different architectures. + So the wheel package may fail on other GPU architectures. + You can add -DCUDA_ARCH_NAME=All in cmake command + to get a full wheel package to resolve this warning. + While, this version will still work on local GPU architecture.") detect_installed_gpus(cuda_arch_bin) else() # (${CUDA_ARCH_NAME} STREQUAL "Manual") set(cuda_arch_bin ${CUDA_ARCH_BIN}) -- GitLab