未验证 提交 f39183ea 编写于 作者: X xiaoxiaohehe001 提交者: GitHub

【Paddle-Inference】 fix nvcc_lazy (#44114)

* nvcc_lazy

* nvcc_lazy

* conv_fusion
上级 b603dd55
......@@ -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
......
#!/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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册