From 155765c8559624f2f8e0a81e6039f6a567c44a4e Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Mon, 25 Nov 2019 18:35:04 +0800 Subject: [PATCH 1/2] make CUDA_ARCH_NAME default Auto test=develop --- cmake/cuda.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 09d713642a153..fe2df221904fd 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,7 @@ 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(WARNING "If you want to support different GPU architectures, please specify command: cmake .. -DCUDA_ARCH_NAME=All") detect_installed_gpus(cuda_arch_bin) else() # (${CUDA_ARCH_NAME} STREQUAL "Manual") set(cuda_arch_bin ${CUDA_ARCH_BIN}) From 7381d88db1ff3c5d6b226b608eada701283d7159 Mon Sep 17 00:00:00 2001 From: Tao Luo Date: Tue, 26 Nov 2019 13:28:11 +0800 Subject: [PATCH 2/2] refine warning test=develop --- cmake/cuda.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index fe2df221904fd..d10d401377c86 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -98,7 +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(WARNING "If you want to support different GPU architectures, please specify command: cmake .. -DCUDA_ARCH_NAME=All") + 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})