From 758dd7bb8f560e45bc49855e4776a9d64c95aea9 Mon Sep 17 00:00:00 2001 From: feng_shuai Date: Wed, 7 Jul 2021 14:16:45 +0800 Subject: [PATCH] add no tensorrt warning (#33874) --- paddle/fluid/platform/dynload/tensorrt.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/platform/dynload/tensorrt.cc b/paddle/fluid/platform/dynload/tensorrt.cc index 1d105a1fd86..8153877b7bb 100644 --- a/paddle/fluid/platform/dynload/tensorrt.cc +++ b/paddle/fluid/platform/dynload/tensorrt.cc @@ -43,8 +43,17 @@ void* GetDsoHandle(const std::string& dso_name) { if (nullptr == dso_handle) { auto error_msg = "You are using Paddle compiled with TensorRT, but TensorRT dynamic " - "library is not found. Ignore this if TensorRT is not needed.\n"; - std::cerr << error_msg; + "library is not found. Ignore this if TensorRT is not needed.\n" + "The TensorRT that Paddle depends on is not configured correctly.\n" + " Suggestions:\n" + " 1. Check if the TensorRT is installed correctly and its version" + " is matched with paddlepaddle you installed.\n" + " 2. Configure environment variables as " + "follows:\n" + " - Linux: set LD_LIBRARY_PATH by `export LD_LIBRARY_PATH=...`\n" + " - Windows: set PATH by `set PATH=XXX;%PATH%`\n" + " - Mac: set DYLD_LIBRARY_PATH by `export DYLD_LIBRARY_PATH=...`\n"; + LOG(WARNING) << error_msg; } return dso_handle; } -- GitLab