Unity 2021.3.Xf1, 2022.3.27f1, 2023.2.20f1 builds on macOS with Silicon unusable

Hello,

Builds on macOS with Silicon processor (tested with URP, macOS Sonoma 14.3.1, MacBook PRO, M1 Max, 32GB) crash without a popup message. It looks like a URP issue I’ve seen since 2020.3.Xf1, but it is just much worse. It feels like Mac becomes overwhelmed when a refresh rate is too high. For example, it might work with 60fps (when using an external screen), but after switching vSync off, the refresh rate becomes higher and then it almost immediately crashes. But the issue is not related to vSync most likely, because it crashes the same way when I don’t use an external screen and MacBook has 120fps with vSync on.

[EDIT] However, today I couldn’t verify that it happens also with V-Sync turned on and 120fps, so maybe the bug is related to V-Sync (turned off) itself in fact.

The crash also happens in Unity Editor when e.g. vSync is not used and there is high fps in Play mode.

I tested it with Silicon versions, IL2CPP and URP: 2021.3.1f1, 2021.3.15f1, 2021.3.17f1, 2021.3.22f1, 2021.3.37f1, 2021.3.38f1 (2021.3.38f1 - both Mono and IL2CPP).

[EDIT]: I’ve also just tested it with 2022.3.27f1 and 2023.2.20f1 - it crashes the same way. 6000.0.0f1 preview version crashes too, but it has broken my project slightly (e.g. prefabs), so I can’t say for sure - however those broken bits shouldn’t rather matter for this particular test.

@Phil_Z , @KevinWelton , is Unity Technologies going to fix this bug before the end of support of 2021.3.Xf1 versions? I know that there were some fixes around URP (and maybe other render pipelines). Are you going to backport them to 2021.3.Xf1?

In the log I can’t see anything useful. It just outputs “Thread 0x16c56b000 may have been prematurely finalized”

I’ve attached some images showing the crash.


Hello,

I’ve also just tested it with 2022.3.27f1 and 2023.2.20f1 - it crashes the same way. 6000.0.0f1 preview version crashes too, but it has broken my project slightly (e.g. prefabs), so I can’t say for sure - however those broken bits shouldn’t rather matter for this particular test. As @bbyford mentioned in the thread Unity apple silicon M1 version crashes very often page-2, it is more stable with V-Sync, but as I mentioned earlier, V-Sync rather doesn’t matter itself, but rather the frame refresh rate (fps) itself. The higher the refresh rate, the bigger chance of the crash. However, today I couldn’t verify that it happens also with V-Sync turned on, so maybe in fact the bug is related to V-Sync itself. In my tests, the rendering thread crashes almost immediately once the refresh rate becomes higher than 60fps (or maybe when V-Sync is off - I am not sure - today it worked with V-Sync on and 120fps) Maybe something was fixed in relation to Unity apple silicon M1 version crashes very often page-2 ( @Tautvydas-Zilys mentioned that it was “a race condition in our jobsystem synchronization mechanism that only applied to ARM processors”), but it looks not all was fixed around the crashes of the rendering thread. Usually, the thread playing sounds doesn’t crash even when the rendering thread crashes.

[EDIT] From time to time there is a period when it is more stable even with V-Sync off (some random factors probably), but still with V-Sync off the rendering thread crashes finally after some time.

Some time ago I reported it to Unity and now I am waiting for their reply. After a lot of testing I noticed that the issue with VSync is triggered when Lighting → Main Light is disabled in the Universal Render Pipeline asset. When it is disabled, turning off VSync causes issues such as hanging a build. My theory is that some other similar issues that appear randomly e.g. during startup might be caused by this too because (my theory only) some settings might be turned off on startup such as Lighting → Main Light or VSync, but this is something Unity should check.

My prototype game is also just crashing with Unity 2023.2 on macOS specifically.
I’m using x64 builds (Editor is fine)

I have reported several incidents to Unity around crashes on macOS with Silicon with many projects including their own sample projects, but they seem to have problems to reproduce the crashes - at least so far they haven’t confirmed that.

Do your crashes happen with vSync off?

vsync is on. I will note its kind of random. It crashes like 80% of the time but 20% of time will work. Feels like its happening while loading.
I was testing on a 2018 MacMini.

I just went back to Unity 2022.3