Lumen & Nanite on MacOS

Just an FYI, I set the GI to Screen Space(Beta) and got this look. Will hold me to 5.2!

1 Like

I just got a M2 Max (38 GPU cores) and 64 GB RAM, and just built UE5.2 and am running it for the first time.
What can I do to help?
Lumen seems to work OK at first site in the standard FPS template. Nanite visualization does not do anything, despite it being on in project settings.

1 Like

Oh that’s great! I haven’t learnt how to build my own yet, that would be my start for sure. UE5.2 appears to be a nice update from what I’ve been seeing.

thx

~t

You could test whether M2 supports 64-bit atomic min/max!

1 Like

Building it was quite easy actually with the instructions provided on the github repo. Just took some waiting time.

1 Like

Followed the steps and got this on MacOS 13.2.1, XCode 14.2, M2 Max:
2023-03-06 21:35:18.422251+0100 Atomics[64267:1072961] Metal API Validation Enabled

2023-03-06 21:35:18.467293+0100 Atomics[64267:1072961] Use of MTLCreateSystemDefaultDevice is not supported for non-interactive (commandline or daemon) apps. Use MTLCopyAllDevices(WithObserver) instead.

Atomics/main.swift:37: Fatal error: Unexpectedly found nil while unwrapping an Optional value

2023-03-06 21:35:18.467564+0100 Atomics[64267:1072961] Atomics/main.swift:37: Fatal error: Unexpectedly found nil while unwrapping an Optional value

I forgot to update the device selection! Try again with the new patch.

Also, I think I messed up the test on the AMD GPU. Atomics might potentially work there after all.

Got a bit further:
2023-03-07 19:47:49.806537+0100 Atomics[65013:1197051] Metal GPU Frame Capture Enabled

2023-03-07 19:47:49.806841+0100 Atomics[65013:1197051] Metal API Validation Enabled

Atomics/main.swift:95: Fatal error: Unexpectedly found nil while unwrapping an Optional value

2023-03-07 19:47:49.829117+0100 Atomics[65013:1197051] Atomics/main.swift:95: Fatal error: Unexpectedly found nil while unwrapping an Optional value

(lldb)

You sure the Metal shader is copied into the Xcode project and checked for inclusion in the current Xcode scheme?

Ah sorry. Not so familiar with XCode. Here’s the new output:

2023-03-08 21:55:39.386229+0100 Atomics[65754:1292291] Metal GPU Frame Capture Enabled

2023-03-08 21:55:39.386585+0100 Atomics[65754:1292291] Metal API Validation Enabled

Deviation: (colorDeviation: 0.0, depthDeviation: 0.0)

There were 187 data races with error code 1.

Test 1 took 6 milliseconds.

Deviation: (colorDeviation: 0.0, depthDeviation: 0.0)

There were 145 data races with error code 1.

Test 2 took 3 milliseconds.

Deviation: (colorDeviation: 0.0, depthDeviation: 0.0)

There were 133 data races with error code 1.

Test 3 took 3 milliseconds.

Deviation: (colorDeviation: 0.0, depthDeviation: 0.0)

There were 197 data races with error code 1.

Test 4 took 3 milliseconds.

Deviation: (colorDeviation: 0.0, depthDeviation: 0.0)

There were 151 data races with error code 1.

Test 5 took 3 milliseconds.

Program ended with exit code: 0

You tested the 64-bit atomic emulation, which succeeded. Can you disable the variable for emulating64BitAtomics and - if it succeeds - provide a screenshot (Shift + Cmd + 4) containing the script + its console output?

1 Like

here you go. I guess this means it’s not supported natively?

It is supported!!! Thanks so much for your help! Do you have a GitHub username for me to give you credit?

Updated uarch docs with this discovery: GitHub - philipturner/metal-benchmarks: Apple GPU microarchitecture

1 Like

Ooh cool! That’s great news actually. I thought the second last line was bad news haha
My username is jelmer3000 :slight_smile:

So… is there a way to make Nanite work (efficiently) on MacOS running on M2 SOCs?

edit: how can you check if Nanite is working? Because I have this heavy project that I opened on UE5.2 on MacOS on M2:

  • lots of meshes have Nanite enabled
  • those meshes show in the viewport Lit mode etc, everything looks like it does on Windows
  • However, nanite visualization does not show anything.

Since the project is running smoothly and the meshes are showing, is Nanite then secretly working? How to check?
I’m not so familiar with these debug tools, but don’t these stats say a lot? M2 Max 38 cores.
Screenshot 2023-03-14 at 16.49.23

Hi Menesis

I need your review on using this machine for UE5. I am planning to buy one of same config, but with 32GB memory

For me, using my Mac for UE is just a test so I can’t say too much about it. I work on a VR app am using UE primarily on Windows with a Desktop RTX3070.
I also do notice some visual artifacts in UE5.2 on Mac versus 5.1.1 on Windows, some firefly-effect in specular parts of the shaders in the distance it seems.
I must say that I am impressed with how my current project runs on the M2 mac, it feels just as smooth as on my desktop RTX 3070, but don’t have any hard data to draw a comparison between the M2(38) and an RT3070 in UE.

Nanite is in a half-enabled state. I detail it extensively on my README, it will probably answer your questions

3 Likes

Thanks mate for the info.

Definitely a huge performance improvement in 5.2 preview on Mac.

4 Likes