signalapp / Signal-Desktop

A private messenger for Windows, macOS, and Linux.
https://signal.org/download
GNU Affero General Public License v3.0
14.55k stars 2.64k forks source link

macOS build requires discrete GPU and shouldn't #2455

Open chelgrian opened 6 years ago

chelgrian commented 6 years ago

Bug description

Using Signal 1.12.0 under macOS 10.13.5 the discrete GPU, as shown by gfxCardStatus, activates. gfxcardstatus shows signal as the dependency causing the activation. Previous version of signal did not cause this. Signal 1.12.0 uses a new version of the electron wrapper I hypothesise that the discrete GPU activation is a side effect of this.

Steps to reproduce

  1. Start signal
  2. Note either using gfxCardStatus or system logs that discrete graphics has activated

Platform info

Signal version: 1.120 Operating System: macOS 10.13.5

scottnonnenberg-signal commented 6 years ago

What does gfxcardstatus show when you run the Chrome browser?

chelgrian commented 6 years ago

On 13/06/2018 16:04, Scott Nonnenberg wrote:

What does gfxcardstatus show when you run the Chrome browser?

I'm afraid I don't have Chrome installed. However Skype also causes this behaviour which is also an electron wrapped WebRTC thing.

Another way you can notice this is by running the Activity Monitor going to the 'Energy' tab and noting if Signal says yes to 'Requires High Perf GPU'.

Now the really weird thing is if the machine is running on the integrated GPU and I start signal then the answer to the above question is 'Yes'. If the machine happens to be running on the discrete GPU when I start signal (for example I've got a external monitor plugged in) then it shows as 'No' in the activity monitor.

However if I unplug the external monitor so the machine switches back to the integrated GPU (because it doesn't have a dependency to stop it) signals's client area goes white and it fails to respond presumably because the rendering surface has gone away due to the discrete GPU powering down.

This all points to electon not doing things correctly somehow.

I think this behaviour is correlated with some macOS window server crashes I've seen as well, which is possibly expected if a application is not handling the switch between integrated and discrete GPU correctly and then trying to do calls with stale data.

-p

scottnonnenberg-signal commented 6 years ago

Interesting. I'm on a very recent MacBook pro 15", OSX v10.13.5 (17F77). When I look at the Energy tab in Application Monitor, Signal shows as 'No' in the 'Requires High Perf GPU' column. What do you see when you look there?

DeathTickle commented 6 years ago

I have this same problem on macOS Sierra 10.12.6 with Signal v1.12.1. When launching Signal, in the Energy tab in Application Monitor the Graphics Card settings goes from Integrated to High Perf.

This used to not be the case. When using Chrome or Atom (which is also an Electron app), I don't have this issue.

scottnonnenberg-signal commented 6 years ago

Huh. I just did a full test, and I'm not seeing the described behavior. I unplugged my external monitor and my power cable, and shut down all of my Signal Desktop instances. Sure enough, Activity Monitor said 'Graphics Card: Integrated.' Then I started Signal Beta v1.13.0-beta.1 and it didn't change to 'Graphics Card: High Perf.' When I plugged in my external monitor, it did switch over.

I suppose it could be a macOS 10.13 vs macOS 10.12 thing.

chelgrian commented 6 years ago

On 18/06/2018 19:31, Scott Nonnenberg wrote:

Huh. I just did a full test, and I'm not seeing the described behavior. I unplugged my external monitor and my power cable, and shut down all of my Signal Desktop instances. Sure enough, Activity Monitor said 'Graphics Card: Integrated.' Then I started Signal Beta v1.13.0-beta.1 and it didn't change to 'Graphics Card: High Perf.' When I plugged in my external monitor, it did switch over.

I suppose it could be a macOS 10.13 vs macOS 10.12 thing.

No because I'm on 10.13. It's far more likely that it's due to the graphics driver and hardware in use as you are on a far newer machine. I'd be interested in what hardware the person who is seeing it on 10.12 is using.

-p

DeathTickle commented 6 years ago

I am using a MacBook Pro (15-inch, Early 2011) with AMD Radeon HD 6490M 256 MB and Intel HD Graphics 3000 512 MB. I am not using an external monitor.

But as I said, other Electron apps don't trigger this.

DeathTickle commented 6 years ago

Looks like this is an Electron problem from the change of version 1.8 to 2.0.

I am able to reproduce the issue using the electron-quick-start project. On a version of the project using Electron 1.8 I do not see the app requiring High Perf GPU and on a version using Electron 2.0 the app requires High Perf GPU.

I will try to find a similar bug report on the Electron project or post one.

chelgrian commented 6 years ago

On 18/06/2018 21:47, Léopold Delouche wrote:

I am using a MacBook Pro (15-inch, Early 2011) with AMD Radeon HD 6490M 256 MB and Intel HD Graphics 3000 512 MB. I am not using an external monitor.

I'm on late 2011 MBP so similar to your hardware.

But as I said, other Electron apps don't trigger this.

Could you try Skype as that is Electron and also triggers it for me.

-p

edmechem commented 5 years ago

I'm seeing the same issue. I have an early-2011 17" MacBook Pro running Sierra 10.12.6, whose lifespan I'm extending as far as possible, by using gfxCardStatus (Steve Chow's fork) to run on Integrated graphics as much as possible. For 'Requires High Perf GPU', Activity Monitor shows Signal 1.17.3 as a 'Yes'.

It seems that this behavior is caused by Electron 2, so it's not directly in the hands of Signal's devs. But it has a serious consequences for those of us trying to preserve the life of our older but still extremely serviceable MBPs that are afflicted with this hardware weakness (discrete graphics cards prone to dying, killing the entire machine). So, I hope whatever influence Signal has can be brought to bear to help get it fixed.

mycroftcanner commented 3 years ago

I am seeing the same issue and I just switched to Telegram because if I run Signal my MBP late 2012 sounds like an airplaine

mycroftcanner commented 3 years ago
image
chelgrian commented 3 years ago

On 09/11/2020 13:52, Mycroft Canner wrote:

I am seeing the same issue and I just switched to Telegram because if I run Signal my MBP late 2012 sounds like an airplaine

My version of this issue has been fixed for a very long time however I'm now on modern 16" Mac Book pro. It's possible it's still a problem on older graphics stacks.

rafidka commented 3 years ago

I am experiencing the same issue. I am on:

Signal v1.40.1 macOS Catalina v10.15.7 MacBook Pro (16-inch, 2019)

Unundra commented 3 years ago

I have the same issue.

Signal v1.40.1 macOS High Sierra 10.13.6 MacBookPro8,3 (17-inch, Early 2011)

Sometimes I run this on terminal as a workaround: /Applications/Signal.app/Contents/MacOS/Signal --disable-gpu

scottnonnenberg-signal commented 3 years ago

For reference:

nowakommunikation commented 2 years ago

I can confirm this. The issue still exists in Signal's Desktop version for Mac 5.26.1 running MacOS 10.13.6 (High Sierra) on a 2010 MacBook Pro 15". In dynamic switching mode the discrete card is activated as soon as Signal starts and the program shows up in Activity Monitor as requiring high performance GPU.