Error: "Microsoft.ML currently supports 'x64' and 'x86' processor" when target runtime is *linux-arm* or *linux-arm64*
System Information (please complete the following information):
- OS & Version: Linux 5.19.0-32-generic 22.04.1-Ubuntu
- ML.NET Version: 2.0.1
- .NET Version: 6.0
Describe the bug
Unable to build a project if target runtime is set to either linux-arm or linux-arm64.
Error:
~/.nuget/packages/microsoft.ml/2.0.1/build/netstandard2.0/Microsoft.ML.targets(16,5): error :
Microsoft.ML currently supports 'x64' and 'x86' processor architectures.
Please ensure your application is targeting 'x64' or 'x86'.
https://github.com/dotnet/machinelearning/blob/db197154dcd924ae9a7e31074a835b86e34e33bb/src/Microsoft.ML/build/netstandard2.0/Microsoft.ML.targets#L7-L20
To Reproduce
Create a console project, add a reference to Microsoft.ML 2.0.1 package, try to build the project with target runtime set to either linux-arm or linux-arm64.
Expected behavior Should build without errors.
Screenshot

You can add this into publish profile and it will build.
<EnableMLUnsupportedPlatformTargetCheck>false</EnableMLUnsupportedPlatformTargetCheck>
@ProKn1fe thanks a lot! It worked. I wonder if is this by design and if there are actually any limitations when using ML.NET for ARM architectures?
@genemars i'm trying to train model on Radxa Rock-5b board and i already catch some random errors which didn't throw on windows with same code.
Also TorchSharp don't work on arm at all.
Thanks for this issue @genemars. Added this to our backlog.
Thanks for helping out @ProKn1fe. Re: TorchSharp ARM support, as far as I know, PyTorch doesn't support ARM out of the box (unless you build from source), so any limitations in the underlying libtorch library would also be present in TorchSharp.
FieldAwareFactorizationMachine is not supported in macOS ARM (CpuMathNative related issue). Is it possible to support it as well?
I have added the required item to the publish file, but the project still isn't functioning as expected. Could you please suggest any alternative solutions if you have any? Additionally, could this issue be related to a CPU warning that I noticed? Your input would be greatly appreciated.
Thank you for your assistance. Best regards @ProKn1fe
You can add this into publish profile and it will build.
<EnableMLUnsupportedPlatformTargetCheck>false</EnableMLUnsupportedPlatformTargetCheck>
I added this into csproj file and it worked for me, thanks! Btw why they show such error message? I thought maybe it will not work in prod, but there also fine.
I believe part of ML.Net can work on linux-arm64 platform, but other part cannot. E.g. I encountered issue with tensorflow: Unable to load shared library 'tensorflow' or one of its dependencies.