CodySchrank / gSwitch

macOS menu bar app that allows control over the gpu on dual gpu macbooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not work on Big Sur

lbibass opened this issue · comments

commented

Basically what the title says. I'll enable the integrated GPU, it'll say it's switched, but iStatMenus says my 560 is still consuming power, and the GetGpuState in the advanced menu confirms this, as it returns 0x88, so it's powered. Any ideas?

Works fine for me on Big Sur 11.1

Here's screenshots showing it working while Firefox is running webGL and being hungry for GPU:
Screen Shot 2020-12-21 at 11 02 31 am
Screen Shot 2020-12-21 at 11 02 41 am
Screen Shot 2020-12-21 at 11 02 58 am
Screen Shot 2020-12-21 at 11 03 07 am

commented

image
That's not the case for me. Launching Hades, Subnautica: Below Zero, or Spiritfarer all enable the discreet GPU. It doesn't display it as enabled, yet it's still consuming nearly twenty watts. It doesn't work.

image

@lbibass @coagmano
What tools are you using to monitor your computer so nicely?
I am new to MacOS, coming from Linux, and I miss having a nice monitoring cockpit like you have there (in your screenshots). Could you tell me some nice monitoring tools you use - and that works well under Big Sur (Intel)?
Thank you.

@luizconrado I'm using iStat Menus, which I'm guessing lbibass is too.

@lbibass: I wonder if games are more agressive about requesting/demanding the gpu.
I watched the power consumption when testing with three.js demos and you can see a spike when it actives the gpu but is then immediately turned off.
Did this work for games before Big Sur?

I definitely don't have the required knowledge to fix this, I was just adding my own experience on Big Sur. If you can figure out how to access the logs, you can monitor if/when gSwitch tries to change GPU state from the relevant logs. ie here: https://github.com/CodySchrank/gSwitch/blob/master/gSwitch/Core/GPUManager.swift#L213-L245

commented

@lbibass

I found out the official way to change the current GPU used. i cant try it since i dont have the MBP yet. but, if it works @CodySchrank should implement this to trigger the GPU changing...

https://forums.macrumors.com/threads/good-gpu-switching-application-for-mpb-16.2220002/

Screen Shot 2021-01-10 at 3 02 57 AM

commented

@White7561 that didn't work for me. Hades still activates the discreet GPU, though GFXcardstatus and Istatmenus report the integrated graphics as the ones being used.

That's clearly not the case though, as the radeon is still pulling 20 watts.

commented

@White7561 that didn't work for me. Hades still activates the discreet GPU, though GFXcardstatus and Istatmenus report the integrated graphics as the ones being used.

That's clearly not the case though, as the radeon is still pulling 20 watts.

Huh . I wonder if it's a BigSur bug.... Since that command seems to be baked in MacOS itself. So it should work regardless..

Hi All, I have yet to upgrade to big sur, I usually wait a few versions before I take the plunge into the new OS with apple. However I will be soon and if gSwitch is really not functioning correctly I will definitely look into what is causing the issue. I have noticed that gSwitch is not as reliable in Catalina as it was Mojave/High Sierra, so I know that it is possible that something could have broke with the new macos version. There seems to be some conflicting information in this thread so I'm not sure what the current consensus is.

@White7561 I have used that command before to test gpu switching in the past. It is my understanding that I am using the same underlying functions as that program is, that being IOConnectCallScalarMethod and IOConnectCallMethod, called with different parameters. These are very low level functions that apple exposes and I can't imagine that they are changing very much with each OS update.

If anyone would like to experiment there is an advanced pane in gSwitch which exposes these functions and the meanings of all the parameters (that I have found) that could be passed in. However that is all experimental and while I doubt any damage could be done to your computer I of course must warn that it is possible.

Also, I've noticed in the past that using other gpu switching programs at the same time as gSwitch, like gfxCardStatus, can confuse the event system and cause the programs to display weird behavior, so I would recommenced not doing that to test if gSwitch is working correctly.

FWIW, I'm using gswitch only on Big Sur and it's working for me.

commented

FWIW, I'm using gswitch only on Big Sur and it's working for me.

Have you tried launching any steam games? What are you using to monitor GPU power consumption?

Gswitch works wonderfully until I launch games with steam. Then it powers up the discreet GPU while still saying the integrated GPU is the only one powered on.

Have you tried launching any steam games? What are you using to monitor GPU power consumption?

I don't run games, I use gswitch to force discrete/integrated based on power source. I use Activity Monitor's Energy tab to confirm which GPU is being used.

commented

Have you tried launching any steam games? What are you using to monitor GPU power consumption?

I don't run games, I use gswitch to force discrete/integrated based on power source. I use Activity Monitor's Energy tab to confirm which GPU is being used.

Well, that explains why we are having different results. I have a problem that results in the discreet gpu only being used when launching steam games. You aren't launching steam games. Therefore you don't have a problem.

Try launching a steam game. Then monitor what GPU is being used with the tools above.

Activity Monitor says the discreet GPU isn't being used when I launch Hades, but it's pretty clear it is being used.

image

commented

Another app that breaks the expected behavior is Parsec. Same behavior as up above.

commented

Another app to add to the list: Kicad.

commented

Another app: hyper. https://hyper.is

Certain apps can force a certain GPU to be used even when the system is set to a different one.
For example, in Vulkan, specifying

 auto properties = VkPhysicalDeviceProperties{};
 vkGetPhysicalDeviceProperties(device, &properties);
 properties.deviceType == VkPhysicalDeviceType::VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU

will force the discrete GPU regardless of system settings.
(I am not sure which Metal call this binds to. Translation is handled by MoltenVK's ICD).
This issue isn't specific to Big Sur, and no GPU switching utility solves this afaik. Forcing a particular GPU when software is hard-coded to use a different one will also likely result in crashes.

Imo this isn't a Gswitch issue; and should be addressed by the application developer that is forcing use of the dGPU. Though I wouldn't mind Gswitch having an option to force all applications onto the iGPU; I have no idea how this can be accomplished though.

@Vestaia

I'm noticing the behavior that gswitch can no longer force some apps as well. I doubt there is anything I can do about it unfortunately.

That said, GPU switching is more unreliable in Big Sur than previous OS's. I'm trying to make some changes to remedy this.

commented

@Vestaia

I'm noticing the behavior that gswitch can no longer force some apps as well. I doubt there is anything I can do about it unfortunately.

That said, GPU switching is more unreliable in Big Sur than previous OS's. I'm trying to make some changes to remedy this.

Bummer. I guess I can try and get in contact with some of the developers then? See if there's anything they can do about it? Parsec particularly is an issue imho, given that there's no reason for it to use the discreet GPU at all.

I've noticed there are some situations where pmset is able to change GPU states when gSwitch is not. An example is during sidecar screen-extension. Perhaps this could be automatically attempted after the switching mechanism on fails?
However, this obviously doesn't solve the problem of hard-coded GPU selection such as with MPV-Vulkan and Parsec-Metal.

Trying to force use of the Intel GPU since the Nvidia one has been buggy and unstable since macOS 10.13 though 11. The game OpenRA (Mono usage) triggers the dedicated GPU, as does the built in Chess app (the force worked on the Chess app but not WINE Mono). Strangely advanced settings setting the GPU state to 2 for the top filed seems to have worked for now.

I'm having a similar issue. It pseudo works for me in big sur, but I need to babysit it. I'll regularly be working for an hour and notice by battery is at 70% or whatnot, then check gSwitch only to see that it's using the dedicated gpu even though integrated only is checked. Toggling to discreet and back to integrated fixes it, but it's annoying to lose an hour of battery life because of this.