Skip to content

Conversation

@psakhamoori
Copy link
Contributor

@psakhamoori psakhamoori commented Aug 21, 2025

This PR adds functionality to expose execution provider plugin library filesystem paths through new APIs:

Changes:

  • Add virtual GetLibraryPath() method to EpLibrary base class
  • Implement GetLibraryPath() override in EpLibraryPlugin to return library_path_
  • Add Environment::GetExecutionProviderLibraryPath() public API for thread-safe access to EP library paths
  • Enable external applications to resolve custom ops libraries relative to EP plugin locations

Use Case:
Allows downstream projects (like win-onnxruntime-genai) to intelligently resolve relative custom ops library paths by using the execution provider plugin location as a base directory.

Related Downstream Work

This PR enables functionality in the win-onnxruntime-genai repository:

The downstream PR implements intelligent custom ops library path resolution that leverages the APIs introduced in this PR.

Use Case

Allows win-onnxruntime-genai to resolve custom ops libraries relative to execution provider plugin locations, enabling better deployment flexibility where custom ops can be packaged alongside EP plugins.

API Usage:

onnxruntime::Environment& env = GetEnvironment();
std::filesystem::path ep_lib_path;
auto status = env.GetExecutionProviderLibraryPath("QNNExecutionProvider", ep_lib_path);


// Get the filesystem path of the library registered for the given EP registration name.
// Returns NOT_FOUND/FAIL if the EP is not registered or does not expose a library path.
Status GetExecutionProviderLibraryPath(const std::string& registration_name,

Choose a reason for hiding this comment

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

Consider adding C++ and C# versions of this method too.

@jywu-msft jywu-msft added the ep:VitisAI issues related to Vitis AI execution provider label Aug 22, 2025
@edgchen1
Copy link
Contributor

Add Environment::GetExecutionProviderLibraryPath() public API for thread-safe access to EP library paths

The onnxruntime public C API is defined in include/onnxruntime/core/session/onnxruntime_c_api.h.

Despite the path, include/onnxruntime/core/session/environment.h is not a public header.

@psakhamoori psakhamoori marked this pull request as draft August 25, 2025 12:55
@psakhamoori
Copy link
Contributor Author

New implementation using existing "LoadPluginOrProviderBridge" #25830

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

Labels

ep:VitisAI issues related to Vitis AI execution provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants