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

Unity on Apple silicon and Big Sur: Known issues and workarounds

Discussion in 'macOS' started by Tautvydas-Zilys, Jul 10, 2020.

  1. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Well Apple Silicon computers that I would be more likely to describe as more perfect for Unity development are more likely to arrive in 2021, because they are highly likely to have more CPU and GPU cores, so keep that in mind. And whether getting one of this years models or a future one, it would be more sensible to go for one with at least 16GB RAM. And there is some inherent risk to doing stuff on a new platform that not many people, including Unity themselves, have vast experience with yet.

    I really like the M1 machines. I had other non-Unity reasons to get one, and I also wanted to target that level of machine for the results of my development work, not just to develop on. And I really hate high use of electricity, heat, and fan noise. And I really like MacOS. And I do have other computers I can use if I run into any Unity editor problem on M1 Macs in future. So it wasn't too hard a decision for me. But I hesitate to give too strong advice to other people whose full circumstances I dont know.
     
  2. RobertOne

    RobertOne

    Joined:
    Feb 5, 2014
    Posts:
    258
    I made some tests with the m1 mac mini compared to the asus g14 (ryzen7) und my i9 desktop. result:

    Create new project:
    i9: 35,14 sec
    G14: 33,89 sec
    M1: 54,00 sec


    Open blank project:
    G14: 07,17 sec
    i9: 07,47 sec
    M1: 11,44 sec


    Create new script and enter playmode:
    G14: 04,58 sec
    i9: 04,39 sec
    M1: 09,11 sec


    The graphics performance is... impressive. I tested the unity 3d game kit demo(the explorer) with quality to fantastic (max) while having gameview and sceneview open at the same time:

    i9 2080Ti: ~ 150FPS(+-50)
    M1: ~ 80FPS(+-20)
    1660 Ti MaxQ(Laptop): ~100FPS(+-20)

    So the good thing: the m1 mac mini is sooooo quite. the fans never kicked in, i also never filled the 8gb ram. max 7 gb of ram usage. the price is also the third of my desktop pc and half of the g14

    the bad thing: waiting 10 seconds to enter playmode is to much for me. i hope this will change once unity is running native on the m1
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    The thing that really hurts Unity when running on Rosetta is that during domain reloads, code gets JITted twice: once by Mono to x64 from IL, then by Rosetta to ARM64, essentially doubling the work. Disabling automatic domain reloads should speed things up A LOT: https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html
     
    mike6502 likes this.
  4. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I was looking forward to testing out my M1 mac mini but my project crashes on startup during import. Different file everytime. version 2019.4.16. Bug report submitted, case 1298397.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Is your project configured to use OpenGL? For some reason it's not using Metal according to the log. And OpenGL on Apple silicon is not exactly "supported".
     
  6. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I was working on it on Windows, shuffled it over with dropbox and opened it on the mac with a fresh Library, so no doubt a lot could be funky. Is there something I can do to help it along?

    EDIT: I've tried a few other projects and they all crash at "Compiling scripts..."
     
    Last edited: Dec 10, 2020
  7. Klausology

    Klausology

    Joined:
    Aug 29, 2017
    Posts:
    131

    Oh man, I wish I could disable domain reloads. But because I am using batchrenderergroup api in my project, if I disable automatic domain reloads, Unity eventually crashes. :(
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Try launching the editor using "-force-metal".

    Are you by any chance not disposing buffers? Sounds like a memory leak.
     
  9. Klausology

    Klausology

    Joined:
    Aug 29, 2017
    Posts:
    131
    This is what I am thinking too. I had been following the guide from this blogpost >> https://virtualcast.jp/blog/2019/10/batchrenderergroup/

    I've ensured that I have disposed of the nativearrays and batchrenderergroup I am using, but alas, I must still be missing something I suppose.
     
    Phrygian likes this.
  10. kubimtk

    kubimtk

    Joined:
    Jan 11, 2018
    Posts:
    2
    I have new issue: On my MacBookPro M1 the unity editor opened with hub hangs always (with 2019.4.8f1) on opening an old project (even after upgrading to 2019.4,16f1 on my intel Mac). The last lines in the editor log are these:
    -------------------- Snip --------------------
    Initializing Unity extensions:

    Unloading 1 Unused Serialized files (Serialized files now loaded: 0)

    System memory in use before: 0.61 GB.

    System memory in use after: 0.61 GB.


    Unloading 2123 unused Assets to reduce memory usage. Loaded Objects now: 920.

    Total: 2.249625 ms (FindLiveObjects: 0.138292 ms CreateObjectMapping: 0.046542 ms MarkObjects: 0.980041 ms DeleteObjects: 1.084292 ms)


    [MODES] Loading mode Default (0) for mode-current-id-Idle Mafia Boss

    -[MTLTextureDescriptorInternal validateWithDevice:]:1248: failed assertion `Texture Descriptor Validation

    MTLTextureDescriptor has width of zero.

    '
    -------------------- Snap --------------------

    Is there any possibility to avoid this error (deleting some local file / edit configuration or so?
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    I assume the project didn't have the library folder? Looks like one of the assets is making an engine hit a bug in the engine where it passes bad parameters to Metal. Quickest way to figure out which one it is is to do a binary search: delete half your assets, check if problem went away, and keep doing it until you find the culprit.

    We'd still like a bug report on it since it is definitely a bug in Unity.
     
  12. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Thank you, this worked. It loaded in Windows mode, but I reloaded the project normally with iOS and it's now fully functional.

    I'm worried about Metal editor though. Last time I used this (2018.3) it was a nightmare. Crashing, glitches, wrong colors. I hope it's working properly by now.
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Metal editor has been default for quite a while now. Our support has shifted to Metal entirely, and we consider OpenGL deprecated on macOS ever since Apple announced the deprecation.
     
    Full_Tilt likes this.
  14. Full_Tilt

    Full_Tilt

    Joined:
    Apr 25, 2018
    Posts:
    16
    Thank you very much! That was a huge help. A note for others...
    I wasn't able to run the command line, even with the option to force metal because it would just open the Unity Hub again. I opened the project on a different machine and enabled metal support for the editor under "Project Settings -> Player -> Other Settings -> "Metal Editor Support". My project is three years old and at least when I started it, that must not have been the default. Changing this fixed my crash-on-start problem. Here is my `git diff` on the project after this change:
    Code (csharp):
    1.  
    2. --- a/ProjectSettings/ProjectSettings.asset
    3. +++ b/ProjectSettings/ProjectSettings.asset
    4. @@ -235,7 +235,7 @@ PlayerSettings:
    5.    iOSURLSchemes: []
    6.    iOSBackgroundModes: 0
    7.    iOSMetalForceHardShadows: 0
    8. -  metalEditorSupport: 0
    9. +  metalEditorSupport: 1
    10.    metalAPIValidation: 1
    11.    iOSRenderExtraFrameOnPause: 0
    12.    iosCopyPluginsCodeInsteadOfSymlink: 0
    13.  
     
    Last edited: Dec 11, 2020
  15. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I got caught by that too but it's much simpler than I thought. In the Hub, click on the 3 dots to the right of the project and choose "advanced project settings". In the text box that pops up, you can just type in -force-metal.
     
    Full_Tilt likes this.
  16. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I've discovered that removing the command line switch makes it crash again so the metal option seems to not be saved in the project on exit. I can confirm that it was set to metal in project settings before saving and exiting.
     
  17. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Another couple bugs.

    I have a secondary 1920x1200 monitor in portrait mode. If I maximize a game window on it, FPS drops down to 2 or so, and Semaphore.WaitForSignal takes up to 90%. Un-maximizing the window restores proper FPS. This happens on all projects-- even a new project with a blank scene.

    Compute Skinning in Project Settings definitely does not work on M1 mac. Not really surprising but if your app is bound for the mac app store, it will bug out with this enabled.
     
  18. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    You should be able to switch editor to metal permanently by doing two things:

    1. Make sure Metal graphics API is at the top of GFX API list for macOS Standalone Player;
    2. Make sure Metal editor support checkbox is checked in player settings.

    Can you report bugs on these? Compute skinning should be working.
     
  19. Full_Tilt

    Full_Tilt

    Joined:
    Apr 25, 2018
    Posts:
    16
    Once I set the "Metal Editor Support" in PlayerSettings, it persisted across Unity app launches. No problems on subsequent launches.
     
    JohnnyFactor likes this.
  20. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Ok, I was switching it under the ios tab. My mistake. However, switching to metal under the macos tab still results in a crash under both macos and ios.

    The Compute Skinning is suddenly working again. No idea.

    I'll report a bug on the game window thing.

    EDIT: Bug case number 1298637.
     
    Last edited: Dec 11, 2020
  21. kubimtk

    kubimtk

    Joined:
    Jan 11, 2018
    Posts:
    2
    I deleted the whole asset folder and still got the same error. Then I started to delete files in other directories and identified ProjectSettings/ProjectSettings.asset as cause of the hangining:

    I identified ...
    metalEditorSupport=0
    ... as the cause of the problem.
    Y
    ou should be able to reproduce the error by setting it to 0 in any of your projects.
     
    Last edited: Dec 11, 2020
    JohnnyFactor likes this.
  22. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    This also solved my problem of the editor not saving the metal status on exit.

    It seems the -force-metal flag is not writing back to the ProjectSettings.asset file.
     
  23. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    -force-metal doesn't save those settings by design.
     
  24. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    Ok, but you made it sound like it does:

    When not using -force-metal, the editor won't open at all but when using -force-metal, both of those conditions are true so this seems like a loophole that should be patched.
     
  25. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Oh snap, that indeed looks like a UI bug. I didn't realize it would behave like this, sorry.
     
  26. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I have HDRP/VFX Graph/my fluid sim project that was running well on 2020.2 betas with macos 11 on M1 in the past, but since updating to macOS 11.1 the scene flickers a lot and I've already had at least one crash where the machine ended up rebooting.

    I will start to recreate the project from scratch to see if I can establish what is triggering the issue but I thought I would mention it at this early stage of my investigation anyway. I think it happens regardless of whether I use 2020.2 beta 14 or the first release version of 2020.2.
     
  27. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Please ignore my previous message for now, it looks like a timing coincidence and it was actually something in one of my VFX Graphs that was messing up. I'll report it in the appropriate place if I think there is a Unity bug behind the issue, but right now I have nothing to indicate that its M1-specific.
     
  28. vicky6v

    vicky6v

    Joined:
    Aug 7, 2018
    Posts:
    4
    I am Unable to launch unity 5.6.x. in MacOS big sur. editor won't show up.
    attaching the log file.
    unity 2020 works fine through.
    this seems to be the issue
    "Launching external process: /Applications/Unity/Hub/Editor/5.6.3f1/Unity.app/Contents/Tools/UnityShaderCompiler
    Failed to get socket connection from UnityShaderCompiler shader compiler! /Applications/Unity/Hub/Editor/5.6.3f1/Unity.app/Contents/Tools/UnityShaderCompiler"

    any idea ?
     

    Attached Files:

  29. vicky6v

    vicky6v

    Joined:
    Aug 7, 2018
    Posts:
    4
    I tried launching the editor using "-force-metal". editor does open but it looks weird like below( image attached)
     

    Attached Files:

  30. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Unity 5.6 won't work on macOS Catalina or newer macOS versions (like Big Sur) because it has 32-bit components. See this thread: https://forum.unity.com/threads/installing-unity-on-macos-catalina.689089/
     
    vicky6v likes this.
  31. vicky6v

    vicky6v

    Joined:
    Aug 7, 2018
    Posts:
    4
  32. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    So looks like the original issue was fixed in macOS 11.1 for the new Apple M1 Macs but not the DTKs. I am now working of rolling up yet another workaround which should fix the editor hanging the DTK. Hoping to get patches for it releases right after the new year.
     
  33. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    658
    Did you find a resolution to this issue?
     
    ChaosHelme likes this.
  34. SamFZGames

    SamFZGames

    Joined:
    Mar 2, 2014
    Posts:
    52
    Seems to me like this is going better than expected, so far. I'm fond of Macs and I'd been dreading this transition for the potential lack of compatibility, but if it's running this well already then that's pretty great. Seem to be very few known issues all things considered.

    It's a pity that console manufacturers don't make Mac versions of their tools, as even with Rosetta 2, Apple Silicon loses the ability to run x86 Windows in a Virtual Machine. Presently I'm halfway through a transition towards Windows (I got a monitor, speakers, keyboard etc. for my Windows laptop) which was sort of pre-emptive of the ARM transition being a problem (alongside the fact that I need it for console builds)... but looking at how it's going so far I'm tempted to just revert to using my Mac for all but console porting, as this looks really positive for the future. Seems like a bad time to be building a big x86-based PC with a tonne of fans in it and whatnot.
     
    Last edited: Jan 2, 2021
  35. JohnnyFactor

    JohnnyFactor

    Joined:
    May 18, 2018
    Posts:
    343
    I have a mac mini as the main dev machine but I keep a Windows pc for things that are not mac friendly, like Maya and xNormal and World Machine. Here's hoping Microsoft moves quick on getting Windows native.
     
  36. SamFZGames

    SamFZGames

    Joined:
    Mar 2, 2014
    Posts:
    52
    Yeah, previously I was using an iMac as my main machine (Fusion Drive, so it was getting slow, but I didn't want to upgrade right before the new chips came out) and a Windows laptop for Win-only stuff like console porting etc., but I spend a lot of time doing the console porting part and was worried about my posture so I got a monitor and other peripherals for the laptop, and I have been using that as my main. My intent was to eventually build a PC to plug into that monitor and switch the Mac out for a Macbook or a Mini which would just be used for Apple specific stuff. But the way these chips have been going, I'm not 100% on that, as so far the transition sounds like it's been nowhere near as awkward as I thought it would.

    I just use a Mac because I like them, I find them really pleasant and the OS rocks, while the PC makes more sense for work, and I already was making a few concessions to be on Mac, I figured that using emulation for my main work load seemed like a really dumb idea, but, yeah, I've been impressed by what I've heard so far. I'm going to watch how this all goes before I make my mind up.
     
  37. AnonnyMoose

    AnonnyMoose

    Joined:
    Nov 28, 2014
    Posts:
    30
    I've been using an M1 Mac mini for a few weeks now, mostly in 2019LTS but also 2020 and have had zero issues with Unity (or Visual Studio for Mac) so far.

    All the problems I have encountered are all BigSur bugs - man, that thing is really the worst OSx version I think I have ever used. Bluetooth drop outs (headphones and mouse), wired mouse issues, Dock unresponsive/not appearing/not magnifying and one instance where the Unity editor simply disappeared - you could see it in the task switcher but it was not on any visible desktop (I run in dual monitor with no virtual desktops) and could not be brought back to life. Had to to force the OS to mirror both monitors to make it appear again. I really think that was a coincidence that it was Unity, could have been any app.

    If you are not on an M1 Mac, I would say hold off on Big Sur. I know I have refused to update my old MBP so far.
     
  38. SamFZGames

    SamFZGames

    Joined:
    Mar 2, 2014
    Posts:
    52
    Huh. Noted! Thank you. I'm currently working mostly on Windows but my Mac hasn't yet been updated to Big Sur. I'll hold off a bit longer before updating that.
     
    AnonnyMoose likes this.
  39. kylekaturn

    kylekaturn

    Joined:
    Feb 24, 2013
    Posts:
    20
    I'm having same problem.
    Did you find any solutions?
     
  40. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Sorry it took so long. It should be fixed on 2021.1.0b2, 2020.2.2f1 and 2019.4.18f1 for the DTK on macOS 11.1 or newer.
     
    thestringer likes this.
  41. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Can anyone report a bug on this? We haven't seen it internally.
     
  42. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    950
    Any time the material editor is open (including when a mesh is selected) the scene and/or game views start flickering. This is in 2019.4 LTS.

    Will the native version ever be backported? It's so horribly slow in Rosetta and I can't update due to asset support.
     
  43. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Still TBD, depending on how alpha/beta testing goes and how long it takes us to iron out issues with it.

    That said, the flickering issues are unlikely to be caused by Rosetta. Can you report a bug on them?
     
  44. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    950
    I'll see if I can reproduce this in a new project. It's indeed not caused by Rosetta and also present in 2020.2.

    EDIT:
    Can't reproduce
     
    Last edited: Jan 11, 2021
  45. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Hey, we discovered that none of these issues occur when running on retail hardware (the Apple M1 devices). We believe these issues have to do with the 16 KB page limitation that the devkit had but that was lifted for retail devices when emulating x64 software.

    How important is it for you that Unity 2018.4 editor is usable on this devkit? Would using a newer Unity version work if you want to use the devkit for development? Or perhaps you could run Unity 2018.4 on a non-devkit Windows/Mac machine, build a player there and copy it over to the devkit just for testing the player?
     
  46. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    275
    Are you planning on doing a public alpha?
     
  47. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Of course!
     
    adslitw likes this.
  48. madeofdinosaurs

    madeofdinosaurs

    Joined:
    Dec 1, 2015
    Posts:
    5
    Sorry, no luck from me yet, it's on my 'nice to have' rather than 'must have' list. I'll post again if I do figure it out.
     
  49. antonkudin

    antonkudin

    Joined:
    Aug 4, 2014
    Posts:
    32
    I'm getting weird audio stutters when unity starts compiling.

    Like a half a second short audio skip/stutter, like old cd players used to do. I'm on 2020 mac mini, macOS 11.2 public beta (was the same on 11.1), using headphone out, but tried external USB speakers and its the same.

    Anyone else having this issue?
     
  50. sameng

    sameng

    Joined:
    Oct 1, 2014
    Posts:
    184
    I have this issue. This happens frequently on my M1.

    This also happens on intel macs.
    I did switch to a bluetooth headphone recently, and maybe the issue has been suppressed because I haven't noticed it much anymore.
     
    antonkudin likes this.