Skip to content

Remove preload ORT DLL (undo PR 689) - #1380

Open
Zhenchao Ni (zhenchaoni) wants to merge 1 commit into
mainfrom
private/zhenni/remove_preload_ort
Open

Remove preload ORT DLL (undo PR 689)#1380
Zhenchao Ni (zhenchaoni) wants to merge 1 commit into
mainfrom
private/zhenni/remove_preload_ort

Conversation

@zhenchaoni

@zhenchaoni Zhenchao Ni (zhenchaoni) commented Sep 1, 2026

Copy link
Copy Markdown
Member

This PR is to remove the code of preloading onnxruntime DLL. This reverts PR #689

About PR 689
PR #689 originally aims to workaround an issue where TRT-RTX ep loads the onnxruntime from "C:\Windows\System32\onnxruntime.dll" instead of Python dependency packages. This issue causes an old onnxruntime loaded.

We revert the above workaround because
Firstly, the original issue is fixed since 7D TRT-RTX EP. Since 7D, TRT-RTX no longer loads the wrong onnxruntime

More importantly, the workaround code creates a duplicate onnxruntime instance.

  • "ctypes.WinDLL(str(dll))" creates an ort instance from onnxruntime.dll
  • "import onnxruntime" creates another ort instance from "onnxruntime_pybind11_state.pyd"

In Runtime API, when it detects 2 ort instances, it will raise an error. This is the main purpose of removing the workaround code.

@zhenchaoni
Zhenchao Ni (zhenchaoni) requested a review from a team as a code owner September 1, 2026 06:58
@xieofxie

xieofxie commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Since 7D, TRT-RTX no longer loads the correct onnxruntime

XD

@zhenchaoni

Copy link
Copy Markdown
Member Author

Since 7D, TRT-RTX no longer loads the correct onnxruntime

XD
My PR description typo. It should be "Since 7D, TRT-RTX no longer loads the wrong onnxruntime"

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.

3 participants