machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

Error: "Microsoft.ML currently supports 'x64' and 'x86' processor" when target runtime is *linux-arm* or *linux-arm64*

Open genemars opened this issue 3 years ago • 8 comments

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 Schermata del 2023-03-02 18-08-15

genemars avatar Mar 02 '23 17:03 genemars

You can add this into publish profile and it will build.

<EnableMLUnsupportedPlatformTargetCheck>false</EnableMLUnsupportedPlatformTargetCheck>

ProKn1fe avatar Mar 05 '23 16:03 ProKn1fe

@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 avatar Mar 06 '23 12:03 genemars

@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.

ProKn1fe avatar Mar 06 '23 12:03 ProKn1fe

Also TorchSharp don't work on arm at all.

ProKn1fe avatar Mar 06 '23 15:03 ProKn1fe

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.

luisquintanilla avatar Mar 29 '23 21:03 luisquintanilla

FieldAwareFactorizationMachine is not supported in macOS ARM (CpuMathNative related issue). Is it possible to support it as well?

alvstw avatar Apr 18 '23 05:04 alvstw

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

BesTuerzt avatar Sep 17 '24 08:09 BesTuerzt

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.

hflexgrig avatar Feb 21 '25 13:02 hflexgrig

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.

stasberkov avatar Dec 27 '25 01:12 stasberkov