microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
13.4k stars 2.74k forks source link

[Build] TensorRT 10 nvinfer1 APIs deprecated #20923

Open tianleiwu opened 3 weeks ago

tianleiwu commented 3 weeks ago

Describe the issue

I tried build with CUDA 12.5 and TensorRT 10.0 in Windows, and saw errors like error C4996: 'nvinfer1::IPluginV2': was declared deprecated in build.

Urgency

None

Target platform

windows 11

Build script

build.bat --cmake_generator "Visual Studio 17 2022" --config Release --build_wheel --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=61;70;75;80;90" --parallel --build_shared_lib --use_cuda --cuda_version "12.5" --cuda_home "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5" --cudnn_home "C:\CuDNN\9.1.1.17_cuda12" --use_tensorrt --tensorrt_home "C:\TensorRT\10.0.1.6.cuda-12.4"

Error / output

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(593,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::allocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(625,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::deallocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(463,44): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(712,46): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1001,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1018,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1091,31): error C4996: 'nvinfer1::v_1_0::IPluginCreator': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(634,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(998,83): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(403,61): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45): error C4996: 'nvinfer1::IPluginV2Ext::~IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(587,6): error C4996: 'nvinfer1::IPluginV2::~IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')
  C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45):
  see reference to function 'nvinfer1::IPluginV2Ext::~IPluginV2Ext(void)'

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(3254,16): error C4996: 'nvinfer1::v_1_0::IOutputAllocator::reallocateOutput': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(2699,5): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(6815,75): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/onnx_ctx_model_helper.cc')

E:\git\onnxruntime\build\Windows\Release\_deps\onnx-src\onnx\defs\math\defs.cc(46,84): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss of data [E:\git\onnxruntime\build\Windows\Release\_deps\onnx-build\onnx.vcxproj]
E:\git\onnxruntime\build\Windows\Release\_deps\onnx-src\onnx\defs\math\defs.cc(46,59): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss of data [E:\git\onnxruntime\build\Windows\Release\_deps\onnx-build\onnx.vcxproj]
E:\git\onnxruntime\build\Windows\Release\_deps\onnx-src\onnx\defs\math\defs.cc(2903,1): warning C4244: 'argument': conversion from 'int64_t' to 'int', possible loss of data [E:\git\onnxruntime\build\Windows\Release\_deps\onnx-build\onnx.vcxproj]
E:\git\onnxruntime\build\Windows\Release\_deps\onnx-src\onnx\defs\math\defs.cc(3131,36): warning C4244: 'argument': conversion from 'int64_t' to 'int32_t', possible loss of data [E:\git\onnxruntime\build\Windows\Release\_deps\onnx-build\onnx.vcxproj]
E:\git\onnxruntime\build\Windows\Release\_deps\onnx-src\onnx\defs\math\defs.cc(3285,1): warning C4244: 'argument': conversion from 'int64_t' to 'int32_t', possible loss of data [E:\git\onnxruntime\build\Windows\Release\_deps\onnx-build\onnx.vcxproj]
C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(593,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::allocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(625,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::deallocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(463,44): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(712,46): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1001,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1018,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1091,31): error C4996: 'nvinfer1::v_1_0::IPluginCreator': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(634,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(998,83): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(403,61): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45): error C4996: 'nvinfer1::IPluginV2Ext::~IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(587,6): error C4996: 'nvinfer1::IPluginV2::~IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')
  C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45):
  see reference to function 'nvinfer1::IPluginV2Ext::~IPluginV2Ext(void)'

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(593,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::allocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(625,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::deallocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(463,44): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(712,46): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1001,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1018,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1091,31): error C4996: 'nvinfer1::v_1_0::IPluginCreator': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(634,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(998,83): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(3254,16): error C4996: 'nvinfer1::v_1_0::IOutputAllocator::reallocateOutput': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(403,61): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45): error C4996: 'nvinfer1::IPluginV2Ext::~IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(587,6): error C4996: 'nvinfer1::IPluginV2::~IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')
  C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45):
  see reference to function 'nvinfer1::IPluginV2Ext::~IPluginV2Ext(void)'

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(2699,5): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(6815,75): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_provider_factory.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(3254,16): error C4996: 'nvinfer1::v_1_0::IOutputAllocator::reallocateOutput': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(2699,5): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(6815,75): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_helper.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(593,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::allocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(625,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::deallocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(463,44): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(712,46): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1001,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1018,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1091,31): error C4996: 'nvinfer1::v_1_0::IPluginCreator': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(634,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(998,83): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(403,61): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45): error C4996: 'nvinfer1::IPluginV2Ext::~IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(587,6): error C4996: 'nvinfer1::IPluginV2::~IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')
  C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45):
  see reference to function 'nvinfer1::IPluginV2Ext::~IPluginV2Ext(void)'

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(3254,16): error C4996: 'nvinfer1::v_1_0::IOutputAllocator::reallocateOutput': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(2699,5): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(6815,75): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(593,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::allocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimeBase.h(625,16): error C4996: 'nvinfer1::v_1_0::IGpuAllocator::deallocate': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(463,44): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(712,46): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1001,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1018,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(1091,31): error C4996: 'nvinfer1::v_1_0::IPluginCreator': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(634,13): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferImpl.h(998,83): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(403,61): error C4996: 'nvinfer1::IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45): error C4996: 'nvinfer1::IPluginV2Ext::~IPluginV2Ext': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntimePlugin.h(587,6): error C4996: 'nvinfer1::IPluginV2::~IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')
  C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(555,45):
  see reference to function 'nvinfer1::IPluginV2Ext::~IPluginV2Ext(void)'

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInferRuntime.h(3254,16): error C4996: 'nvinfer1::v_1_0::IOutputAllocator::reallocateOutput': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(2699,5): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

C:\TensorRT\10.0.1.6.cuda-12.4\include\NvInfer.h(6815,75): error C4996: 'nvinfer1::IPluginV2': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
  (compiling source file '../../../onnxruntime/core/providers/tensorrt/tensorrt_execution_provider_custom_ops.cc')

E:\git\onnxruntime\onnxruntime\core\providers\tensorrt\tensorrt_execution_provider_custom_ops.cc(64,47): error C4996: 'nvinfer1::IPluginRegistry::getPluginCreatorList': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
E:\git\onnxruntime\onnxruntime\core\providers\tensorrt\tensorrt_execution_provider_custom_ops.cc(69,45): error C4996: 'nvinfer1::v_1_0::IPluginCreator::getPluginName': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
E:\git\onnxruntime\onnxruntime\core\providers\tensorrt\tensorrt_execution_provider_custom_ops.cc(70,99): error C4996: 'nvinfer1::v_1_0::IPluginCreator::getPluginVersion': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
E:\git\onnxruntime\onnxruntime\core\providers\tensorrt\tensorrt_execution_provider_custom_ops.cc(78,66): error C4996: 'nvinfer1::v_1_0::IPluginCreator::getPluginName': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]

E:\git\onnxruntime\onnxruntime\core\providers\tensorrt\tensorrt_execution_provider.cc(3592,37): error C4996: 'nvinfer1::ICudaEngine::createExecutionContextWithoutDeviceMemory': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
E:\git\onnxruntime\onnxruntime\core\providers\tensorrt\tensorrt_execution_provider.cc(3145,76): error C4996: 'nvinfer1::ICudaEngine::createExecutionContextWithoutDeviceMemory': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]
E:\git\onnxruntime\onnxruntime\core\providers\tensorrt\tensorrt_execution_provider.cc(3808,74): error C4996: 'nvinfer1::ICudaEngine::createExecutionContextWithoutDeviceMemory': was declared deprecated [E:\git\onnxruntime\build\Windows\Release\onnxruntime_providers_tensorrt.vcxproj]

Visual Studio Version

Enterprise 2022 (64-bit) 17.9.7

GCC / Compiler Version

No response

chilo-ms commented 3 weeks ago

@tianleiwu I assume you add /Zc:__cplusplus in the cmake file, therefore the__cplusplus macro is 201703L due to /std:c++17, then it enables the TRT_DEPRECATED macro as [[deprecated]]

// Items that are marked as deprecated will be removed in a future release.
#if __cplusplus >= 201402L
#define TRT_DEPRECATED [[deprecated]]
#if __GNUC__ < 6
#define TRT_DEPRECATED_ENUM
#else
#define TRT_DEPRECATED_ENUM TRT_DEPRECATED
#endif
#ifdef _MSC_VER
#define TRT_DEPRECATED_API __declspec(dllexport)
#else
#define TRT_DEPRECATED_API [[deprecated]] __attribute__((visibility("default")))
#endif
#else
#ifdef _MSC_VER
#define TRT_DEPRECATED
#define TRT_DEPRECATED_ENUM
#define TRT_DEPRECATED_API __declspec(dllexport)
#else
#define TRT_DEPRECATED __attribute__((deprecated))
#define TRT_DEPRECATED_ENUM
#define TRT_DEPRECATED_API __attribute__((deprecated, visibility("default")))
#endif
#endif

Previously, we didn't specify /Zc:__cplusplus, so __cplusplusis 199711L by default.

We might need to replace all the TRT deprecated functions with the new ones or simply add /wd4996