mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2025-10-06 00:57:33 +08:00
[Backend] Integrate TensorRT in Paddle Inference backend by default (#381)
* Modify filter of trt * Add Note for trt libs * Use paddle inference with trt package Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
@@ -69,7 +69,7 @@ else()
|
||||
else()
|
||||
set(PADDLEINFERENCE_FILE "paddle_inference-linux-x64-${PADDLEINFERENCE_VERSION}.tgz")
|
||||
if(WITH_GPU)
|
||||
set(PADDLEINFERENCE_FILE "paddle_inference-linux-x64-gpu-${PADDLEINFERENCE_VERSION}.tgz")
|
||||
set(PADDLEINFERENCE_FILE "paddle_inference-linux-x64-gpu-trt-${PADDLEINFERENCE_VERSION}.tgz")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
@@ -124,7 +124,7 @@ def process_on_mac(current_dir):
|
||||
for command in commands:
|
||||
assert os.system(
|
||||
command) == 0, "command execute failed! command: {}".format(
|
||||
command)
|
||||
command)
|
||||
|
||||
def process_on_windows(current_dir):
|
||||
libs_path = os.path.join(current_dir, "fastdeploy", "libs")
|
||||
@@ -182,13 +182,21 @@ def process_libraries(current_dir):
|
||||
if f.count(flt) > 0:
|
||||
remain = False
|
||||
filename = os.path.split(f)[-1]
|
||||
if filename in [
|
||||
"libnvinfer_plugin.so", "libnvinfer_plugin.so.8.4.1",
|
||||
"libnvinfer.so", "libnvinfer.so.8.4.1", "libnvonnxparser.so",
|
||||
"libnvonnxparser.so.8.4.1", "libnvparsers.so",
|
||||
"libnvparsers.so.8.4.1"
|
||||
]:
|
||||
continue
|
||||
# Note(zhoushunjie): To add the trt libs below will increase the size of whl package by 450M.
|
||||
# if filename in [
|
||||
# "libnvinfer_plugin.so",
|
||||
# "libnvinfer.so", "libnvonnxparser.so",
|
||||
# "libnvparsers.so", "libnvcaffe_parser.so"
|
||||
# ]:
|
||||
# continue
|
||||
|
||||
for lib_prefix in ["libnvinfer_plugin.so.8.",
|
||||
"libnvinfer.so.8.", "libnvonnxparser.so.8.",
|
||||
"libnvparsers.so.8.", "libnvcaffe_parser.so.8."]:
|
||||
if filename.startswith(lib_prefix):
|
||||
remain = False
|
||||
break
|
||||
|
||||
if remain:
|
||||
package_data.append(
|
||||
os.path.relpath(f, os.path.join(current_dir, "fastdeploy")))
|
||||
|
Reference in New Issue
Block a user