Skip to content

GPU process on Wayland lacks --ozone-platform and DrmSyncobj flags (5x CPU overhead) #50455

Closed as not planned

Description

@linuxnow

Preflight Checklist

Electron Version

41.0.3

What operating system are you using?

Linux

Operating System Version

Fedora 43, GNOME/Mutter, Wayland, Intel integrated GPU

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

The GPU process should receive the same Wayland/GPU acceleration flags as standalone Chromium 146, enabling zero-copy buffer sharing and hardware-accelerated compositing via DRM render nodes.

Actual Behavior

The GPU process spawns as a zygote child (`--type=zygote --no-sandbox`) without any Wayland or GPU acceleration flags. This produces the error on every launch:

```
'--ozone-platform=wayland' is not compatible with Vulkan.
Consider switching to '--ozone-platform=x11' or disabling Vulkan
```

The GPU compositor falls back to a software/GL path, compositing on the CPU before submitting to the GPU.

Profiling data (8h overnight, identical content)

We built a digital signage player that runs on both Electron and standalone Chromium. Same PWA, same layouts, same machine. Here's the comparison:

CPU usage by process type:

Process Electron 41 Chromium 146 Ratio
GPU 22% 1.3% 17x
Renderer 17.5% 1.9% 9x
Main 8.5% 1.2% 7x
Total 48.5% 5.5% 9x

GPU memory (PSS, proportional):

Electron 41 Chromium 146
GPU process PSS 524 → 950 MB (growing) 83 → 85 MB (stable)
DRM render engine time 2,590s 320s

GPU process flags comparison:

Chromium 146 GPU process (working efficiently):
```
--type=gpu-process
--ozone-platform=wayland
--render-node-override=/dev/dri/renderD128
--enable-features=WaylandLinuxDrmSyncobj,AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL
```

Electron 41 GPU process (software fallback):
```
--type=zygote --no-sandbox
(no ozone, no render-node, no features)
```

The acceleration features ARE present in Electron's network/utility child processes but are NOT propagated to the zygote-spawned GPU child.

GPU memory leak

The GPU PSS grows from 524 MB to 950+ MB over 8 hours (texture accumulation from the software compositing path). Standalone Chromium's GPU stays flat at ~85 MB.

Related issues

This appears related to #36633 (Zero GPU Acceleration on Wayland, open since Electron 22). That issue has 38 comments and was last active in 2023.

Additional context

  • Both Electron 40 (Chrome 144) and Electron 41 (Chrome 146) exhibit the same behavior
  • Standalone Chromium 146.0.7680.80 on the same machine has zero GPU issues
  • The fix landed in Chromium between 144-146 via `WaylandLinuxDrmSyncobj`, but Electron's zygote-based GPU spawning doesn't inherit these flags
  • Intel integrated GPU with DRM render node at `/dev/dri/renderD128`

Possible workaround

Would passing `--in-process-gpu` merge the GPU compositor into the main process (which does have the correct features)? We haven't tested this yet.

Activity

  1. linuxnow commented on Mar 24, 2026

    @linuxnow
    Author

    Update: --in-process-gpu does NOT work as a workaround

    Tested app.commandLine.appendSwitch('in-process-gpu') with Electron 41.0.3 on Wayland/Intel. Result:

    ERROR:ui/ozone/common/native_pixmap_egl_binding.cc:75] Unable to initialize binding from pixmap
    ERROR:gpu/command_buffer/service/shared_image/ozone_image_backing.cc:315] OzoneImageBacking::ProduceSkiaGanesh failed to create GL representation
    ERROR:gpu/command_buffer/service/raster_decoder.cc:1120] RasterDecoderImpl: Context lost during MakeCurrent
    

    The Wayland ozone platform's EGL binding can't share pixmaps within a single process. The GPU context is immediately lost and the renderer gets no frames.

    The separate GPU process works (via software compositing fallback) but is 5x less efficient than standalone Chromium's properly-flagged GPU process. The fix needs to happen in Electron's GPU process spawning to propagate --ozone-platform=wayland and --render-node-override to the zygote child.

  2. linuxnow commented on Mar 24, 2026

    @linuxnow
    Author

    Fix found: --no-zygote resolves the GPU flag propagation issue

    Adding app.commandLine.appendSwitch('no-zygote') before app.whenReady() fixes the problem completely.

    Why it works: The zygote process pool forks children from a pre-existing process that was created before ozone-platform and GPU flags were applied. --no-zygote forces each child process to be spawned fresh via posix_spawn with the full command line, including --ozone-platform=wayland, --render-node-override, and WaylandLinuxDrmSyncobj.

    Results (Electron 41.0.3, Chrome 146, Wayland/Intel):

    Metric Before (zygote) After (--no-zygote)
    GPU process type --type=zygote --type=gpu-process
    GPU process flags none --ozone-platform=wayland --render-node-override=/dev/dri/renderD128 WaylandLinuxDrmSyncobj
    GPU process CPU 66% 8.4%
    GPU render throughput 40 ms/s 39.4 ms/s (same)
    GPU PSS memory 524→950 MB (leaking) 172 MB (stable)

    Trade-off: Slightly slower child process spawning (~100ms per process) since each is posix_spawn instead of fork. Irrelevant for long-running applications.

    Note: The '--ozone-platform=wayland' is not compatible with Vulkan error still appears at startup, but hardware GPU acceleration works correctly regardless.

    Suggested Electron fix: Detect Wayland sessions and either (a) disable zygote for the GPU process specifically, or (b) propagate --ozone-platform and --render-node-override to the zygote pool so forked children inherit them.

    // Workaround for electron/electron#50455
    app.commandLine.appendSwitch('no-zygote');
    app.commandLine.appendSwitch('enable-features', 'WaylandLinuxDrmSyncobj,...');
  3. spencerwalsh651-cmyk commented on Mar 24, 2026

    @spencerwalsh651-cmyk
  4. nikwen commented on Mar 24, 2026

    @nikwen
    Member

    Thanks for opening an issue!

    Please follow our full bug report template and do not skip sections in it.

    I'll close this issue, but please open a new issue that follows the template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions