diff --git a/cmake/experiments/cuda_module_loading_lazy.cmake b/cmake/experiments/cuda_module_loading_lazy.cmake index 0f0793a8ee32be466e3db18a646e9b5715d8b6af..bcbfaacad1240fac42f73d248bfed1c0bf814289 100644 --- a/cmake/experiments/cuda_module_loading_lazy.cmake +++ b/cmake/experiments/cuda_module_loading_lazy.cmake @@ -13,8 +13,8 @@ # limitations under the License. # this file contains experimental build options for lazy cuda module loading -# cuda moduel lazy loading is supported by CUDA 11.6+ -# this experiment option makes Paddle supports lazy loading before CUDA 11.6. +# cuda moduel lazy loading is supported by CUDA 11.7+ +# this experiment option makes Paddle supports lazy loading before CUDA 11.7. option(EXP_CUDA_MODULE_LOADING_LAZY "enable lazy cuda module loading" OFF) if(${EXP_CUDA_MODULE_LOADING_LAZY}) @@ -28,13 +28,13 @@ if(${EXP_CUDA_MODULE_LOADING_LAZY}) message("EXP_CUDA_MODULE_LOADING_LAZY only works with CUDA") return() endif() - if(${CUDA_VERSION} VERSION_GREATER_EQUAL "11.6") - message("cuda 11.6+ already support lazy module loading") + if(${CUDA_VERSION} VERSION_GREATER_EQUAL "11.7") + message("cuda 11.7+ already support lazy module loading") return() endif() message( - "for cuda before 11.6, libcudart.so must be used for the lazy module loading trick to work, instead of libcudart_static.a" + "for cuda before 11.7, libcudart.so must be used for the lazy module loading trick to work, instead of libcudart_static.a" ) set(CUDA_USE_STATIC_CUDA_RUNTIME OFF diff --git a/tools/nvcc_lazy b/tools/nvcc_lazy index 9cb49b04ffaff04431345bad4fa596b9e5377856..e3e7e361021c2f9ef81fc30d9d6875c9159e2a26 100755 --- a/tools/nvcc_lazy +++ b/tools/nvcc_lazy @@ -1,4 +1,6 @@ #!/usr/bin/env bash +unset GREP_OPTIONS +set -e # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # @@ -17,11 +19,11 @@ ## CUDA_MODULE_LOADING=EAGER,DEFAULT,LAZY -# check nvcc version, if nvcc >= 11.6, just run nvcc itself -CUDA_VERSION=$(nvcc --version | grep -oP '(?<=cuda_)\d*\.\d*') +# check nvcc version, if nvcc >= 11.7, just run nvcc itself +CUDA_VERSION=$(nvcc --version | grep -oP '(?<=V)\d*\.\d*') CUDA_VERSION_MAJOR=${CUDA_VERSION%.*} CUDA_VERSION_MINOR=${CUDA_VERSION#*.} -if (( CUDA_VERSION_MAJOR > 11 || (CUDA_VERSION_MAJOR == 11 && CUDA_VERSION_MINOR >= 6) )); then +if (( CUDA_VERSION_MAJOR > 11 || (CUDA_VERSION_MAJOR == 11 && CUDA_VERSION_MINOR >= 7) )); then nvcc "$@" exit fi