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

【Paddle-Inference】 fix nvcc_lazy (#44114)

* nvcc_lazy

* nvcc_lazy

* conv_fusion
上级 b603dd55
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
# limitations under the License. # limitations under the License.
# this file contains experimental build options for lazy cuda module loading # this file contains experimental build options for lazy cuda module loading
# cuda moduel lazy loading is supported by CUDA 11.6+ # cuda moduel lazy loading is supported by CUDA 11.7+
# this experiment option makes Paddle supports lazy loading before CUDA 11.6. # this experiment option makes Paddle supports lazy loading before CUDA 11.7.
option(EXP_CUDA_MODULE_LOADING_LAZY "enable lazy cuda module loading" OFF) option(EXP_CUDA_MODULE_LOADING_LAZY "enable lazy cuda module loading" OFF)
if(${EXP_CUDA_MODULE_LOADING_LAZY}) if(${EXP_CUDA_MODULE_LOADING_LAZY})
...@@ -28,13 +28,13 @@ 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") message("EXP_CUDA_MODULE_LOADING_LAZY only works with CUDA")
return() return()
endif() endif()
if(${CUDA_VERSION} VERSION_GREATER_EQUAL "11.6") if(${CUDA_VERSION} VERSION_GREATER_EQUAL "11.7")
message("cuda 11.6+ already support lazy module loading") message("cuda 11.7+ already support lazy module loading")
return() return()
endif() endif()
message( 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 set(CUDA_USE_STATIC_CUDA_RUNTIME
OFF OFF
......
#!/usr/bin/env bash #!/usr/bin/env bash
unset GREP_OPTIONS
set -e
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
# #
...@@ -17,11 +19,11 @@ ...@@ -17,11 +19,11 @@
## CUDA_MODULE_LOADING=EAGER,DEFAULT,LAZY ## CUDA_MODULE_LOADING=EAGER,DEFAULT,LAZY
# check nvcc version, if nvcc >= 11.6, just run nvcc itself # check nvcc version, if nvcc >= 11.7, just run nvcc itself
CUDA_VERSION=$(nvcc --version | grep -oP '(?<=cuda_)\d*\.\d*') CUDA_VERSION=$(nvcc --version | grep -oP '(?<=V)\d*\.\d*')
CUDA_VERSION_MAJOR=${CUDA_VERSION%.*} CUDA_VERSION_MAJOR=${CUDA_VERSION%.*}
CUDA_VERSION_MINOR=${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 "$@" nvcc "$@"
exit exit
fi fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册