Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Unity build runs absurdly slow on MacOS, even with NOTHING in the game, not even a skybox.

Discussion in 'macOS' started by UmaroXP, Jan 9, 2021.

  1. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    I can't for the life of me figure out why I'm getting such atrociously bad performance. I'll create an empty project, remove the skybox, add nothing except for a custom FPS counter which is very lightweight and has worked fine on games I've built on PC, and when I run the game in editor I max out at 38fps. If I build the game I can almost get 60fps, but once I start adding literally anything it tanks.

    MacOS 10.14.6 (Mojave)
    2018 MacMini
    3.2Ghz 6-core CPU
    64GB Ram

    I've tried Unity versions:
    2019.1.8f1,
    2019.4.16f1,
    2020.2.1f1

    ...And the result is the same on all of them. I don't think it's a hardware problem, as I can run games built with Unity, like Hearthstone, and get 60fps no problem. Someone suggested it has something to do with "Metal" but I've tried with and without it and it doesn't make a difference.

    The profiler claims the bottleneck is Semaphore.WaitForSignal which implies it's a GPU issue but Vsync is off, I mean the project is EMPTY, and I've never had any GPU problems on this machine while running other games.

    I have recently completed a game made on Windows which never drops a frame, but if I transfer the project to MacOS and open it in Unity I can't get above 11fps. I've tried exporting said game as a MacOS build and transferring it to the Mac but it simply refuses to run, regardless of whatever "chmod" bullshit I try.

    I'm beyond frustrated with this. Does anyone have any ideas on this?

    Stephen
     
    Last edited: Jan 10, 2021
    arendhil likes this.
  2. tjmaul

    tjmaul

    Joined:
    Aug 29, 2018
    Posts:
    279
    If macOS refuses to run it because it's been downloaded from the internet, it could be the same problem I'm also facing. Seems to be a signing issue. In case you're interested in that, theres two threads about that:
    https://forum.unity.com/threads/code-signing-for-bundles-dylibs-inside-app.1034230/
    https://forum.unity.com/threads/osx-code-signing.455830/

    About the bad performance.. I've also seen that with the URP template recently, but it doesn't happen in my main project, so I'm sorry I can't help you there.
     
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,407
    Good point about the rendering pipeline, though. I'm not seeing such performance problems in my projects either, but even in an empty project, you have already chosen a pipeline... @UmaroXP which one(s) have you tried?
     
  4. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    I've only tried URP and a legacy project with LWRP which is allegedly the same thing but who really knows.

    I'll try HDRP but I was really hoping to use the Mac to develop for iOS so it may be pointless.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,359
    What's your GPU usage look like? Is anything else running on the machine that could possibly be using up the GPU resources?
     
  6. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    If I open Activity Monitor and pull up the GPU History window, when I run my empty scene (which consistently maxes out at 38fps), the GPU History window shows it's almost maxed, like more than 90%. If I run my finished game, which is actually very lightweight compared to modern titles, the GPU is completely squished at 100% and my framerate is around 11.

    With Unity closed, it hardly even registers. With it open but not running the game it sits at around 10%-ish.

    I ran a game of Hearthstone to see how it compares, and it peaked around 95%-ish with average around 80%, but it was running on max settings and getting a smooth 60fps.

    As a build, the empty scene gets up to 60fps, though inconsistent and the gpu still pushes 80%. Screenshot attached.
    Screen Shot 2021-01-11 at 6.19.36 PM.png
     
  7. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,407
    For what it's worth, I don't use URP, HDRP, or LWP. I use the standard (legacy?) rendering pipeline. And my projects seem to perform just fine. Chances are those other Mac games you reference are also using the standard pipeline. Maybe you should try that?
     
  8. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    I just opened the "Sample Scene" HDRP thing, you know that sort of half finished construction site sitting in an empty void. It ran just as terrible, maybe getting 20fps, and also Unity itself was running super slow.
     
  9. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,407
    Yes. HDRP is junk. But what about the standard pipeline?
     
  10. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    Result is the same.

    The plot thickens, however. I've made an iOS version of my game, using Unity in Windows, exported the xcode project to the mac and side-loaded it onto my iPad and it runs very consistently at 120fps. So I don't think my game is the problem.
     
  11. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    Tautvydas-Zilys do you have any insights as to why I'm getting such terrible performance on Mac? I just updated to the newest MacOS and it didn't change anything.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,359
    I've no idea. What resolution are you running at? Did you try using the profiler? Any chance your mac is overheating?
     
  13. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    Resolution is 2560 x 1440. Profiler says the bottleneck is Semaphore.waitforsignal.

    it’s not impossible that the Mac is overheating but unlikely. It’s only a couple months old and the results are the same even if I try right after booting up in the morning and it’s only 60 degrees in the room.
     
  14. jazzay22

    jazzay22

    Joined:
    Oct 17, 2017
    Posts:
    5
    I am seeing a similar issue. I have reproduced this in a very simple project with a couple dozen static Cubes.
    Unity 2020.2.2f1, MacBook Pro 2015.

    Majority of frame is spent waiting for Present.
    Looking at the Render thread it is spending most time inside Camera.ImageEffects ... PrepareRenderTarget.

    Here's screenshot of Profiler where you can see it takes 32 ms on render thread:
    upload_2021-1-25_20-13-43.png

    I have not tried older versions of Unity yet, but sounds like it happens there as well.

    My hardware spec:
    upload_2021-1-25_20-18-20.png

    Can we get this looked at asap? Happy to send over my project if that helps.
     
  15. jazzay22

    jazzay22

    Joined:
    Oct 17, 2017
    Posts:
    5
    Here I did a capture with XCode Instruments, within another test where Camera.ImageEffects takes significant amount each frame. You can see below a few frames in sequence.
    upload_2021-1-25_21-22-52.png

    @Tautvydas-Zilys let me know if there is any additional information I should grab.
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    8,359
    Can you report a bug on this? If you could work with our QA to get them to reproduce this, then we would be able to investigate what's going on here.
     
    MartinTilo likes this.
  17. UmaroXP

    UmaroXP

    Joined:
    Nov 12, 2015
    Posts:
    15
    @jazzay22 if anything good comes from that bug report could you let us know here too?
     
    arendhil likes this.
unityunity