Skip to content

fix: ARM64 (aarch64) Linux build support - #3345

Open
scottybo wants to merge 1 commit into
alvr-org:masterfrom
scottybo:fix/arm64-aarch64-linux-support
Open

fix: ARM64 (aarch64) Linux build support#3345
scottybo wants to merge 1 commit into
alvr-org:masterfrom
scottybo:fix/arm64-aarch64-linux-support

Conversation

@scottybo

Copy link
Copy Markdown

Summary

Fixes two issues that prevent ALVR from building natively on ARM64 Linux, and adds a wiki guide for aarch64 builds.

Tested on NVIDIA DGX Spark (GB10 / Blackwell, aarch64) running Ubuntu 24.04.


Fix 1: char signedness in alvr_server_openvr

On ARM64, C char is unsigned by default (u8), unlike x86-64 where it is signed (i8). This caused a compile-time type mismatch:

error[E0308]: mismatched types
   --> alvr/server_openvr/src/lib.rs:184:28
    |
184 |         m_captureFrameDir: capture_frame_dir,
    |                            ^^^^^^^^^^^^^^^^^ expected `[u8; 1024]`, found `[i8; 1024]`

Fix: Change [0i8; 1024][0u8; 1024]. The existing .cast() on the pointer copy already handles both types correctly.


Fix 2 + Docs: OpenVR ARM64 build requirement

OpenVR does not ship a prebuilt libopenvr_api.so for Linux ARM64. Added:

  • A comment in build.rs explaining how to build it from source (compiles in ~30s)
  • A full wiki page: Building-on-Linux-ARM64-(aarch64).md

Build results on DGX Spark

Artifact Architecture
bin/alvr_dashboard ELF 64-bit, ARM aarch64 ✅
lib64/alvr/bin/linux64/driver_alvr_server.so ELF 64-bit, ARM aarch64 ✅
FFmpeg NVENC encoders (h264/hevc/av1) Built, CUDA/NVENC detected ✅
[INFO egui_wgpu] Available adapters: NVIDIA Tegra NVIDIA GB10 (Vulkan, IntegratedGpu)

Note: SteamVR does not run on ARM64 Linux, which limits streaming to non-SteamVR workflows. Happy to follow up with an issue/PR on standalone OpenXR server mode if that would be useful.

Two fixes to allow ALVR to build natively on ARM64 Linux:

1. Fix char signedness in server_openvr (aarch64 uses unsigned char / u8)
   - alvr/server_openvr/src/lib.rs: [0i8; 1024] -> [0u8; 1024] for
     capture_frame_dir, which is a C char array. On ARM64 'char' is
     unsigned by default, causing a type mismatch at compile time.

2. Document OpenVR ARM64 build requirement in build.rs
   - OpenVR does not ship an ARM64 Linux prebuilt; added comment in
     build.rs explaining how to build libopenvr_api.so from source.

3. Add wiki/Building-on-Linux-ARM64-(aarch64).md
   - Step-by-step guide for building on aarch64 (tested on NVIDIA
     DGX Spark / GB10 with Ubuntu 24.04 and CUDA/NVENC).
   - FFmpeg NVENC encoders (h264/hevc/av1_nvenc) compile and work.
   - alvr_dashboard and driver_alvr_server.so confirmed aarch64 ELF.

Tested-on: NVIDIA DGX Spark (GB10 / Blackwell), Ubuntu 24.04, aarch64
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.

1 participant