Skip to content

Load provider shared libraries relative to core runtime executable - #3884

Merged
Ryan Hill (RyanUnderhill) merged 3 commits into
masterfrom
ryanunderhill/loadlibrary_path
May 10, 2020
Merged

Load provider shared libraries relative to core runtime executable#3884
Ryan Hill (RyanUnderhill) merged 3 commits into
masterfrom
ryanunderhill/loadlibrary_path

Conversation

@RyanUnderhill

Copy link
Copy Markdown
Contributor

Description: Uses the path of the core runtime executable/shared library to load the provider shared library.

Motivation and Context

  • Why is this change required? What problem does it solve?
    When our core code is loaded by other modules (like python), the core code is not part of the DLL search path on windows and providers will fail to load. This ensures they are loaded from the right place.

@jywu-mysoft

Copy link
Copy Markdown
Contributor

Thanks! tested locally and it works.

lib_name = "libcustom_op_library.dylib";
#else
lib_name = "./libcustom_op_library.so";
lib_name = "./libcustom_op_library.so";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we agree that absolute paths is the way to go, we should be consistent for all platforms and document this? Can be a separate PR perhaps.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I have another bug about unloading custom op libraries so I'll address it there.

@RyanUnderhill
Ryan Hill (RyanUnderhill) merged commit 408f62d into master May 10, 2020
@RyanUnderhill
Ryan Hill (RyanUnderhill) deleted the ryanunderhill/loadlibrary_path branch May 10, 2020 03:49
stevenlix (stevenlix) pushed a commit that referenced this pull request May 12, 2020
…3884)

* Load provider DLL relative to core runtime executable
* Use LoadLibraryEx to fix dependent DLL loading
* Fix custom op DLL loading path issue.
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