From f39183ea671bcef955b2296731db882601111548 Mon Sep 17 00:00:00 2001 From: xiaoxiaohehe001 <49090790+xiaoxiaohehe001@users.noreply.github.com> Date: Wed, 6 Jul 2022 20:39:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90Paddle-Inference=E3=80=91=20fix=20nvcc?= =?UTF-8?q?=5Flazy=20=20(#44114)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * nvcc_lazy * nvcc_lazy * conv_fusion --- cmake/experiments/cuda_module_loading_lazy.cmake | 10 +++++----- tools/nvcc_lazy | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/cmake/experiments/cuda_module_loading_lazy.cmake b/cmake/experiments/cuda_module_loading_lazy.cmake index 0f0793a8ee..bcbfaacad1 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 9cb49b04ff..e3e7e36102 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 -- GitLab