Exporting game to Linux/ARM64
Asked Answered
S

4

0

I built a quick prototype for a game that uses GPIO pins for control inputs and everything is working great on my dev machine, a Windows 10 box. However, I need to build and export this to run on a Raspberry Pi which uses arm64. I followed this GitHub proposal which looks like this should be doable as of 4.2.1: https://github.com/godotengine/godot-proposals/issues/988 but I cannot get the game to run on the pi.

I am using Godot 4.2.1.stable.mono.

I created an export for Linux/X11 (Runnable) and made sure that arm64 is selected for architecture. Here's a screenshot of my Export window:

Everything builds fine and it creates a .arm64 file. I copied that over to my Pi and chmod +x the file, but cannot run the file.

If I try to run it from the file manager GUI, I get a prompt telling me that it's an executable and asks if I want to run it. If I choose "Execute", nothing happens:

If I try from a terminal, I get the error "cannot execute binary file: Exec format error":

Googling that error makes it sound like I'm trying to run an x86 binary on an arm64 platform, but I made sure that Godot was setup to build it for arm64. I'm at a loss of what to try next.

Thank you!

Sangfroid answered 5/1 at 15:45 Comment(0)
A
0

Sangfroid but I made sure that Godot was setup to build it for arm64

Export templates are pre-built. Godot isn't a compiler and doesn't build anything for you. It just repackages the executable from the template with your games assets. The export template you have however might be for a different arm version. Is the Pi ARMv7 or ARMv8? ARMv8-A? etc.

https://en.wikipedia.org/wiki/AArch64
AArch64 or ARM64 is the 64-bit extension of the ARM architecture family.

It was first introduced with the Armv8-A architecture. Arm releases a new extension every year.

Ancylostomiasis answered 5/1 at 16:1 Comment(0)
S
0

Ancylostomiasis I'm using a Pi 4 so it should be an ARMv8. I've been happily living in my Windows / x86_64 world so this all new to me. Thank you!

Sangfroid answered 5/1 at 16:10 Comment(0)
A
0

Reading the issue on this repo here the biggest issue might be the renderer

Ancylostomiasis answered 5/1 at 17:32 Comment(0)
S
0

I've solved the problem after a lot of trial and error. There were two issues:

First, I was silly and didn't realize that I was running 32 bit Pi OS. It doesn't matter that the chip itself is 64bit arm. Setting the target architecture to arm32 fixed that issue.

Second, I needed to install the vulkan drivers. I tried to use PiKISS to do this, but it kept encountering errors somewhere along the way with the build so I had to clone the repo and build/install it manually. Once Vulkan was installed, I just added --rendering-driver vulkan when launching the game and it runs fine.

Sangfroid answered 5/1 at 19:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.