ARM Build

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

movax20h
Fast Inserter
Fast Inserter
Posts: 164
Joined: Fri Mar 08, 2019 7:07 pm
Contact:

Re: ARM Build

Post by movax20h »

I would like to have native Linux aarch64 build too. Headless server for the start would be enough. I have some aarch64 hardware, but it is also now popular in many cloud providers (AWS, GCE, Azure, Hetzner, Alibaba, Equinix), plus there are plenty of cheap SBCs (Rasberry Pi 4B, Rokchip boards, especially recent ones), and even some decentish laptops (Mac M1 / M2, Thinkpad X13s) around to play with. In fact one of the servers I have, the only program that doesn't have native aarch64 binary available is Factorio server which I do run.

Most dependent libraries (even multimedia ones) are well supported on Linux aarch64, so that should not be a big problem. The build and testing can be done in qemu with a reasonable speed I think (probably ~5 times slower, if too slow, it is rather easy to do cross-compilation on many distros, like Debian and Ubuntu, which have cross-compilers to all architectures in standard repos). But I know it is not just a flip of a switch, there are going to be some unintended bugs here and there (like unaligned memory access, use of SSE / AVX intrinsics, atomics / memory semantic, etc).

Koub
Global Moderator
Global Moderator
Posts: 7175
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: ARM Build

Post by Koub »

movax20h wrote:
Tue Aug 23, 2022 6:44 pm
Most dependent libraries (even multimedia ones) are well supported on Linux aarch64, so that should not be a big problem. The build and testing can be done in qemu with a reasonable speed I think (probably ~5 times slower, if too slow, it is rather easy to do cross-compilation on many distros, like Debian and Ubuntu, which have cross-compilers to all architectures in standard repos). But I know it is not just a flip of a switch, there are going to be some unintended bugs here and there (like unaligned memory access, use of SSE / AVX intrinsics, atomics / memory semantic, etc).
If I have understood things correctly, the difficult part is not having Factorio run on a platform, it's having it behave exactly the same, to the bit level, on any platform, so that multiplayer doesn't desync. For example the devs had to implement their own versions of the trigonometric functions because the libraries on different platforms gave inconsistent values. I'm sure if aarch64 could make a x5 on Factorio's sales, the devs would give it a think, but I seriously doubt the outcome on sales would be anything but marginal.
Koub - Please consider English is not my native language.

Nidan
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sat Nov 21, 2015 1:40 am
Contact:

Re: ARM Build

Post by Nidan »

Here someone tried to run factorio through an emulator of some sort, the results weren't pretty in multiplayer. A few posts down there's a desync report in case someone is interested in analyzing it.

chexo4
Manual Inserter
Manual Inserter
Posts: 4
Joined: Sat Aug 20, 2022 11:21 pm
Contact:

Re: ARM Build

Post by chexo4 »

Koub wrote:
Wed Aug 24, 2022 6:16 am
movax20h wrote:
Tue Aug 23, 2022 6:44 pm
Most dependent libraries (even multimedia ones) are well supported on Linux aarch64, so that should not be a big problem. The build and testing can be done in qemu with a reasonable speed I think (probably ~5 times slower, if too slow, it is rather easy to do cross-compilation on many distros, like Debian and Ubuntu, which have cross-compilers to all architectures in standard repos). But I know it is not just a flip of a switch, there are going to be some unintended bugs here and there (like unaligned memory access, use of SSE / AVX intrinsics, atomics / memory semantic, etc).
If I have understood things correctly, the difficult part is not having Factorio run on a platform, it's having it behave exactly the same, to the bit level, on any platform, so that multiplayer doesn't desync. For example the devs had to implement their own versions of the trigonometric functions because the libraries on different platforms gave inconsistent values. I'm sure if aarch64 could make a x5 on Factorio's sales, the devs would give it a think, but I seriously doubt the outcome on sales would be anything but marginal.
Is it really that temperamental? Also, would it be less of an issue now since they've already reimplemented those math function on different x86 operatings systems? I hope they're using code tests for this. I bet it could be done, but it's probably not going to be that exciting for more sales. Although, it could generate a little bit of hype, there are very few games that natively support those platforms I mentioned (aarch64, although more since M1 macs came out, but way fewer for ppc64le) so it could at least get people talking. Maybe the Linux on M1 folks would enjoy it in between GPU reverse engineering sessions.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: ARM Build

Post by mrvn »

chexo4 wrote:
Sun Sep 04, 2022 4:55 pm
Koub wrote:
Wed Aug 24, 2022 6:16 am
movax20h wrote:
Tue Aug 23, 2022 6:44 pm
Most dependent libraries (even multimedia ones) are well supported on Linux aarch64, so that should not be a big problem. The build and testing can be done in qemu with a reasonable speed I think (probably ~5 times slower, if too slow, it is rather easy to do cross-compilation on many distros, like Debian and Ubuntu, which have cross-compilers to all architectures in standard repos). But I know it is not just a flip of a switch, there are going to be some unintended bugs here and there (like unaligned memory access, use of SSE / AVX intrinsics, atomics / memory semantic, etc).
If I have understood things correctly, the difficult part is not having Factorio run on a platform, it's having it behave exactly the same, to the bit level, on any platform, so that multiplayer doesn't desync. For example the devs had to implement their own versions of the trigonometric functions because the libraries on different platforms gave inconsistent values. I'm sure if aarch64 could make a x5 on Factorio's sales, the devs would give it a think, but I seriously doubt the outcome on sales would be anything but marginal.
Is it really that temperamental? Also, would it be less of an issue now since they've already reimplemented those math function on different x86 operatings systems? I hope they're using code tests for this. I bet it could be done, but it's probably not going to be that exciting for more sales. Although, it could generate a little bit of hype, there are very few games that natively support those platforms I mentioned (aarch64, although more since M1 macs came out, but way fewer for ppc64le) so it could at least get people talking. Maybe the Linux on M1 folks would enjoy it in between GPU reverse engineering sessions.
Floating point math in inexact. It will round results up or down or even have small errors in the result. The ieee standard specifies exactly how float/double is supposed to round but adhering to that precise standard is slow and different hardware gives slightly different results unless you set the compiler option for exact ieee adherance. Most code isn't compiled to adhere to the exact specs, especially high performance code. They might even use the fast-mast option which allows even more errors. All those errors are in the lowest bits of the float/double and will hardly matter (using an extra 10^-15 oil isn't noticeable). But it does change the checksum of the data and therefore you desync.

Note: x86 (intel) has 96bit doubles internally and cuts them down to 64bit when saving to memory. That alone can make a difference. Even just recompiling with a different compiler version can give different results depending on where the compiler saves temporaries to ram. ARM (any every other arch out there) only has 64bit doubles.

Which makes me think. Does factorio actually use doubles for fluids? Or is that all floats or fixed point math?


PS: I wouldn't mind an ARM factorio myself. Even if that can only play with other ARM users and desyncs with x86. Would still be cool.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: ARM Build

Post by Rseding91 »

mrvn wrote:
Mon Sep 05, 2022 1:07 am
Which makes me think. Does factorio actually use doubles for fluids? Or is that all floats or fixed point math?
We use doubles and floats for a lot of things. We also compile with /fp:strict
If you want to get ahold of me I'm almost always on Discord.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: ARM Build

Post by mrvn »

Rseding91 wrote:
Mon Sep 05, 2022 2:50 am
mrvn wrote:
Mon Sep 05, 2022 1:07 am
Which makes me think. Does factorio actually use doubles for fluids? Or is that all floats or fixed point math?
We use doubles and floats for a lot of things. We also compile with /fp:strict
Ever tried compiling factorio on ARM?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13175
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: ARM Build

Post by Rseding91 »

mrvn wrote:
Mon Sep 05, 2022 7:28 am
Ever tried compiling factorio on ARM?
There was an attempt many years ago which had a lot of desyncs and crashes.
If you want to get ahold of me I'm almost always on Discord.

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12888
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: ARM Build

Post by ssilk »

As already said, things have changed a bit since then. And it’s clear that this would take a lot of time. The question is: is it worth it? And how risky will it be? And who wants to do it?
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

Kulasko
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Feb 28, 2019 11:53 pm
Contact:

Re: ARM Build

Post by Kulasko »

So Factorio is now running on a Switch, which is an ARM platform, while being compatible to PC multiplayer games. Seems the ARM compatibility part is pretty much solved, so how are the chances of us getting our hands on a native ARM build after the Switch version release? :)

User avatar
Stargateur
Inserter
Inserter
Posts: 37
Joined: Sat Oct 05, 2019 6:17 am
Contact:

Re: ARM Build

Post by Stargateur »

Kulasko wrote:
Wed Sep 21, 2022 10:39 pm
So Factorio is now running on a Switch, which is an ARM platform, while being compatible to PC multiplayer games. Seems the ARM compatibility part is pretty much solved, so how are the chances of us getting our hands on a native ARM build after the Switch version release? :)
don't jinx us

XRovertoX
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Nov 09, 2019 8:03 am
Contact:

Re: ARM architecture

Post by XRovertoX »

Would an ARM build be a possibility now? Given that Factorio can run on the Switch, would it be fairly trivial for the devs to made an ARM build for Linux available?

Just for the sake of context. I'm very interested in running a Clusterio server on my RPi4 K8s cluster.

8x13b
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun May 29, 2022 10:55 pm
Contact:

Re: ARM architecture

Post by 8x13b »

Fair point, since they already have an ARM build, it would be very trivial to port it to ARM Linux.

Loewchen
Global Moderator
Global Moderator
Posts: 8285
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: ARM architecture

Post by Loewchen »

Twinsen wrote:
Fri Sep 23, 2022 12:55 pm
Loewchen wrote:
Fri Sep 23, 2022 12:21 pm
Now that the game runs on ARM even with support for cross platform play, will there be a general ARM release (15011)?
There's no plans for more releases on ARM as I don't think there's that much demand, but it's something that is now more likely to come in the future as it becomes more popular. Just because the game compiles on one ARM platform, it doesn't mean it will just work on all of them. Adding a new platform comes with a lot of work, such as creating a possibly complex build script, setting up a build server, setting up a test server, setting up distribution(website, steam, more?) and dealing with maintaining everything for the whole time(e.g. updating the build script when we change to a newer C++ standard, fixing any compilation issues that arise because of different compilers). On top of that, is we are talking about Mac, add the whole notarization, signing and whatever else they need and change all the time. There needs to be someone dedicated to making it happen and maintaining it.

8x13b
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sun May 29, 2022 10:55 pm
Contact:

Re: Factorio Server For ARM (Pretty Please

Post by 8x13b »

milo christiansen wrote:
Tue May 23, 2017 10:08 pm
It can run a full instance of Minecraft, very poorly with view distance turned way down. And ARM GHz is not directly comparable to amd64 GHz for a bunch of reasons.
RPis aren't the only ARM machines. Oracle gives out Ampere A1 ARM servers with 4 cores and 24 GBs of RAM, free, 24 hours a day, 7 days a week, 4 weeks a month, 12 months a year. These run Minecraft fantastically, 20 TPS, 15+ view distance. And Factorio runs like shit because it doesn't have a native ARM build and is stuck with compatibility layers like box64, which are fantastic, but do take a chunk of the performance out.

Loewchen
Global Moderator
Global Moderator
Posts: 8285
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: ARM Build

Post by Loewchen »

Twinsen wrote:
Fri Sep 23, 2022 12:55 pm
Loewchen wrote:
Fri Sep 23, 2022 12:21 pm
Now that the game runs on ARM even with support for cross platform play, will there be a general ARM release (15011)?
There's no plans for more releases on ARM as I don't think there's that much demand, but it's something that is now more likely to come in the future as it becomes more popular. Just because the game compiles on one ARM platform, it doesn't mean it will just work on all of them. Adding a new platform comes with a lot of work, such as creating a possibly complex build script, setting up a build server, setting up a test server, setting up distribution(website, steam, more?) and dealing with maintaining everything for the whole time(e.g. updating the build script when we change to a newer C++ standard, fixing any compilation issues that arise because of different compilers). On top of that, is we are talking about Mac, add the whole notarization, signing and whatever else they need and change all the time. There needs to be someone dedicated to making it happen and maintaining it.

Project579
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Oct 09, 2021 10:05 am
Contact:

Re: ARM Build

Post by Project579 »

It would be pretty interesting to get a AArch64 linux build, most of the posts I have seen are discussing the use of low end SBCs as dedicated servers but I would be more interested in running the full game on high power chips like the NVIDIA Jetson family where both CPU and GPU performance isn't an issue if the game is running on native instructions.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: ARM Build

Post by mrvn »

Project579 wrote:
Fri Sep 23, 2022 8:40 pm
It would be pretty interesting to get a AArch64 linux build, most of the posts I have seen are discussing the use of low end SBCs as dedicated servers but I would be more interested in running the full game on high power chips like the NVIDIA Jetson family where both CPU and GPU performance isn't an issue if the game is running on native instructions.
Even cheap SBCs like Raspberry Pi have had a 64bit ARM cpu for ages. Hopefully everyone means AArch64 when they talk about ARM here. Reintroducing a 32bit factorio would be wasted work.

XRovertoX
Burner Inserter
Burner Inserter
Posts: 5
Joined: Sat Nov 09, 2019 8:03 am
Contact:

Re: ARM architecture

Post by XRovertoX »

Loewchen wrote:
Fri Sep 23, 2022 2:44 pm
Twinsen wrote:
Fri Sep 23, 2022 12:55 pm
Loewchen wrote:
Fri Sep 23, 2022 12:21 pm
Now that the game runs on ARM even with support for cross platform play, will there be a general ARM release (15011)?
There's no plans for more releases on ARM as I don't think there's that much demand, but it's something that is now more likely to come in the future as it becomes more popular. Just because the game compiles on one ARM platform, it doesn't mean it will just work on all of them. Adding a new platform comes with a lot of work, such as creating a possibly complex build script, setting up a build server, setting up a test server, setting up distribution(website, steam, more?) and dealing with maintaining everything for the whole time(e.g. updating the build script when we change to a newer C++ standard, fixing any compilation issues that arise because of different compilers). On top of that, is we are talking about Mac, add the whole notarization, signing and whatever else they need and change all the time. There needs to be someone dedicated to making it happen and maintaining it.
Noted, thanks for the reference to that topic

SerhiiS
Burner Inserter
Burner Inserter
Posts: 19
Joined: Sun Sep 18, 2022 11:18 am
Contact:

Re: ARM Build

Post by SerhiiS »

... There needs to be someone dedicated to making it happen and maintaining it
I thought you have a mac developer. Once I saw a vacancy for a Mac developer, but then it disappeared and I changed my mind about sending a resume.

Post Reply

Return to “Ideas and Suggestions”