electron: Electron apps freeze on linux 5.x kernel

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version: really not sure. It seems to affect every app using electron that I have tried so far (vscode, signal-desktop, slack, etc.)
  • Operating System:
  • linux slackware64-current, kernel 5.4.2
  • Last Known Working Electron version:
  • on linux kernel 4.x

Expected Behavior

a functional app

Actual Behavior

applications freeze in about 5-10 minutes

To Reproduce

just open them. even leave them running in the background

Additional Information

I discovered thread https://forum.manjaro.org/t/electron-apps-crashing-randomly/81717/17 which indicates that adding --disable-gpu is a workaround.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 22
  • Comments: 35 (3 by maintainers)

Most upvoted comments

I had the electron freezing issue on my laptop with intel graphics using arch linux. I could use electron apps only with the --disable-gpu flag.

Switching from the xf86-video-intel driver to the kernel’s modesetting driver solved the issue. Electron apps now run stable on my machine, even without the --disbale-gpu flag.

I have read that “xf86-video-intel’s development has stalled for a long time, and many intel developers are instead actively improving the modesetting driver”… I think ditching the xf86-video-intel driver was the right solution for me.

My harware:

  • Intel® Core™ i7-8550U CPU @ 1.80GHz (Kaby Lake R)
  • Intel UHD Graphics 620 (rev 07)

I guess a lot of people who run into this issue might be using the xf86-video-intel driver.

Disabling GPU/acceleration is obviously is not a good solution. Installing dunst as suggested workaround in many places doesn’t help.

It was working perfectly for years, and now VSCode, all browsers and everything periodically freezes. Maybe someone was able to get rid of this bug?

right. I figured there is something nuanced, otherwise this would’ve been a bigger blocker, or more quickly noticed. since it seems possibly GPU related, here’s the video info on the card in the machine I’m personally experiencing this:

00:02.0 VGA compatible controller [0300]: Intel Corporation Skylake GT2 [HD Graphics 520] [8086:1916] (rev 07) (prog-if 00 [VGA controller])
        DeviceName:  Onboard IGD   
        Subsystem: Dell Skylake GT2 [HD Graphics 520] [1028:0704]
        Flags: bus master, fast devsel, latency 0, IRQ 129
        Memory at db000000 (64-bit, non-prefetchable) [size=16M]
        Memory at 90000000 (64-bit, prefetchable) [size=256M]
        I/O ports at f000 [size=64]
        [virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
        Capabilities: <access denied>
        Kernel driver in use: i915
        Kernel modules: i915

In addition to what @vbatts described in his --disable-gpu workaround, one can also disable it this way:

  1. In VSCode: "disable-hardware-acceleration": true in Preferences: Configure Runtime Arguments
  2. In Slack: Preferences → Advanced → Disable hardware acceleration
  3. In Brave (isn’t Electron but is Chromium as well): Settings → Additional settings → System → Toggle Use hardware acceleration when available off

The issue is still present on following configuration:

  • Linux nubo 5.8.11-1-MANJARO
  • Electron 9.2.1

All electron apps freeze (Spotify, Signal, VSCode…). More often when they are in the background, but sometimes when they are in use as well.

It is not occurring with kernel v4.9

Has anyone had issues on Arch with Kernel 5.5 on this?

Yes, exactly Arch + kernel 5.5.x. Electron v8 doesn’t seem to be affected, so https://github.com/electron/electron/issues/22291 might be related one.

https://github.com/vladimiry/ElectronMail/issues/253 https://github.com/vladimiry/ElectronMail/issues/252 (Electron 7.1.10, kernel 5.5.3-arch1-1 and 5.5.2-zen2-2-zen) https://github.com/vladimiry/ElectronMail/issues/250 (Electron 7.1.10, kernel 5.5.3-arch1-1)

so that workaround is not feasible currently

Upgrading Electron v7 => v8 helped with resolving above-listed issues (252 and 250).

yes, the joplin gui is affected as well for me. Even on 5.4.20. While passing --disable-gpu helps many of the other electron apps, something in joplin swallows that flag getting passed to the electron runtime. so that workaround is not feasible currently.