Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ARM64 host systems #292

Open
adamrehn opened this issue Dec 12, 2022 · 4 comments
Open

Support for ARM64 host systems #292

adamrehn opened this issue Dec 12, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@adamrehn
Copy link
Owner

When running on an ARM64 host system running either Linux or macOS, BuildKit will default to building ARM64 container images unless the flags --platform linux/amd64 are explicitly specified. At the moment, ue4-docker does not include any logic to pass these flags, leading to failed attempts to build Linux images for ARM64 despite the fact that the Unreal Editor does not support being built for this architecture.

To correctly support ARM64 host systems, we should pass --platform linux/amd64 to BuildKit under Linux and macOS. In theory this could be gated behind a check that detects the host CPU architecture, but in practice we should be able to just pass this unconditionally for now. (If a future version of the Unreal Engine introduces support for building the Editor for ARM64 targets then I suspect we'll need to introduce separate logic to allow users to select the desired CPU architecture anyway.)

I don't have an ARM64 machine to test on myself, but I'll liaise with the community member who brought this issue to my attention to validate the fix.

@adamrehn adamrehn self-assigned this Dec 12, 2022
@adamrehn adamrehn added the enhancement New feature or request label Dec 12, 2022
@adamrehn
Copy link
Owner Author

The new logic has now been added in commit 7fb98d9, and initial testing on an AMD64 Linux machine confirms that passing the platform flags unconditionally doesn't cause any problems. I'll report back here once it's been tested on an ARM64 machine.

@adamrehn
Copy link
Owner Author

Update on the macOS side of things: it looks like ARM64 macOS might be incapable of building Unreal Engine container images when using x86 emulation, due to QEMU not supporting a CPU intrinsic that UE requires:

I still need to test on ARM64 Linux, but my understanding is that BuildKit uses QEMU for multi-arch support under Linux as well, so there's a very good chance that it suffers from the same limitation. If this proves to be the case, we might want to add logic to detect ARM64 host systems and error out with a message that tells the user why their host system can't be used to build container images with ue4-docker.

@TBBle
Copy link
Collaborator

TBBle commented Dec 13, 2022

I was curious, and it looks like this was fixed in Mono 6.8: mono/mono#16474. I don't immediately see a way to take advantage of that though.

@adamrehn
Copy link
Owner Author

adamrehn commented Dec 13, 2022

Interesting, if the problem is specific to Mono then in theory it should only affect Unreal Engine 4.27 and older, since my understanding is that UE5 uses its bundled version of .NET Core instead (although I do see that Mono is still bundled with the engine in addition to .NET Core as of 5.1.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants