Paddle 编译的时候添加了tensorrt的选项,但是编译完成后没有tensorrt的信息

roejwanj  于 5个月前  发布在  其他
关注(0)|答案(1)|浏览(44)

问题描述 Issue Description

cmake命令:

cmake .. -DPY_VERSION=3 -DWITH_TESTING=OFF -DCUDA_ARCH_NAME=All -DWITH_MKL=ON -DWITH_GPU=ON -DON_INFER=ON -DCMAKE_BUILD=Release -DWITH_ONNXRUNTIM=ON -DWITH_TENSORRT=ON -DTENSORRT_ROOT=/usr/lib/x86_64-linux-gnu/ ..

编译没有报错,但是paddle_inference_install_dir的version中没有tensorrt的信息

GIT COMMIT ID: f0422a28d75f9345fa3b801c01cd0284b3b44be3
WITH_MKL: ON
WITH_MKLDNN: ON
WITH_GPU: ON
WITH_ROCM: OFF
WITH_ASCEND_CL: OFF
WITH_ASCEND_CXX11: OFF
WITH_IPU: OFF
CUDA version: 11.1
CUDNN version: v8.0
CXX compiler version: 7.5.0

同时c++部署时如果使用tensorrt则会报错:

WARNING: Logging before InitGoogleLogging() is written to STDERR
I0809 20:45:12.757385 23642 analysis_predictor.cc:1099] TensorRT subgraph engine is enabled
--- Running analysis [ir_graph_build_pass]
--- Running analysis [ir_analysis_pass]
terminate called after throwing an instance of 'phi::enforce::EnforceNotMet'
  what():  (InvalidArgument) Pass tensorrt_subgraph_pass has not been registered. Please use the paddle inference library compiled with tensorrt or disable the tensorrt engine in inference configuration! 
  [Hint: Expected Has(pass_type) == true, but received Has(pass_type):0 != true:1.] (at /home/yanjiaxing/Paddle/paddle/fluid/framework/ir/pass.h:261)

Aborted (core dumped)

版本&环境信息 Version & Environment Information

paddle version: 2.4
cuda: 11.1
cudnn: 8.1
tensorrt: 7.2.1

相关问题