Metal API Validation is crash on iOS15

Unity 2019.4.13f1
Xcode13 / iOS15

If Metal API validation is checked in Unity-generated Xcode, the app will crash immediately after launching on iOS 15.

The crash is as follows. I’m not familiar with shaders and metal so I don’t know where to debug.
Can anyone give me a hint?

1 Like

Hi! This sounds like something we definitely want to fix.
We weren’t able to reproduce this issue in-house however, tried both a new empty project as well as a big, graphics heavy project.

Could you report a bug and post the bug ID here once you do that? Would be perfect if you include the repro project together with the bugreport, as it seems there’s something more to the issue than just enabling Metal API validation.

1 Like

Thanks for your post - having the same issue and turning off the API validation worked for me.

1 Like

Thank you for your reply.
I created bug report No.1377349 and attached a sample project that causes a crash. (Perhaps the graphic setting “Use HDR” is also related to this issue.)
I would appreciate it if you could check it.

I was informed by Unity support that it will be resolved after updating to Unity2020.3.19f1. I would like to try it.

I had the same issue building a macOS binary using Unity 2020.3.24f1. Shutting off MetalValidation in the Unity Player settings did not fix it. I had to remove metal support and replace with OpenGLCore support, which meant it can’t run on Apple Silicon

We are also experiencing this exact bug on 2021.3.4f1 with XCode 13.4.1.

It got us completely stumped.

This cannot be “the same issue” as the issue with metal validation specifically. please bug report with smallish repro project

Please bug repot with small repro project

@Alexey Hi, we faced the same crash on iOS. Disabling “Use HDR” leads to other graphics issues. Unfortunately I can’t provide any sample project. Only information from Firebase. My post with info .

where is answer

where is answer

Using unity 2022.3.4, xcode project generated from unity are not disable Metal Validation even we not checking it in the unity. It seem the setting may change the name or unity have a bug in xcode project generation code

xcode project generated from unity are not disable Metal Validation even we not checking it in the unity
if i read it correctly: this is set from unity when you choose “debug” config in xcode. We don’t have it tweakable in unity itself - i assume you mean something-Metal-Validation in player settings - this is different thing (named confusingly, i know) for when we enable extra code in editor to check for possible issues

1 Like

I see, thanks for your clarification

However then this behaviour is something completely unexpected. I mean then unity have no way to debug without metal validation, and then metal validation will crash unavoidably like this. Which imply unity can’t run with debug option in xcode anyway?

I mean then unity have no way to debug without metal validation, and then metal validation will crash unavoidably like this.

what are you referring to? i mean - i personally run everything with validation so, yeah, details/bug/repro?

I got the same error as the original thread

-[MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion `MTLResource 0x109505500 (label: DrawableProxy), referenced in cmd buffer 0x129eb0000 (label: (null)) is in volatile or empty purgeable state at commit'

dyld4 config: DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libMainThreadChecker.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

huh what unity version are you using? That was supposed to be fixed quite some time ago. Also - is it a “normal” startup, or during frame capture (i saw it happening with the latter sometimes till and we were not able to find what is happening, using newer hw/ios helped though; sorry for not exactly helpful resolution ;-))

I used 2022.3.4

I just build and run project with development build. And it come to this line and stuck. I need to manually disable metal api validation in xcode and rerun the project

That sounds very weird: again, i’ve been running plenty of projects on 22.3 with metal validation. Please bug report with repro project (preferably small) and details about device you used

If that was the case then maybe it was because some PBXProj setting for facebook. I would investigate it further myself first. Thanks for your information