Lumen & Nanite on MacOS

Basically, finish what I was doing here: GitHub - philipturner/ue5-nanite-macos: Nanite on macOS. I needed to replace some textures with buffers in the UE5 source code. Should be easy peasy for engine maintainers, but not myself because I’m not familiar with the code base. Hence why I personally couldn’t debug it in a reasonable amount of time, and gave up.

The rest is simply translating the Metal code here into HLSL and creating some Metal commands to deinterleave the two 32-bit halves into a full 64-bit word. Creating the Metal shader was the hardest part and that was done a year ago.

3 Likes

Any updates regarding Unreal Engine 5.3 for macOS on M1 CPUs?

3 Likes

Desperately waiting for Nanites on M1 solution, most of us have M1.

No nanites is a deal-breaker since it’s the only way to displace Landscapes with the new Nanite landscapes and VHF doesn’t work for large landscapes.
I don’t understand what an M1 ultra is missing that an M2 has.

1 Like

I’m a Software Developer, I’ll try to explain but I just googled it for a bit. Nanite is dividing geometry/textures into 64 atomics when doing its internal magic. M1 Hardware uses 32 atomics so Nanite would throw an error since it can’t fit data meant for 64 atomics into 32 atomics hardware. The solution would be to implement a conversion layer, which would be a bit slower but in theory double. The problem is no one so war was able to do it.

3 Likes

@jon_eg Very very happy about Epic’s recent effort to support Apple Silicon! That being said - like for many others, M1 was a reason for a major system upgrade for me, and that investment has to work for several years. If support is limited to M2, Unreal adoption is not the way to go. If M1 support is something you guys are not likely pursuing in the near future, it would be appreciated to have some indication of that. Otherwise it will just waste people’s time. My fingers are crossed. Thank you!

4 Likes

Maybe this is the cause

Good news, the A17 Pro chip supports the same atomics as M2. So we can have Nanite running on the iPhone with existing software. Also Apple Vision Pro would support it.

But I kind of feel like TSMC N3 is superfluous. The iPhone 13 Pro Max with 120 Hz is already sufficient, because it has 120 Hz. And Apple Vision Pro, while it is the future, we need a revolution in manufacturing technology to make that stuff affordable. $3000 in perpetuitās.

While Apple has monopolistic tendencies (which is not good in any industry) I would think Epic is better than that. Honestly someone just shove the Epic codebase into GPT-4 and ask it to write the 64-bit atomics workaround.

That lawsuit is still going on. Now both companies are attempting to take it to the Supreme Court.

I want to emphasize that when I took on this challenge ~1 year ago, I knew it was possible. I thought it was something fun to occupy myself with, and contribute something positive using my rare GPU expertise. It would be time-consuming, but definitely possible. I only stopped halfway through because I found a new field I was interested in. Sorry for finishing halfway and then continuing to complain on the forum, about how it wasn’t finished.

There will be a performance decrease, there’s no denying that. But you must quantify how much decrease, and in respect to what. It’s not going to divide execution speed by ∞; the theoretical worst case is 2.5-5.0x slower. And not the entire game 2.5-5.0x slower, just one component of the wider render pass. You can also just decrease the screen resolution and/or use MetalFX upscaling. Which I did to make a ray tracer generating 640x640 → upscaled 1920x1920 at 120 FPS. Nanite at 640x640 seems just fine even in the most pessimistic worst case of performance imaginable.

Realistically, the overall game might have 1.5x less FPS than if M1 had hardware atomic_ulong. But it would be ∞% more FPS than if Nanite wasn’t supported at all. Which is where most Mac, PC, and Android users are right now. It’s not just M1 who could benefit from the atomic64 emulation algorithm.

5 Likes

We have kind of solution here:

But I didn’t check it for now and believe that repository should be revised and updated or forked and updated

2 Likes

It has been a while and MetalFX isn’t there :frowning:
Do you know where that post is?

1 Like

UE5 uses a fork of FSR 2.0, which is optimized for AMD. FWIW AMD’s open-source framework is great work. But on performance-constrained M1 or A17 where every ounce of performance determines whether something like AI upscaling is feasible, MetalFX can be the deciding factor. They added 3x upscaling with macOS Sonoma which works wonderfully for my purposes.

4 Likes

How to enable MetalFX upscaling in UE? not sure if there’s any metalfx plugin for sample projects.

3 Likes

Lumen works fine on m1+, acc to doc page, haven’t tried per se as I returned new m2 as was too slow given hw choices. Found M1 Max for 1499, which is crazy for wharbu get I think, but I’ve found so far, Mac stopped ue crash , let me force stopseveral apps then kept going , ue didn’t crash after that. Color me impressed. Why is Mac hw so crazy expensive ?

Ty good to know!