Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Metal API Validation is crash on iOS15

Discussion in 'iOS and tvOS' started by mhiosdev, Oct 20, 2021.

  1. mhiosdev

    mhiosdev

    Joined:
    Jun 18, 2018
    Posts:
    3
    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?

     
    Last edited: Oct 20, 2021
    Zenix likes this.
  2. robertas-unity

    robertas-unity

    QA Minion Unity Technologies

    Joined:
    Mar 24, 2015
    Posts:
    29
    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.
     
    mhiosdev likes this.
  3. Zenix

    Zenix

    Joined:
    Nov 9, 2009
    Posts:
    213
    Thanks for your post - having the same issue and turning off the API validation worked for me.
     
    mhiosdev likes this.
  4. mhiosdev

    mhiosdev

    Joined:
    Jun 18, 2018
    Posts:
    3
    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.
     
  5. mhiosdev

    mhiosdev

    Joined:
    Jun 18, 2018
    Posts:
    3
    I was informed by Unity support that it will be resolved after updating to Unity2020.3.19f1. I would like to try it.
     
  6. EricZinda

    EricZinda

    Joined:
    Jul 31, 2019
    Posts:
    2
    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
     
  7. GRobecchiBeecot

    GRobecchiBeecot

    Joined:
    Feb 9, 2022
    Posts:
    1
    We are also experiencing this exact bug on 2021.3.4f1 with XCode 13.4.1.

    It got us completely stumped.
     
  8. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    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
     
  9. AnswerFinder

    AnswerFinder

    Joined:
    May 2, 2015
    Posts:
    7
    @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.
     
  10. Tinynine

    Tinynine

    Joined:
    Apr 7, 2023
    Posts:
    3
    where is answer
     
  11. Tinynine

    Tinynine

    Joined:
    Apr 7, 2023
    Posts:
    3
    where is answer
     
  12. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,157
    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
     
  13. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    > 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
     
    Thaina likes this.
  14. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,157
    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?
     
  15. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    > 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?
     
  16. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,157
    I got the same error as the original thread

    Code (CSharp):
    1. -[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'
    2.  
    3. dyld4 config: DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libMainThreadChecker.dylib:/usr/lib/libMTLCapture.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
     
  17. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    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 ;-))
     
  18. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,157
    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
     
  19. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,623
    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
     
  20. Thaina

    Thaina

    Joined:
    Jul 13, 2012
    Posts:
    1,157
    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
     
  21. anonimgrafin

    anonimgrafin

    Joined:
    Jul 23, 2023
    Posts:
    2
    same problem
     
  22. thePostFuturistUnity

    thePostFuturistUnity

    Joined:
    Nov 16, 2012
    Posts:
    53
    I resolved this error by unchecking Main Thread Checker in XCode
     

    Attached Files: