microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.11k stars 2.84k forks source link

Unable to compile UWP project using .NET native with OnnxRuntime reference[Build] #18771

Open songshizhao opened 9 months ago

songshizhao commented 9 months ago

Describe the issue

I build a nuget packgae with onnxruntime using .net standard 2.0 NuetPackage: https://github.com/songshizhao/AnimeGANv2_Sharp it should be widely compatible in UWP/Winui ... If I use WINUI3 empty template prj ,there is no building issue. But the project cannot be compiled in a empty UWP prj with package using onnxruntime mentioned above, I get error: ILT0005. Same as #4252

same situation for other package using onnxruntime like: https://github.com/FaceONNX/FaceONNX Do we must migrate the old UWP project to winui if we want to use onnxruntime ? Hope this build issue be fixed

Urgency

No response

Target platform

UWP

Build script

empty

Error / output

ILT0005: “C:\Users\Administrator.nuget\packages\runtime.win10-x86.microsoft.net.native.compiler\2.2.12-rel-31116-00\tools\x86\ilc\Tools\nutc_driver.exe @...\TestPackage\obj\x86\Release\ilc\intermediate\MDIL\TestPackage.rsp"”

Visual Studio Version

22

GCC / Compiler Version

No response

skottmckay commented 9 months ago

What netstandard version does the 'empty UWP prj' require?

I'm not familiar with the UWP requirements but based on discussions like this I wonder if it's trying to support old Windows 10 versions that require netstandard 1.4. If so, is there maybe a configuration option to tell it to use netstandard 2.0?

songshizhao commented 9 months ago

@skottmckay Here is my information. standard2.0 NuGet package build successfully but UWP native compile can't pass with error ILT0005

actually, in UWP prj I have another choice is to use Windows.ai.machinelearning namespace instead msft.ai Its working well for most situations, but there still problems , I don't know where to report these issues: its depends on machine OS version, only win11 can load one of my onnx model successfully, for win10 exception occur when load_onnx_from_stroageFile ,return a null and i tried to use Windows.ai.machinelearning with Windows.ai.directML nuget package ,load_onnx_from_stroageFile exception for both win10/win11: no registration class provided so my prj is using UWP Windows.ai namespace (without nuget package ) and ai function work only for win11.

skottmckay commented 9 months ago

The Microsoft.AI.MachineLearning package has different target frameworks (includes uap10.0) so if that works better in general we can focus on the issues that has.

Can you please provide a minimal reproduction of the issue. Solution, project files and code? It's not clear what load_onnx_from_stroageFile is (is it a misspelling of something provided by the nuget package or a function you have defined) and you haven't included specific exception info, so a reproduction will be the easiest way to see the exact error details.

songshizhao commented 9 months ago

general you can create a uwp empty prj and install 2 runtime pkg of this project(managed and runtime)from nuget,Compile it with native chain enabled(release by default),the error will come out

have a good day!


发件人: Scott McKay @.> 发送时间: Monday, December 18, 2023 8:18:03 PM 收件人: microsoft/onnxruntime @.> 抄送: songshizhao @.>; Author @.> 主题: Re: [microsoft/onnxruntime] Unable to compile UWP project using .NET native with OnnxRuntime reference[Build] (Issue #18771)

The Microsoft.AI.MachineLearning package has different target frameworks (includes uap10.0) so if that works better in general we can focus on the issues that has.

Can you please provide a minimal reproduction of the issue. Solution, project files and code? It's not clear what load_onnx_from_stroageFile is (is it a misspelling of something provided by the nuget package or a function you have defined) and you haven't included specific exception info, so a reproduction will be the easiest way to see the exact error details.

― Reply to this email directly, view it on GitHubhttps://github.com/microsoft/onnxruntime/issues/18771#issuecomment-1860341418, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AE3J3IWGJWBT4R7DGOWTFTLYKAX7XAVCNFSM6AAAAABAOSAI7OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRQGM2DCNBRHA. You are receiving this because you authored the thread.Message ID: @.***>

skottmckay commented 9 months ago

Please provide a minimal reproduction of the issue as there are still many variables at play.

e.g.

github-actions[bot] commented 8 months ago

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.