Chromium and Electron applications are unusably slow

Any chromium based application, including all electron applications are unusably slow. I can alleviate the problem somewhat by turning off hardware acceleration, but not all electron apps have that options, and I cannot use webgl with hardware acceleration off.

Here is some info about my system:

uname -r
5.18.5-arch1-g14-1
inxi -CG
CPU:
  Info: 8-core model: AMD Ryzen 9 5900HS with Radeon Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 3566 min/max: 400/4680 cores: 1: 3440 2: 3516 3: 3515
    4: 3570 5: 3572 6: 3510 7: 2993 8: 3545 9: 3569 10: 3268 11: 3157 12: 3563
    13: 4351 14: 4452 15: 3487 16: 3559
Graphics:
  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] driver: nvidia
    v: 515.57
  Device-2: AMD Cezanne driver: amdgpu v: kernel
  Display: x11 server: X.Org v: 21.1.3 driver: X: loaded: amdgpu,nvidia
    unloaded: fbdev,modesetting,vesa gpu: amdgpu,nvidia,nvidia-nvswitch
    resolution: 1: 5120x2160~60Hz 2: 5120x2160~60Hz 3: 5120x2160~30Hz
    4: 2560x1440~165Hz
  OpenGL: renderer: AMD RENOIR (LLVM 14.0.6 DRM 3.46 5.18.5-arch1-g14-1)
    v: 4.6 Mesa 22.1.3
upergfxctl -g
hybrid
glxinfo | grep OpenGL
OpenGL vendor string: AMD
OpenGL renderer string: AMD RENOIR (LLVM 14.0.6, DRM 3.46, 5.18.5-arch1-g14-1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.1.3
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.1.3
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.1.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

I am running I3WM

Just out of the curiosity, is this a custom kernel?

The current kernel from the repos is linux 5.18.9.arch1-1.

1 Like

Yes, forgot to mention, I followed this article as well: https://asus-linux.org/wiki/arch-guide/
Just the “Custom kernel - drivers fixes, hardware support” section

Not sure if switching to the repo kernels would resolve your issue but personally I would try it.

sudo pacman -S linux-zen linux-zen-headers

Reboot and choose the zen kernel.

Also perhaps post a full inxi report:

inxi -Fxxxaz

and

journalctl -b -0 | eos-sendlog

and post the URL.

Hopefully this would give forum members some info to get troubleshooting going.

Yeah, that’s kinda obvious. Electron sucks.

I have a relatively powerful PC and Electron-based applications are unusably slow, too.

4 Likes

Zen does not seem to have helped.

inxi -Fxxxaz

System:
  Kernel: 5.18.9-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 12.1.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=2538f2e8-bac3-4ba8-aa8c-de55923d0c0e rw rootflags=subvol=@
    quiet loglevel=3 nowatchdog
  Desktop: i3 v: 4.20.1 info: i3bar vt: 7 dm: LightDM v: 1.30.0
    Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ROG Zephyrus G15 GA503QM_GA503QM
    v: 1.0 serial: <superuser required>
  Mobo: ASUSTeK model: GA503QM v: 1.0 serial: <superuser required>
    UEFI: American Megatrends LLC. v: GA503QM.412 date: 11/03/2021
Battery:
  ID-1: BAT0 charge: 24.5 Wh (31.3%) condition: 78.2/90.0 Wh (86.9%)
    volts: 15.9 min: 15.9 model: ASUSTeK ASUS Battery type: Li-ion serial: N/A
    status: charging
  Device-1: hidpp_battery_0 model: Logitech ERGO M575 Trackball
    serial: <filter> charge: 80% rechargeable: yes status: discharging
CPU:
  Info: model: AMD Ryzen 9 5900HS with Radeon Graphics bits: 64 type: MT MCP
    arch: Zen 3 gen: 4 built: 2021-22 process: TSMC n7 (7nm) family: 0x19 (25)
    model-id: 0x50 (80) stepping: 0 microcode: 0xA50000C
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB
    L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 3632 high: 4186 min/max: 1200/4679 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 3503 2: 3516
    3: 3524 4: 3509 5: 3490 6: 3481 7: 3494 8: 3489 9: 3493 10: 3473 11: 3677
    12: 4186 13: 3486 14: 3489 15: 4137 16: 4170 bogomips: 105400
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: mmio_stale_data status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: Retpolines, IBPB: conditional, IBRS_FW,
    STIBP: always-on, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] vendor: ASUSTeK
    driver: nvidia v: 515.57 alternate: nouveau,nvidia_drm non-free: 515.xx+
    status: current (as of 2022-06) arch: Ampere process: TSMC n7 (7nm)
    built: 2020-22 pcie: gen: 3 speed: 8 GT/s lanes: 8 link-max: gen: 4
    speed: 16 GT/s lanes: 16 ports: active: none off: DP-1,DP-2 empty: none
    bus-ID: 01:00.0 chip-ID: 10de:2520 class-ID: 0300
  Device-2: AMD Cezanne vendor: ASUSTeK driver: amdgpu v: kernel
    arch: GCN 5.1 process: TSMC n7 (7nm) built: 2018-21 pcie: gen: 3
    speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s ports:
    active: HDMI-A-1,eDP-1 empty: none bus-ID: 06:00.0 chip-ID: 1002:1638
    class-ID: 0300
  Display: x11 server: X.Org v: 21.1.3 compositor: Picom v: git-7e568
    driver: X: loaded: amdgpu,nvidia unloaded: fbdev,modesetting,vesa
    alternate: nouveau,nv gpu: amdgpu,nvidia,nvidia-nvswitch display-ID: :0
    screens: 1
  Screen-1: 0 s-res: 15360x3600 s-dpi: 96
    s-size: 4064x952mm (160.00x37.48") s-diag: 4174mm (164.33")
  Monitor-1: DP-1 mapped: DP-1-0 note: disabled pos: primary,1-3
    model: Dell U4021QW serial: <filter> built: 2021 res: 5120x2160 hz: 60
    dpi: 140 gamma: 1.2 size: 930x390mm (36.61x15.35") diag: 1008mm (39.7")
    modes: max: 2560x1080 min: 640x480
  Monitor-2: DP-2 mapped: DP-1-2 note: disabled pos: 1-2
    model: Dell U4021QW serial: <filter> built: 2021 res: 5120x2160 hz: 60
    dpi: 140 gamma: 1.2 size: 930x390mm (36.61x15.35") diag: 1008mm (39.7")
    modes: max: 2560x1080 min: 640x480
  Monitor-3: HDMI-A-1 mapped: HDMI-A-0 pos: primary,1-1 model: Dell U4021QW
    serial: <filter> built: 2021 res: 5120x2160 hz: 30 dpi: 140 gamma: 1.2
    size: 929x392mm (36.57x15.43") diag: 1008mm (39.7") modes: max: 2560x1080
    min: 720x400
  Monitor-4: eDP-1 mapped: eDP pos: 2-4 model: ChiMei InnoLux 0x152a
    built: 2020 res: 2560x1440 hz: 165 dpi: 189 gamma: 1.2
    size: 344x193mm (13.54x7.6") diag: 394mm (15.5") ratio: 16:9 modes:
    max: 2560x1440 min: 640x480
  OpenGL: renderer: AMD RENOIR (LLVM 14.0.6 DRM 3.46 5.18.9-zen1-1-zen)
    v: 4.6 Mesa 22.1.3 direct render: Yes
Audio:
  Device-1: NVIDIA GA106 High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 8
    link-max: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 01:00.1
    chip-ID: 10de:228e class-ID: 0403
  Device-2: AMD Renoir Radeon High Definition Audio driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s bus-ID: 06:00.1 chip-ID: 1002:1637 class-ID: 0403
  Device-3: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: ASUSTeK
    driver: N/A alternate: snd_pci_acp3x, snd_rn_pci_acp3x, snd_pci_acp5x,
    snd_pci_acp6x, snd_acp_pci, snd_sof_amd_renoir
    pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4 speed: 16 GT/s
    bus-ID: 06:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-4: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 06:00.6 chip-ID: 1022:15e3
    class-ID: 0403
  Sound Server-1: ALSA v: k5.18.9-zen1-1-zen running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.1 running: yes
  Sound Server-4: PipeWire v: 0.3.53 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: N/A modules: r8169 pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: d000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
  Device-2: MEDIATEK MT7921 802.11ax PCI Express Wireless Network Adapter
    vendor: AzureWave driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s
    lanes: 1 bus-ID: 04:00.0 chip-ID: 14c3:7961 class-ID: 0280
  IF: wlan0 state: up mac: <filter>
  Device-3: Realtek RTL8153 Gigabit Ethernet Adapter type: USB
    driver: r8152 bus-ID: 3-1.1.2:8 chip-ID: 0bda:8153 class-ID: 0000
    serial: <filter>
  IF: enp6s0f4u1u1u2 state: down mac: <filter>
  Device-4: Realtek RTL8153 Gigabit Ethernet Adapter type: USB
    driver: r8152 bus-ID: 3-2.1.2:10 chip-ID: 0bda:8153 class-ID: 0000
    serial: <filter>
  IF: enp6s0f4u2u1u2 state: down mac: <filter>
  IF-ID-1: cni0 state: up speed: 10000 Mbps duplex: unknown mac: <filter>
  IF-ID-2: docker0 state: up speed: 10000 Mbps duplex: unknown
    mac: <filter>
  IF-ID-3: flannel.1 state: unknown speed: N/A duplex: N/A mac: <filter>
  IF-ID-4: veth0cd5760 state: up speed: 10000 Mbps duplex: full
    mac: <filter>
  IF-ID-5: vethe6b5d707 state: up speed: 10000 Mbps duplex: full
    mac: <filter>
Bluetooth:
  Device-1: IMC Networks Wireless_Device type: USB driver: btusb v: 0.8
    bus-ID: 1-4:5 chip-ID: 13d3:3563 class-ID: e001 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 2 state: up address: see --recommends
Drives:
  Local Storage: total: 1.82 TiB used: 395.37 GiB (21.2%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: A-Data model: SWORDFISH
    size: 1.82 TiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s
    lanes: 4 type: SSD serial: <filter> rev: VC0S0302 temp: 64.8 C
    scheme: GPT
Partition:
  ID-1: / raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
    used: 395.37 GiB (21.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 512 MiB size: 511 MiB (99.80%)
    used: 576 KiB (0.1%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
    used: 395.37 GiB (21.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 1.82 TiB size: 1.82 TiB (100.00%)
    used: 395.37 GiB (21.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 63.0 C
  Fan Speeds (RPM): cpu: 4400
Info:
  Processes: 379 Uptime: 8m wakeups: 5 Memory: 38.59 GiB
  used: 7.02 GiB (18.2%) Init: systemd v: 251 default: graphical
  tool: systemctl Compilers: gcc: 12.1.0 Packages: pacman: 1185 lib: 268
  Shell: Bash v: 5.1.16 running-in: xfce4-terminal inxi: 3.3.19
journalctl -b -0 | eos-sendlog

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  417k  100    24  100  417k     32   571k --:--:-- --:--:-- --:--:--  570k
https://clbin.com/tKOGP
1 Like

Are you using integrated graphics?

If so a lot of forum answers for similar issues say Are you using integrated graphics? If so, starting electron apps with --disable-gpu might work.

This is the laptop I have: https://rog.asus.com/laptops/rog-zephyrus/2021-rog-zephyrus-g15-series/helpdesk

I am running three external displays, two out of the USB-C ports and one from the HDMI port. The HDMI port is connected to the integrated graphics and the USB-C ports are connected to the discrete graphics. So both gpus are running. Is there a way to force applications globally to use the discrete GPU?

Predictable. You can’t fix bad program design by installing a different kernel.

When it comes to Electron, the only thing that really helps is not to use these rubbish programs. Or, if you absolutely need them, endure the painful slowness. But in my experience, there are very few programs one absolutely needs, and none of them are Electron-based.

Yeah I don’t think there is any way to force the gpu to be the discrete one.

There is a bug that has been open for four years on the electron github page that basically is what you are probably experiencing (https://github.com/electron/electron/issues/9842)

Everyone there basically says what everyone here is saying, which is that it is impossible to fix this issue and the developers won’t fix it either. The electron apps will “choose” what GPU to use based on the chromium engine they are using. It sounds like it “chooses” wrong.

This one guy says he has a discrete and dedicated gpu and his fix was removing a variable that he had set for another issue: https://github.com/electron/electron/issues/9842#issuecomment-1120948216

On this github issue it looks like they still generate the gpu thread which means that you are still going to eat lots of battery if you ever go off power and wanted to even use the more efficient gpu… (https://github.com/electron/electron/issues/17180)

The generic way for Nvidia is

prime-run /usr/bin/application