Skip to content

TensorRTExecutionProvider error during session initialization #22199

@cabinader

Description

@cabinader

Describe the issue

I'm exporting an nnUNetV2 model from torch to onnx fromat using torch.dynamo_export. I can launch the model with onnxruntime on the CPUExecutionProvider as well as the CUDAExecutionProvider. However, when using the TensorRTExecutionProvider I get the following error when initialiazing my session:

onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: /onnxruntime_src/onnxruntime/core/providers/tensorrt/tensorrt_execution_provider.cc:2185 SubGraphCollection_t onnxruntime::TensorrtExecutionProvider::GetSupportedList(SubGraphCollection_t, int, int, const onnxruntime::GraphViewer&, bool*) const graph_build.Resolve().IsOK() was false.

I've found some issues describing this error and people were mentioning the possibility that it could come from the fact that TensorRT does not deal with dynamic shapes. Therefore I've exported my model with fixed shapes but it dit not solve the issue.

Moreover when using the polygraphy library it seems like there is no problem

polygraphy run checkpoint_final_torch2.4.1+cu121_onnx1.16.1.onnx --trt

I get the following

image

Many thanks for your help !

To reproduce

Ubuntu 22.04
Cuda 12.2
Cudnn 9.4.0
TensorRT 10.2.0
onnxruntime-gpu 1.19.2
onxx 1.16.1 (for model export)
torch 2.4.1 (for model export)

Urgency

No response

Platform

Linux

OS Version

Ubuntu 22.04

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.19.0

ONNX Runtime API

Python

Architecture

X64

Execution Provider

TensorRT

Execution Provider Library Version

TensorRT 10.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    ep:TensorRTissues related to TensorRT execution providerstaleissues that have not been addressed in a while; categorized by a bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions