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

ARM64 Linux build #788

Closed
alberic89 opened this issue May 29, 2023 · 10 comments · Fixed by #806
Closed

ARM64 Linux build #788

alberic89 opened this issue May 29, 2023 · 10 comments · Fixed by #806
Assignees
Labels
help wanted Extra attention is needed topic:build Anything related to builds

Comments

@alberic89
Copy link

Is it possible to obtain an aarch64 linux build ?
Thank you !

@zicklag zicklag added help wanted Extra attention is needed topic:build Anything related to builds labels May 29, 2023
@zicklag
Copy link
Member

zicklag commented May 29, 2023

Hey there! I think that's doable, but I haven't tested that yet so I'm not 100% if we'll run into issues or not. If anybody want's to attempt to add ARM builds to our CI that would be appreciated!

@alberic89
Copy link
Author

I have tested to build on a Raspberry Pi 4 with cargo run, but I have the following error:

    Finished dev [optimized + debuginfo] target(s) in 0.92s
     Running `target/debug/jumpy`
2023-05-31T18:20:58.261619Z  INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1    
thread 'main' panicked at 'Unable to find a GPU! Make sure you have installed required drivers! For extra information, see: https://github.com/bevyengine/bevy/blob/latest/docs/linux_dependencies.md', /home/pi/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.9.1/src/renderer/mod.rs:121:10

I have also tried to add a aarch64-unknow-linux-gnu target to release workflow, but I get the error:

Error: failed to run custom build command for `libudev-sys v0.1.4`
Caused by:
  process didn't exit successfully: `/home/runner/work/jumpy_arm/jumpy_arm/target/release/build/libudev-sys-596e66ad3ed6d168/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=LIBUDEV_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "pkg-config has not been configured to support cross-compilation.\n\nInstall a sysroot for the target platform and configure it via\nPKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\ncross-compiling wrapper for pkg-config and set it via\nPKG_CONFIG environment variable."', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/libudev-sys-0.1.4/build.rs:38:41
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101

@zicklag
Copy link
Member

zicklag commented May 31, 2023

I have tested to build on a Raspberry Pi 4 with cargo run, but I have the following error:

Ah, that might be fixable.

Try running it like this:

WGPU_BACKEND=gl cargo run

@orhun
Copy link
Member

orhun commented Jun 1, 2023

I wanna take a crack at this @zicklag, feel free to assign it to me :3

@zicklag
Copy link
Member

zicklag commented Jun 1, 2023

Awesome!

As a hint for something we might need to change in the game, I think we'll need to add the Gl backend to the WgpuSettings to allow it to fallback to the OpenGL backend when nothing else is available, without requiring the WGPU_BACKEND=gl environment variable.

By default, since not everything is supported on Gl, Bevy won't automatically revert to it, IIRC.

@alberic89
Copy link
Author

Try running it like this:

WGPU_BACKEND=gl cargo run

I have tested, and the game works with use of WGPU_BACKEND=gl.

@zicklag
Copy link
Member

zicklag commented Jun 1, 2023

Perfect! Then we just have to get our CI setup to build for that, and then make the game automatically fall back to GL.

Now that I say, that, we should probably just enable Backends::all() because that will allow it to fall back to DX11 on older windows machines, too, which I think we should be compatible with.

@zicklag
Copy link
Member

zicklag commented Jun 7, 2023

@alberic89, @orhun just added ARM64 builds, which should be automatically built in the next nightly release just 4 or 5 hours from now I believe.

Also, the issue where you had to specify WGPU_BACKEND=gl appears to have been fixed after we upgraded to Bevy 0.10.

So I think Jumpy should run fine on a Raspberry Pi now! If you check out the release list tomorrow you should be able to test out the latest nightly and see if it works.

Feel free to re-open if you have more trouble!

@orhun
Copy link
Member

orhun commented Jun 8, 2023

ARM64 builds are there!

@alberic89
Copy link
Author

All works fine!

zicklag pushed a commit to zicklag/jumpy that referenced this issue Jun 17, 2023
Closes fishfolk#788

Tested here: https://github.com/orhun/FishFight/actions/runs/5204576645 

Unfortunately, `cross` doesn't support wildcard for targets so there is
a bit of code duplication in the config. See
cross-rs/cross#1244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed topic:build Anything related to builds
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants