Search Issue Tracker

Fixed in 2020.2.X

Fixed in 2019.4.X

Votes

1

Found in

2019.3.0a10

2019.4

2019.4.15f1

2020.2

Issue ID

1306688

Regression

Yes

[Apple M1] Crash on MTLGetEnvCase<MTLErrorModeType> on startup when 'm_Automatic' is set to 0 in the ProjectSettings

Metal

-

How to reproduce:
1. Open the attached project (reproduction.zip)

Reproducible with: 2019.3.0a10, 2019.4.20f1, 2020.1.17f1, 2020.2.0b1
Not reproducible: 2018.4.30f1, 2019.3.0a9, 2020.2.0b2, 2020.2.3f1, 2021.1.0b4, 2021.2.0a3

Reproducible with: Apple M1
Not reproducible with: Windows 10 PC, MacMini_11.0 Intel Iris 1536 MB

First lines of the stack trace:
0x007fff20374502 in __pthread_kill
0x007fff202f5720 in abort
0x007fff202f49d6 in err
0x007fff2864ffe4 in bool MTLGetEnvCase<MTLErrorModeType>(char const*, MTLErrorModeType&, std::initializer_list<std::__1::pair<char const*, MTLErrorModeType> > const&) (.cold.1)
0x007fff2863e1b2 in MTLReportFailure

Notes:
Issue is reproducible when 'ProjectSettings.asset ' contains this:
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: MacStandaloneSupport
m_APIs: 11000000
m_Automatic: 0

Workaround: in the ProjectSettings.asset set the 'm_Automatic' field of 'MacStandaloneSupport' under 'm_BuildTargetGraphicsAPIs' to 1

  1. Resolution Note (fix version 2020.2):

    Crash issue is already fixed and no longer reproducible in 2020.2.0b2 and up. The fix (which is to use Metal API instead of OpenGL in the editor on Apple M1) is being backported to 2019.4.

  2. Resolution Note (fix version 2019.4):

    Fixed in 2019.4.24f1. The crash issue occurs when the editor is set to open a project with OpenGL API on an Apple M1 machine. This backports a fix to force Metal API when opening the editor on M1 machines.

Comments (1)

  1. Valerii_MA

    Oct 06, 2022 09:52

    Our project already had auto API selected and it was not working. The solution is to Add command line arguments to the project in Unity Hub.
    Select the project in the list -> tap three dots (to open the settings) -> Add command line arguments -> type in it -force-metal

    It should work. I think that changing graphic API for Mac Build is not a viable option

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.