Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Bug Apple Silicon 2021.2.0b9 + macOS 12b6 | Shader compiler crashes when opening any project

Discussion in '2021.2 Beta' started by DrewFitz, Sep 1, 2021.

  1. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    I've been using the Apple Silicon preview editor on Monterey since it released with relatively few issues. But today I can't open any projects, even fresh, empty built-in render pipeline projects with the AS preview editor. The 2020 LTS editor seems to be fine.

    As I was writing this, I downloaded the Intel version of 2021.2.0b9 and verified that it launches successfully.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,818
    Please submit a bug report - we'll investigate.
     
  3. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    Submitted: Case 1361979
     
    aleksandrk likes this.
  4. Fitts

    Fitts

    Joined:
    Jul 6, 2017
    Posts:
    3
    For anyone affected by this that doesn't want to use the full Intel version of the editor, as a workaround you can replace some of the arm64 executables and libraries in the Apple Silicon editor package /Contents/Tools/ with their equivalent versions from an Intel install, and just letting those specific tools that aren't working in beta 6 run under Rosetta instead of the entire editor. Replacing the following four files got it to work for me:

    -UnityShaderCompiler
    -D3Dcompiler_47.dll
    -gslang.dylib
    -libdxcompiler.dylib

    There might be a few things that aren't working that I haven't run into yet, but this is enough to get my project open and running and building.
     
    Last edited: Sep 3, 2021
    DrewFitz likes this.
  5. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    Thanks for the workaround! It works!
     
  6. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    Verified that this issue still persists in beta 10.
     
  7. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    Verified that this issue still persists in beta 11.
     
  8. sk0g

    sk0g

    Joined:
    Mar 5, 2021
    Posts:
    33
    With the above workaround, anyone else getting random crashes? I get it when dealing with heavy inspector changes (particles), as well as when exiting play mode at times. Unity just hangs up and I have to force quit it to get going again.
     
  9. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,423
    I just finished implementing the fix today. Hoping to get it in soon.
     
    DrewFitz and sk0g like this.
  10. sk0g

    sk0g

    Joined:
    Mar 5, 2021
    Posts:
    33
    Amazing news! Excited to check it out, appreciate the effort that's been going into as small a market as M1 Macs may be right now.

    Is the issue related so some changed VM handling in beta 6? JetBrains IDEs broke with this beta too, but they haven't addressed or fixed it yet.
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,423
    Nah, we were accidentally using the x18 register in our assembly code which is apparently reserved on Apple silicon (and Monterey started using it for its own purposes).
     
  12. DrewFitz

    DrewFitz

    Joined:
    Dec 9, 2016
    Posts:
    30
    Fascinating, I’d love to know how you tracked that down, sounds like a tricky bug!
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,423
    Figuring out how to fix it was harder than figuring out what was going on :). Attaching a debugger was enough for it to tell me that we were crashing when trying to use the value read from that register.
     
  14. alex_bussman

    alex_bussman

    Joined:
    Aug 15, 2013
    Posts:
    5
    It also seems like this issue is gone with macOS 12 beta 7
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,423
    Looks like we weren't the only ones fixing stuff then :).
     
    alex_bussman likes this.