Browse Source

fix(mgb): add detail error message for trt version diff

GitOrigin-RevId: 217a2d1faa
master
Megvii Engine Team 2 years ago
parent
commit
767fa47480
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/tensorrt/impl/tensorrt_runtime_opr.cpp

+ 5
- 1
src/tensorrt/impl/tensorrt_runtime_opr.cpp View File

@@ -238,7 +238,11 @@ SymbolVarArray TensorRTRuntimeOpr::make(
auto gpu_allocator = std::make_shared<GpuAllocator>(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);
}



Loading…
Cancel
Save