diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 75f4f192444949381397fa4e78c705009e755692..4894d615c2a3530921aa48f00cf13e8cf5094b16 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -132,7 +132,11 @@ function(select_nvcc_arch_flags out_variable) elseif(${CUDA_ARCH_NAME} STREQUAL "Turing") set(cuda_arch_bin "75") elseif(${CUDA_ARCH_NAME} STREQUAL "Ampere") - set(cuda_arch_bin "80") + if (${CMAKE_CUDA_COMPILER_VERSION} LESS 11.1) # CUDA 11.0 + set(cuda_arch_bin "80") + elseif (${CMAKE_CUDA_COMPILER_VERSION} LESS 12.0) # CUDA 11.1+ + set(cuda_arch_bin "80 86") + endif() elseif(${CUDA_ARCH_NAME} STREQUAL "All") set(cuda_arch_bin ${paddle_known_gpu_archs}) elseif(${CUDA_ARCH_NAME} STREQUAL "Auto")