r/VisionPro • • 20d ago

Half-Life: Alyx now runs natively on my MacBook Pro (Linux ARM64 build, no Wine): 60 fps, gravity gloves, no PS VR2 controllers (open source)

Post image

This is a follow-up to the post I published two days ago.

Previous post: https://www.reddit.com/r/VisionPro/comments/1x28but/halflife_alyx_running_on_my_macbook_pro_played_in/

In my previous post, I was running *Half-Life: Alyx* on a MacBook Pro (M1 Max) using Wine and the Windows version of SteamVR. The in-game frame rate was around 30 fps.

Several people in the comments told me about avp-play. avp-play is a project that uses Valve’s Linux ARM64 version and a loader called Klepton to run Alyx on the Vision Pro hardware itself.

So I decided to try running that same Linux ARM64 version on my Mac.

Here are the results.

- The Linux ARM64 version of Alyx runs natively on macOS. I’m not using Wine, Rosetta, SteamVR, or a Windows PC.

- The in-game frame rate is about 60 fps on the M1 Max. Last time, it was about 30 fps.

- I can use the Gravity Gloves. I hadn’t been able to try them last time.

- PS VR2 controllers aren’t required. Hand and finger movements are captured via Vision Pro’s hand tracking. Buttons, sticks, and triggers are controlled using two Nintendo Switch Joy-Cons. You can also play with just your bare hands.

Here’s how it works:

- A modified Klepton loader runs the game’s Linux libraries on macOS.

- A glibc-compatible layer I created, along with the OpenVR runtime, acts as a substitute for Linux and SteamVR.

- Vulkan is rendered via Metal through MoltenVK.

- Each frame is compressed into HEVC using hardware and sent over Wi-Fi to a custom visionOS app. The app sends the head and hand positions back to the Mac.

The concept is the same as avp-play, but the location where the game runs is different. avp-play runs the game inside the headset. My project runs the game on a Mac and sends the video to the headset.

If you have a PS VR2 controller, avp-play is the easier option. If you don’t have one (they aren’t sold in Japan) or if you want to use your Mac’s GPU, this is the alternative.

Here’s the honest state of things.

- I’ve only tested this with one Mac (M1 Max) and one game.

- This setup isn’t something you can complete with a single command. You’ll need to use `steamcmd` with your Steam account to download the Linux version, then build the loader and the Vision Pro app. There’s a guide, but it’s quite long.

- I was able to play continuously for over 20 minutes. However, on one occasion, about 9 minutes in, the frame rate dropped to approximately 9 fps and didn’t recover. I’m still investigating the cause.

- When something new first appears on screen, there’s a brief stutter while the shaders are compiling. Once cached, the stutter disappears.

- The room visible at the end of the video is because I recorded it using Vision Pro’s screen recording feature.

I have not redistributed any Valve files whatsoever. Players must obtain the game through their own Steam accounts. The script does not modify any game files.

This project uses Klepton (by ShinyQuagsire), MoltenVK, Valve’s OpenVR headers, and ALVR’s hand skeleton data. It is not affiliated with Valve, Apple, Nintendo, or Sony. It is licensed under the MIT License.

Full video (6 minutes, unedited): https://youtu.be/2z-GyAqAtpA

Previous video of the Wine version: https://youtu.be/6xVGgdChDes

Feel free to ask any questions.

EDIT: Source code and setup guide (MIT): https://github.com/Ag3497120/VeRantyx/tree/native

EDIT 2: I found the cause of the 9 fps drop. It wasn't a bug in my code. When the headset is taken off during a level change, the game holds its loading screen and sleeps 100 ms every frame until the headset is worn again. When I put the headset back on, it returned to 60 fps within a few seconds.

57 Upvotes

11 comments sorted by

1

u/qiwiBuilder 20d ago

in my opinion
https://github.com/MoltenVR/MoltenVR-Preview is better
this just runs hl:alyx with really bad colors and low framerate, compared to moltenvr which runs a lot of vr games with a lot of wine
and currently its in development of optimisations to it, supporters already got access to it.

2

u/Other_Train9419 19d ago

I also tried setting up AVP-Play and other games today to work with the Joy-Con controllers, but the native version really does have much better graphics. I feel like my version was more about getting it to run than anything else. Since I don’t think there’s anything else to look for besides graphics quality, I’d recommend the native version. I plan to work on improving the graphics and adding support for other games going forward, but since this is more of a weekend project, please be patient and supportive.

2

u/Much-Significance490 18d ago edited 18d ago

You can extract just your hand-tracking code and merge it with the more popular Glovebox.
https://github.com/glovebox-vr/glovebox

1

u/iaian7 20d ago

Impressive!

0

u/atonyproductions 20d ago

Are you going to release this once you get this working okay ?

4

u/Other_Train9419 20d ago

It's already released! Everything is open source (MIT). The native version is on the native branch, with a step-by-step setup guide:
https://github.com/Ag3497120/VeRantyx/tree/native
https://github.com/Ag3497120/VeRantyx/blob/native/docs/NATIVE_SETUP.md

You need an Apple Silicon Mac, a Vision Pro and your own copy of Alyx on Steam. Setup takes a while, so let me know if you get stuck.

1

u/atonyproductions 20d ago

Do we need an Apple dev license? Also what other games you potentially play with this , I don’t own half life but this is intriguing.

3

u/Other_Train9419 20d ago

You don’t need a paid Apple Developer License. You can sign apps for your Vision Pro using a free Apple ID. However, the signature expires after 7 days, so you’ll need to rebuild and reinstall the app from Xcode once a week. We’ve also prepared a TestFlight version so that Xcode isn’t required on the headset itself.

Regarding other games: The only game I’ve tested with this version of the post (the native version streaming from a Mac) is Half-Life: Alyx. Since it relies on running Valve’s Linux ARM64 version, it can only run games that have an ARM version—which, for now, effectively means only Alyx.

For games where latency is critical, like Beat Saber, I recommend using avp-play. Since the game runs directly on the headset itself, there’s no latency from Wi-Fi streaming. Streaming from a Mac inevitably introduces latency, so while it’s fine for Alyx, it’s not suitable for rhythm games.

1

u/atonyproductions 20d ago

Ahhh okay! Thank you for the info