Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NuGet WinML] [C++/WinRT] WinML's internal Onnxruntime environment instance (Ort::Env) prevents external ONNXRuntime usage #347

Closed
wbudd opened this issue Aug 27, 2020 · 1 comment

Comments

@wbudd
Copy link

wbudd commented Aug 27, 2020

According to this WinML documentation, the NuGet WinML solution conveniently provides "Direct access to the onnxruntime.dll".

However, all ONNXRuntime functionality requires creation of an Ort::Env environment instance as its first order of business, which apparently can only be created once per process.

So, for example, if I have WinML inference tasks running in thread A, I am unable to, say, lookup ONNX input/output tensor names/dimension through the ONNXRuntime API in thread B—or vice versa— given that I'm neither able to reference WinML's internal Ort::Env (or can I?), nor can I pass my own Ort::Env instance to WinML constructors (or can I?). Attempting to use separate instances anyway results in the following error—either thrown by WinML or my side, depending simply on which side creates their instance first:

Only one instance of LoggingManager created with InstanceType::Default can exist at any point in time.

One solution would be for WinML to provide a way to get/set this instance. Another would be for ONNXRuntime to loosen the one-per-process restriction in some way. (For now I can work around this issue by spawning separate processes for ONNX lookup from thread B, but obviously that's rather ugly and inefficient.)

@martinb35
Copy link
Contributor

@wbudd - closing this issue and using the one in the onnxruntime repo to continue to track (and I just responded there).

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

No branches or pull requests

2 participants