Skip to content

raylib 6.0 + linux arm64 builds - #692

Open
Mantissagithub wants to merge 1 commit into
PufferAI:5.0from
Mantissagithub:arm64-raylib6
Open

Mantissagithub wants to merge 1 commit into
PufferAI:5.0from
Mantissagithub:arm64-raylib6

Conversation

@Mantissagithub

Copy link
Copy Markdown

closes #320 (the "we implement raylib 6.0" + box2d arm build items)

adds linux arm64 builds (gh200 / gb200 / dgx spark / arm cloud boxes) by moving to raylib 6.0, which ships a linux_arm64 release.

changes

build.sh

  • pick raylib-6.0_linux_amd64 / linux_arm64 from uname -m
  • link -lX11 on linux, the 6.0 static lib calls X11 directly (undefined reference to XConvertSelection without it)
  • web: 6.0 renamed the archive to libraylib.web.a
  • impulse_wars: capnspacehook/box2d has no linux arm64 release (Extended Build capnspacehook/box2d#3 has been open ~a year), so on arm64 it builds box2d from source at the release tag df25d747 with the same flags as the fork's release.yml, including -DB2_MAX_WORLDS=65534
  • -fsigned-char for clang and nvcc host code. char is unsigned on aarch64 linux and nmmo3 relies on -1 sentinels (see below). no-op on x86 and apple silicon
  • nccl lib search uses /usr/lib/$(uname -m)-linux-gnu instead of hardcoded x86_64

raylib 6.0 api changes

  • DrawCircleGradient takes a Vector2 center: boss_fight, checkers, go
  • ModelAnimation.frameCount -> keyframeCount: tower_climb. 6.0 still samples gltf at 60fps and integer frames don't blend, so poses are unchanged

the nmmo3 char bug

flood_fill / cellular_automata store -1 in char buffers and check output[adr] == -1. with unsigned char those checks never match, biomes stay 255, and ALL_STONE[season] etc read out of bounds (asan: index 255 out of bounds for type 'char[4]'). terrain for a fixed seed (512x512, rng=42):

build hash tile types
x86_64 9d37398005190c20 12
aarch64, default char adbdce1f0f3e2b27 3
aarch64, -fsigned-char 9d37398005190c20 12

also checked with -ffp-contract=off on both, same hash, so fma contraction on arm doesn't change the maps. building every env with -funsigned-char on x86 and diffing warnings only flagged nmmo3.

tested

  • x86_64 (local, rtx 4060, cuda 13): --cpu builds 76/78 envs, same as raylib 5.5 before the change (matsci needs lammps, robot_arm is cuda only). native trainer builds for breakout, boss_fight, checkers, go, tower_climb, impulse_wars, nmmo3. breakout trains fine (~5.8M sps). --web builds breakout (emsdk 4.0.10)
  • aarch64 + x86_64 (github ubuntu-24.04-arm / ubuntu-24.04): --cpu builds for every folder in ocean/, 82/85 on both archs with identical failures (matsci, robot_arm, osrs which is the shared dir for osrs_*). native trainer compiles and links on arm64 with nvcc 13 (NVCC_ARCH=sm_90, nvml stubs, no gpu on the runner) for breakout, nmmo3, impulse_wars, tower_climb. run: https://github.com/Mantissagithub/PufferLib/actions/runs/34910215978

not tested

  • training on actual arm64 + gpu hardware, the ci runner has no gpu. if anyone on a gh200 / spark can run ./build.sh breakout && ./puffer train that closes the gap
  • visually checking the boss_fight / checkers / go / tower_climb renders under 6.0, they compile but i haven't eyeballed them
  • macos with raylib 6.0 (only the version string changed there)
  • jetson is out of scope, jetpack has no nvml/nccl

- pick raylib linux_amd64/linux_arm64 from uname -m, link -lX11 (6.0 static lib needs it)
- web: 6.0 renamed the archive to libraylib.web.a
- box2d: build from source on linux arm64, no release upstream (capnspacehook/box2d#3)
- -fsigned-char: char is unsigned on aarch64, broke nmmo3 terrain gen
- nccl lib search uses the host multiarch dir
- DrawCircleGradient takes Vector2 (boss_fight, checkers, go), frameCount -> keyframeCount (tower_climb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ARM support

1 participant