Page 6 of 8

Re: ARM Build

Posted: Tue Aug 23, 2022 6:44 pm
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).

Re: ARM Build

Posted: Wed Aug 24, 2022 6:16 am
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.

Re: ARM Build

Posted: Wed Aug 24, 2022 10:10 am
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.

Re: ARM Build

Posted: Sun Sep 04, 2022 4:55 pm
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.

Re: ARM Build

Posted: Mon Sep 05, 2022 1:07 am
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.

Re: ARM Build

Posted: Mon Sep 05, 2022 2:50 am
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

Re: ARM Build

Posted: Mon Sep 05, 2022 7:28 am
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?

Re: ARM Build

Posted: Mon Sep 05, 2022 1:11 pm
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.

Re: ARM Build

Posted: Tue Sep 06, 2022 6:26 am
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?

Re: ARM Build

Posted: Wed Sep 21, 2022 10:39 pm
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? :)

Re: ARM Build

Posted: Wed Sep 21, 2022 10:55 pm
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

Re: ARM architecture

Posted: Fri Sep 23, 2022 1:53 pm
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.

Re: ARM architecture

Posted: Fri Sep 23, 2022 2:16 pm
by 8x13b
Fair point, since they already have an ARM build, it would be very trivial to port it to ARM Linux.

Re: ARM architecture

Posted: Fri Sep 23, 2022 2:44 pm
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.

Re: Factorio Server For ARM (Pretty Please

Posted: Fri Sep 23, 2022 6:30 pm
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.

Re: ARM Build

Posted: Fri Sep 23, 2022 6:52 pm
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.

Re: ARM Build

Posted: Fri Sep 23, 2022 8:40 pm
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.

Re: ARM Build

Posted: Fri Sep 23, 2022 11:38 pm
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.

Re: ARM architecture

Posted: Tue Sep 27, 2022 9:18 am
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

Re: ARM Build

Posted: Tue Sep 27, 2022 9:31 pm
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.