From aa6eb0e806f181e82a587a7219374902afabbc54 Mon Sep 17 00:00:00 2001 From: JingZhuangzhuang <75348594+JZZ-NOTE@users.noreply.github.com> Date: Tue, 19 Apr 2022 13:12:03 +0800 Subject: [PATCH] fix infer gpu strategy (#41925) --- paddle/fluid/inference/api/analysis_predictor.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index b7e811e4c64..19de09ab152 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -1069,6 +1069,12 @@ std::unique_ptr CreatePaddlePredictor< process_level_allocator_enabled = true; } + // TODO(Jingzhuangzhuang): Fix trt error when allocator_strategy is + // auto_growth + if (config.tensorrt_engine_enabled()) { + gflags.push_back("--allocator_strategy=naive_best_fit"); + } + if (framework::InitGflags(gflags)) { VLOG(3) << "The following gpu analysis configurations only take effect " "for the first predictor: "; -- GitLab