Skip to content

Load provider shared libraries relative to core runtime executable#3884

Merged
RyanUnderhill merged 3 commits intomasterfrom
ryanunderhill/loadlibrary_path
May 10, 2020
Merged

Load provider shared libraries relative to core runtime executable#3884
RyanUnderhill merged 3 commits intomasterfrom
ryanunderhill/loadlibrary_path

Conversation

@RyanUnderhill
Copy link
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.

@RyanUnderhill RyanUnderhill requested a review from a team as a code owner May 9, 2020 00:48
@jywu-msft
Copy link
Member

Thanks! tested locally and it works.

jywu-msft
jywu-msft previously approved these changes May 9, 2020
lib_name = "libcustom_op_library.dylib";
#else
lib_name = "./libcustom_op_library.so";
lib_name = "./libcustom_op_library.so";
Copy link
Member

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
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 RyanUnderhill merged commit 408f62d into master May 10, 2020
@RyanUnderhill RyanUnderhill deleted the ryanunderhill/loadlibrary_path branch May 10, 2020 03:49
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