提交 a404cd7d 编写于 作者: M Megvii Engine Team

fix(mgb/src): add tensorRT version check

GitOrigin-RevId: 7abfd30caba14fedff28f89978a6a1f88b4b09f3
上级 878ce911
......@@ -52,7 +52,9 @@ HandleImpl::HandleImpl(megcoreComputingHandle_t comp_handle)
// Get stream from MegCore computing handle.
megdnn_assert(
CUDNN_VERSION == cudnnGetVersion(),
"cudnn version mismatch: compiled with %d; detected %zu at runtime",
"cudnn version mismatch: compiled with %d; detected %zu at runtime, may "
"caused by customized environment, for example LD_LIBRARY_PATH on LINUX "
"and PATH on Windows!!",
CUDNN_VERSION, cudnnGetVersion());
#if CUDA_VERSION >= 10010
megdnn_assert(
......
......@@ -217,6 +217,12 @@ SymbolVarArray TensorRTRuntimeOpr::make(
std::shared_ptr<nvinfer1::ICudaEngine> engine,
std::shared_ptr<GpuAllocator> gpu_allocator, const SymbolVarArray& src,
const OperatorNodeConfig& config) {
mgb_assert(
NV_TENSORRT_VERSION == getInferLibVersion(),
"TensorRT version mismatch: compiled with %d; detected %d at runtime , may "
"caused by customized environment, for example LD_LIBRARY_PATH on LINUX "
"and PATH on Windows!!",
NV_TENSORRT_VERSION, getInferLibVersion());
VarNodeArray var_node_array = cg::to_var_node_array(src);
auto tensor_rt_opr = std::make_unique<TensorRTRuntimeOpr>(
std::move(engine), std::move(gpu_allocator), var_node_array, config);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册