From 767fa4748041350a897ff8631d017498a132eaa2 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 30 Sep 2022 14:05:00 +0800 Subject: [PATCH] fix(mgb): add detail error message for trt version diff GitOrigin-RevId: 217a2d1faa852781bf9435f735159019e6010dac --- src/tensorrt/impl/tensorrt_runtime_opr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tensorrt/impl/tensorrt_runtime_opr.cpp b/src/tensorrt/impl/tensorrt_runtime_opr.cpp index 2385a79a..f9f4ab2f 100644 --- a/src/tensorrt/impl/tensorrt_runtime_opr.cpp +++ b/src/tensorrt/impl/tensorrt_runtime_opr.cpp @@ -238,7 +238,11 @@ SymbolVarArray TensorRTRuntimeOpr::make( auto gpu_allocator = std::make_shared(src[0].node()->comp_node()); runtime->setGpuAllocator(gpu_allocator.get()); auto engine = runtime->deserializeCudaEngine(buf, buf_size, nullptr); - mgb_assert(engine, "failed to deserialize ICudaEngine"); + mgb_assert( + engine, + "Failed to deserialize ICudaEngine, may caused by " + "different TensorRT version.\nPlease make sure you are using the " + "same GPU hardware and TensorRT version as serialization."); return make(to_shared_ptr_engine(engine), gpu_allocator, src, config); }