TensorRT 8.5 depecated functions

I updated my TensorRT version to 8.5 and got warnings about deprecated functions.
I found solutions for some of it and would like to ask if the fixes I made are correct and what the solutions for the others.

  1. nvinfer1::ICudaEngine* nvinfer1::IBuilder::buildEngineWithConfig(nvinfer1::INetworkDefinition&, nvinfer1::IBuilderConfig&):
    “Deprecated in TensorRT 8.0. Superseded by IBuilder::buildSerializedNetwork().”
    buildEngineWithConfig returns ICudaEngine, buildSerializedNetwork returns IHostMemory, if buildEngineWithConfig is deprecated, how can I create ICudaEngine?

  2. nvinfer1::ICudaEngine* nvinfer1::IRuntime::deserializeCudaEngine(const void*, std::size_t, nvinfer1::IPluginFactory*):
    “Deprecated in TensorRT 8.0.”
    Found updated version:
    ICudaEngine * nvinfer1::IRuntime::deserializeCudaEngine(void const * blob, std::size_t size)
    Is this a valid replacement?

  3. void nvinfer1::IRuntime::destroy()
    “Deprecated interface will be removed in TensorRT 10.0.”
    Is this function not needed and I can remove it from my code?

  4. void nvinfer1::IHostMemory::destroy()
    " Deprecated in TRT 8.0. Superseded by delete ."
    What is delete?

  5. void nvinfer1::IBuilderConfig::setMaxWorkspaceSize(std::size_t):
    " Deprecated in TensorRT 8.3. Superseded by IBuilderConfig::setMemoryPoolLimit() with MemoryPoolType::kWORKSPACE."
    So I should use void nvinfer1::IBuilderConfig::setMemoryPoolLimit(MemoryPoolType pool, std::size_t poolSize) with pool = nvinfer1::MemoryPoolType::kWORKSPACE ?

  6. void nvinfer1::IBuilder::setMaxBatchSize(int32_t):
    “Deprecated in TensorRT 8.4.”
    Does this functionality deprecate?

  7. bool nvinfer1::IExecutionContext::enqueueV2(void* const*, cudaStream_t, CUevent_st**):
    “Superseded by enqueueV3(). Deprecated in TensorRT 8.5”
    enqueueV3() receives only stream as an argument, in the current implementation with enqueueV() I pass bindings as well, does it no longer needed?

  8. int32_t nvinfer1::ICudaEngine::getBindingIndex(const char*) const
    nvinfer1::Dims nvinfer1::ICudaEngine::getBindingDimensions(int32_t) const:
    “Deprecated in TensorRT 8.5. Superseded by name-based methods. Use them instead of binding-index based methods.”
    “Deprecated in TensorRT 8.5. Superseded by getTensorShape().”

    So instead of:
    int32_t index getBindingIndex("name");
    Dims dims getBindingDimensions(index);
    Should I write:
    Dims dims getTensorShape("name");?

Moved this post from NVAPI section to the TensorRT section.

1 Like

enququV3 needs setTensorAddress before using, I got segmentation fault without it. enqueueV3 segmentation fault