Closed thuongmhh closed 1 year ago
@thuongmhh Did you try running this on a WinUI application without MAUI? If it works there, it should work with MAUI.
Yes, I tried this on a WinUI application without MAUI, and it does work. It's strange that it doesn't work with MAUI. I contacted the developer of OnnxRuntime and they said that "I am not familiar with MAUI dll search order, but it seems to me that CUDA libraries can not be found from the app."
Can you make a reproduction app showing it working on WinUI without MAUI?
@drasticactions: Sorry I misread your question. It works with WinForm, not WinUI. In WinUI project, it raises the same exception.
@thuongmhh based on your last comment, I opened this issue: https://github.com/microsoft/WindowsAppSDK/issues/3500
If you have that WinUI repro project lying about still, please go ahead and link to it so I can make sure the WinUI team has all the things they need!
Description
I'm trying to make OnnxRuntime GPU library work with .NET MAUI.
I call the method SessionOptions.MakeSessionOptionWithCudaProvider() and got the OnnxRuntimeException: " LoadLibrary failed with error 126 when trying to load onnxruntime_providers_cuda.dll". I checked that dll exists in the output directory.
I can successfully use the library in the following cases:
For that reason, I think that this is a MAUI bug.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/thuongmhh/OnnxRunimeGpuBug
Version with bug
6.0.312
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows 10.0.22621
Did you find any workaround?
Only the CPU version of OnnxRuntime work in MAUI project now.
Relevant log output