Search Unity

MacOS not using discrete GPU no matter why I do...

Discussion in 'Editor & General Support' started by ay_ahmet, Jun 29, 2021.

  1. ay_ahmet

    ay_ahmet

    Joined:
    May 17, 2021
    Posts:
    5
    As I said in the title, my Mac is not using the discrete GPU which is causing very low fps in Play Mode. I have a 16' MacBook Pro 2019 with AMD Radeon 5500M.

    • I switched off Automatic Graphics Switching for both Battery and Power Adapter.
    • I forced Unity to use discrete GPU through Unity Preferences.
    • I tried using several Unity Editor versions (2019.4.28f1 (LTS), 2020.3.6f1(LTS), 2021.3.12f1(LTS))
    None of these helped me. If you need any other information please feel free to ask.

    PS: My main (My company forces me to) Unity Editor version is 2020.3.6f1
     
    Last edited: Jul 6, 2021
  2. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    I am facing the same problem, did you find a solution for this?
    I've tried the same as you + :
    - using gfxCardStatus to force using GPU (https://gfx.io/): Tool always reports that the Intel Iris GPU is used (the slow one)
     

    Attached Files:

    • gpu.png
      gpu.png
      File size:
      210.6 KB
      Views:
      378
  3. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Right click on unity.app and select prefer external GPU?
     
  4. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
  5. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    Where do I find that option? I see nothing in the context menu nor in the Info screen.
     

    Attached Files:

  6. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Open unity , right click the app in the dock, press reveal in finder

    Press get info


    Screenshot 2021-10-06 at 10.16.58.png
     
  7. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    Thanks, but I don't have that option. Might be that this is only available with eGPUs as described here (https://support.apple.com/en-us/HT208544). I'm not using eGPU but have a Macbook Pro Mid 2015 with "Intel Iris Pro" and "AMD Radeon R9 M370X".
     
  8. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Ah sorry I thought you had one
     
  9. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
  10. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    Opened the same project with Unity 2019.4.31 and everything works (automatic graphic switching and the performance).
    Unity 2019 shows <OpenGL4.1> in the editor header bar.
    So this seems to be an Unity 2020 issue, where Unity 2020 shows <Metal> in the editor header bar instead.
    Happens both with Unity 2020.3.19 and 2020.3.17

    Unity 2019 FPS: 500+
    Unity 2020 FPS: around 100
     
  11. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    As update, while Editor performance is noticeably better on 2021.1.26, Unity is still not using the GPU, even when GPU is specifically selected in "Preferences/Device To Use". I check the status which GPU is used with the tool "gfxCardStatus", which reliably tells me when the Mac switches to the GPU and back.

    On the screenshot, notice the Editor version and the "i" icon in the menu. "i" indicates that the integrated (slow) GPU is used (Intel Iris) while a "d" means one or more of the currently used applications is using the discrete (fast) GPU (in my case AMD Radeon R9 M370X on a Macbook Pro Mid 2015). "i" and "d" switch automatically depending what is requested by applications and/or the OS (e.g. if I connect an external monitor, "d" is shown).

    Also, in Unity 2019.4.31, as said, this switching to "d" happens correctly.
     

    Attached Files:

  12. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618
    I just noticed I'm having the same problem with a 2017 MacBook pro. I just turned off automatic graphics switching and restarted and my fps doubled...lol.
     
  13. MichaelHeiml82

    MichaelHeiml82

    Joined:
    Nov 2, 2009
    Posts:
    30
    Update, this is still an issue with 2021.1.28.

    Why does Unity keep IGNORING this issue?

    Bug is reported here: 1371020
     
    HofiOne likes this.
  14. HofiOne

    HofiOne

    Joined:
    Apr 19, 2021
    Posts:
    68
    Hi Guys,

    Please double-check and take a look at this screenshot

    Screen Shot 2022-01-11 at 23.32.39 .png
    as you can see gfxCardStatus shows the Intel Iris GPU is active that is not true unfortunately

    I'm sure Apple Activity Monitor (on the right) is much more authentic info in this case and that shows high load on the NVIDIA card, not on the Intel Iris during running my app in the editor.


    But something is definitely wrong here that is sure.

    I have a probably related, even more strange, similar issue.

    For me, the Standalone Player builds perform significantly better on the low power Intel GPU than the discrete NVIDIA if i run the app with the -force-low-power-device from the command line

    When the player uses the NVIDIA card it lags seriously in most of the cases, but not on the Intel one.


    Unity 2021.1.28f1.3303 (cannot upgrade yet because of other serious URP bug in higher versions)
    macOS 11.6.2 (20G314)
    MacBook Pro (Retina, 15-inch, Late 2013)
    Graphics Cards
    Intel Iris Pro / NVIDIA GeForce GT 750M
     
  15. HofiOne

    HofiOne

    Joined:
    Apr 19, 2021
    Posts:
    68
    One more quick contra test and its result
    Screen Shot 2022-01-12 at 00.06.46 .png
    so it seems the switching is happening

    as I can see the issue is that there is no performance difference in the Editor (I can see similar FPS values running the same project), but in a Standalone Player Build the Intel GPU performs better if I force use it via -force-low-power-device
     
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    You turned off auto graphics switching in osx preferences ?
     
  17. HofiOne

    HofiOne

    Joined:
    Apr 19, 2021
    Posts:
    68
    tried both ways, no difference, anytime
    • if I selected the Integrated Intel Iris in Unity preferences, restarted Unity then run the app in the Editor Player it was using the Intel Iris
    • if I selected the Discrete NVIDIA in Unity preferences, restarted Unity then run the app in the Editor Player it was using the NVIDIA
    as it is expected
     
  18. HofiOne

    HofiOne

    Joined:
    Apr 19, 2021
    Posts:
    68
    i'd be curious why this option is not available for a Unity built standalone player application (only command line option is supported :S)
     
  19. HofiOne

    HofiOne

    Joined:
    Apr 19, 2021
    Posts:
    68
    ok, we are getting closer i guess ;)

    please see this screenshot

    Screen Shot 2022-01-12 at 00.54.36 .png

    on the left half of the image you can see the GPU load when I run my Standalone Player app with the -force-low-power-device cmd line option AND Automatic Graphics Switching was ON in the system preferences
    the app run smoothly


    the right half shows the result when I turned OFF the Automatic Graphics Switching (the app run the same way, cmd line with the -force-low-power-device option)
    the app lag seriously


    so, it seems if the Automatic Graphics Switching is OFF probably the standalone player app either
    • tries to switch back and force between the cards, or
    • tries to use both cards at the same time somehow

    Dear Unity developers, could you check this, please?
    (maybe this is also related to the other editor player performance issues on the macs with dual GPU?!?)
     
  20. HofiOne

    HofiOne

    Joined:
    Apr 19, 2021
    Posts:
    68
    and the last test from me i guess (as based on these Unity developers can start to investigate, these results can be reproduced easily following the steps described above and here), so

    this time I examined the editor only
    I left "Device to use" in Unity Preferences on "Automatic"
    then I run the same app as above without any changes

    please see the activity monitor chart

    Screen Shot 2022-01-12 at 01.25.30 .png

    in the left half, you can see the result when the Automatic Graphics Switching was OFF in macOS System Preferences

    the right half shows the result when I switched ON the Automatic Graphics Switching

    it can be seen that similar happens that in the standalone player

    (but with the opposite result!!!)

    probably same kind of "fighting" to switch between the GPUs?!!?

    so strange

    I hope Unity can start to investigate now, fingers crossed
     
  21. zbavas

    zbavas

    Joined:
    Jul 9, 2017
    Posts:
    2
    Updating from Unity 2020.3.22f1 to Unity 2020.3.26f1 worked for me.
    Also, Unity 2020.3.24f1 Cloud Build worked, that's what lead me to upgrade to 2020.3.26 locally.

    I hope this helps.
     
  22. HofiOne

    HofiOne

    Joined:
    Apr 19, 2021
    Posts:
    68
    thanks for signaling, but for me it is not an option unfortunately, I need 2021+ now :S