Skip to content

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

Closed

Description

@linuxnow

Preflight Checklist

Electron Version

41.0.3

What operating system(s) are you using?

Other 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

Does the issue also appear in Chromium / Google Chrome?

No

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.

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.

Testcase Gist URL

This issue cannot be reproduced in Electron Fiddle — it is a process-level GPU spawning issue visible only via /proc/<pid>/cmdline and GPU profiling. See profiling data below.

Additional Information

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 is 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 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.

Environment details

  • 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 does not 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 have not tested this yet.

Activity

  1. linuxnow commented on Mar 24, 2026

    @linuxnow
    Author

    This is a resubmission of #50455 using the full bug report template as requested.

    The previous issue was closed for not following the template, but the content and findings are the same — Electron's GPU process on Wayland lacks the --ozone-platform and DrmSyncobj flags that standalone Chromium 146 correctly propagates, causing a 5-17x CPU overhead and a GPU memory leak.

  2. 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.

  3. 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#50462
    app.commandLine.appendSwitch('no-zygote');
    app.commandLine.appendSwitch('enable-features', 'WaylandLinuxDrmSyncobj,...');
  4. moved this to 👀 Unsorted Items in 41-x-yon Mar 24, 2026
  5. nikwen commented on Mar 24, 2026

    @nikwen
    Member

    Thanks for filling out the template!

    Could you please share a testcase gist made with Electron Fiddle that reproduces the issue? I'm pretty sure you can run the same analysis started on an app launched from Fiddle. This makes sure we're talking about the same code and an official build of Electron (not a third-party build of a Linux distribution).

  6. added
    blocked/need-repro
    on Mar 24, 2026
  7. electron-issue-triage commented on Mar 24, 2026

    @electron-issue-triage

    Hello @linuxnow. Thanks for reporting this and helping to make Electron better!

    Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

    Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

    Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

  8. linuxnow commented on Mar 25, 2026

    @linuxnow
    Author

    Testcase

    Electron Fiddle gist: https://gist.github.com/linuxnow/38ffc689e61b7aa6efd8cfdc99c6878f

    How to reproduce:

    1. Open on a Linux Wayland session (GNOME/Mutter on Fedora 43, or any Wayland compositor)
    2. Run the Fiddle — it inspects /proc/<pid>/cmdline for all Electron child processes
    3. Observe the output:

    Expected (what Chromium 146 does):

    type=gpu-process | ozone=ozone-platform=wayland | drmsyncobj=WaylandLinuxDrmSyncobj | render-node=render-node-override=/dev/dri/renderD128
    

    Actual (Electron 41):

    type=zygote | ozone=MISSING | drmsyncobj=MISSING | render-node=MISSING
    

    The Fiddle also shows app.getGPUFeatureStatus() to confirm GPU acceleration state.

    Root cause: The zygote process pool forks children from a pre-existing process created before ozone-platform and GPU flags were applied. The GPU process inherits the bare zygote environment instead of receiving the full Wayland GPU flags.

    Workaround: app.commandLine.appendSwitch('no-zygote') forces posix_spawn with the full command line (see benchmarks in earlier comments).

    Note: This is a process-spawning issue, not an app-level bug — the Fiddle demonstrates it by reading /proc to show the missing flags. The visual effect is 5-17x higher CPU usage from software compositing fallback.

  9. removed
    blocked/need-repro
    on Mar 25, 2026
  10. linuxnow commented on Mar 25, 2026

    @linuxnow
    Author

    The testcase is also available as a standalone repo for easier cloning and testing:

    https://github.com/xibo-players/electron-wayland-gpu-repro

  11. 6 remaining items

  12. linuxnow commented on Mar 27, 2026

    @linuxnow
    Author

    Evidence: --no-zygote IS required for GPU hardware acceleration on Wayland

    @mitchchn I ran two instances of Electron 41.0.4 (Chrome 146.0.7680.153) simultaneously on the same machine, same PWA content, same Wayland/Mutter session (Fedora 43, Intel GPU). One with --no-zygote, one without:

    Instance 1: WITH --no-zygote (running 36h)

    Processes:
      PID 1268736: main (threads=44)
      PID 1268774: --type=gpu-process (threads=19)    ← PROPER GPU PROCESS
      PID 1268942: --type=renderer (threads=20)
    
    DRM render engine (cumulative):
      PID 1268774: 2,701s of GPU render time
    

    Instance 2: WITHOUT --no-zygote (running 5 min, same content)

    Processes:
      PID 2138992: main (threads=41)
      PID 2138995: --type=zygote (threads=1)
      PID 2138996: --type=zygote (threads=1)
      PID 2139216: --type=utility (threads=11)
    
    DRM render engine:
      NONE — zero DRM render activity
    

    Standalone Chromium 146 (running 36h, for reference)

    Processes:
      PID 1271280: --type=gpu-process --ozone-platform=wayland --render-node-override=/dev/dri/renderD128
    
    DRM render engine:
      PID 1271280: 14,652s of GPU render time
    

    Summary

    --no-zygote Without Chromium 146
    GPU process type gpu-process zygote gpu-process
    ozone-platform wayland MISSING wayland
    DRM render engine 2,701s 0s 14,652s
    Hardware acceleration YES NO YES

    Without --no-zygote:

    • No --type=gpu-process is spawned — only --type=zygote children
    • Zero DRM render engine activity — the GPU hardware is never used
    • The player works but through pure software rendering
    • app.getGPUFeatureStatus() returns "gpu_compositing": "disabled_software" for all features

    With --no-zygote:

    • A proper --type=gpu-process is spawned with --ozone-platform=wayland and WaylandLinuxDrmSyncobj
    • 2,701 seconds of DRM render engine time over 36 hours
    • Hardware GPU compositing confirmed via /proc/<pid>/fdinfo DRM engine stats

    PR #50509 fixes the cosmetic /proc/pid/cmdline display, but the underlying issue is that the zygote-forked GPU child does not receive the Wayland/DRM flags needed for hardware acceleration. --no-zygote forces posix_spawn which passes the full command line.

  13. mitchchn commented on Mar 27, 2026

    @mitchchn
    Member

    @linuxnow when I run your Fiddle, I do get GPU acceleration at a level equivalent to Chrome (with an NVIDIA 4090):

    GPU Feature Status:
    {
      "2d_canvas": "enabled",
      "direct_rendering_display_compositor": "disabled_off_ok",
      "gpu_compositing": "enabled",
      "multiple_raster_threads": "enabled_on",
      "opengl": "enabled_on",
      "rasterization": "enabled",
      "raw_draw": "disabled_off_ok",
      "skia_graphite": "disabled_off",
      "trees_in_viz": "disabled_off",
      "video_decode": "enabled",
      "video_encode": "disabled_software",
      "vulkan": "disabled_off",
      "webgl": "enabled",
      "webgpu": "enabled",
      "webgpu_on_vk_via_gl_interop": "disabled_off",
      "webnn": "disabled_off"
    }
    

    It may certainly be the case that there is a GPU failure that can be triggered with zygote forked vs. spawned processes, but inspecting /proc cannot confirm this prior to #50509.

    If you go into Fiddle settings > Execution and check "Enable advanced Electron logging" can you share the Console output when you run your Fiddle? Are there any Viz/GPU errors?

  14. linuxnow commented on Mar 27, 2026

    @linuxnow
    Author

    @mitchchn You're right — I ran a minimal test just now (same flags, no --no-zygote) and getGPUFeatureStatus() shows gpu_compositing: enabled, rasterization: enabled_force, webgl: enabled on Intel integrated GPU (Fedora 43, Wayland/Mutter).

    My earlier tests that showed disabled_software were running alongside another Electron instance, which likely caused interference. I apologize for the incorrect conclusion.

    The Vulkan warning still appears ('--ozone-platform=wayland' is not compatible with Vulkan) but GPU compositing works regardless.

    I do still see SharedImageManager::ProduceSkia: non-existent mailbox errors during layout transitions (video texture lifecycle), which accumulate and eventually trigger GPU software fallback after ~10 hours. This appears to be a Chrome 146 Wayland issue (affects both Electron and standalone Chromium identically). I'll file that separately on the Chromium tracker.

    Thanks for your patience and the PR #50509 fix for process titles.

  15. added
    has-repro-gist
    on Mar 27, 2026
  16. mitchchn commented on Mar 27, 2026

    @mitchchn
    Member

    Cheers, you definitely helped identify a bug that will make this easier to debug in the future at least. Will follow upstream. I know there's still work to be done for full Vulkan support in Wayland in Chromium.

  17. nikwen commented on Mar 27, 2026

    @nikwen
    Member

    Closing this per @mitchchn's request.

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

    41-x-ybug 🪲has-repro-gistplatform/linuxwayland

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions