Skip to content

Conversation

@chilo-ms
Copy link
Contributor

@chilo-ms chilo-ms commented Sep 29, 2025

Add two examples to show users how to run a plugin EP with C++ and Python respectively.

chilo-ms and others added 9 commits September 29, 2025 09:40
Added prerequisites for running inference with a Plugin EP.
Refactor plugin EP registration and session creation for TensorRTEp.
Added instructions for running inference with explicit and automatic EP selection.
Added a note about the location of the mul_1.onnx file.
Updated the README to include code examples for running inference with a Plugin EP and clarified the steps for explicit and automatic EP selection.
@chilo-ms chilo-ms changed the title [Plugin EP] Add python example for how to run a plugin EP [Plugin EP] Add examples for how to run a plugin EP with C++ and Python Sep 29, 2025
chilo-ms and others added 6 commits September 29, 2025 14:56
Updated README to reflect C++ API usage instead of Python API and added additional prerequisites.
Added missing newline at end of file and included note about mul_1.onnx location.
- A dynamic/shared EP library that exports the functions `CreateEpFactories()` and `ReleaseEpFactory()`.
- ONNX Runtime built as a shared library (e.g., `onnxruntime.dll` on Windows or `libonnxruntime.so` on Linux), since the EP library relies on the public ORT C API (which is ABI-stable) to interact with ONNX Runtime.
- The `onnxruntime_providers_shared.dll` (Windows) or `libonnxruntime_providers_shared.so` (Linux) is also required. When a plugin EP is registered, ONNX Runtime internally calls `LoadPluginOrProviderBridge`, which depends on this shared library to determine whether the EP DLL is a plugin or a provider-bridge.
- If you are using a pre-built ONNX Runtime package, all required libraries (e.g., `onnxruntime.dll`, `onnxruntime_providers_shared.dll`, etc.) are already included.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The onnxruntime_providers_shared.dll is not required for new EPs that are only using the new binary-stable APIs. If this example is only meant for new EPs, perhaps we don't need to mention it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, i think this example is for how to run ORT inference with a plugin ep, so it's worth mentioning onnxruntime_providers_shared.dll is also required.

If users only have onnxruntime.dll but no onnxruntime_providers_shared.dll is present, it will get following error:

unknown file: error: C++ exception with description "C:\Users\lochi\repos\onnxruntime\onnxruntime\core\session\provider_bridge_ort.cc:1789 onnxruntime::ProviderSharedLibrary::Ensure [ONNXRuntimeError] : 1 : FAIL : Error loading "C:\Users\lochi\repos\plugin_trt_ep_test\plugin_execution_providers\test\tensorrt\build\Debug\onnxruntime_providers_shared.dll" which is missing. (Error 126: "The specified module could not be found.")
" thrown in the test body. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants