onnxruntime
onnxruntime copied to clipboard
[TensorRT EP] Update TRT10.0 deprecated api
Description
Note:
- This PR would remove C4996 suppression in tensorrt_execution_provider.cc only (according to Nvidia, places with nvinfer.h included need C4996 suppression, when /Zc:__cplusplus is enabled in ORT win build)
- A follow-up PR will be raised to update deprecated TRT Plugin api usage.
Here are deprecated apis to be updated in this PR:
| deprecated api | Update |
|---|---|
| kCUBLAS | / |
| kCUBLAS_LT | / |
| kCUDNN | / |
| reallocateOutput | Superseded by reallocateOutputAsync with cudaStream_t argument |
| createExecutionContextWithoutDeviceMemory | Superseded by createExecutionContext() with parameter. Check ExecutionContextAllocationStrategy::kUSER_MANAGED for more detail |
Motivation and Context
TRT deprecated api list: https://docs.nvidia.com/deeplearning/tensorrt/api/c_api/deprecated.html
Please remove lines with 4996 from the following files.
- onnxruntime/core/providers/tensorrt/nv_includes.h
- onnxruntime/test/unittest_main/test_main.cc
Please remove lines with
4996from the following files.
- onnxruntime/core/providers/tensorrt/nv_includes.h
- onnxruntime/test/unittest_main/test_main.cc
Thanks for the context. These 4996 usage have been reverted
there are build errors?
D:\a_work_temp\TensorRT-10.0.1.6.Windows10.x86_64.cuda-11.8\include\NvInferRuntimeBase.h#L593 D:\a_work_temp\TensorRT-10.0.1.6.Windows10.x86_64.cuda-11.8\include\NvInferRuntimeBase.h(593,16): Error C4996: 'nvinfer1::v_1_0::IGpuAllocator::allocate': was declared deprecated
Including nvinfer.h would cause C4996 errors during Windows ORT build, when /Zc:__cplusplus is enabled:
nvinfer1::v_1_0::IGpuAllocator::allocate
nvinfer1::v_1_0::IGpuAllocator::deallocate
nvinfer1::IPluginV2
nvinfer1::IPluginV2Ext
It seems that there are indirect usage of these api by TRT internally. I'm adding C4996 suppression back temporarily and checking with Nvidia for better solution on that.
was the rellocateOutput->reallocateOutputAsync change tested on Faster-RCNN with oss parser?
was the rellocateOutput->reallocateOutputAsync change tested on Faster-RCNN with oss parser?
That has been tested with no issue