Skip to content

fix(linux): reduce Skia GPU allocations with CPU rendering - #211

Open
Filip722 wants to merge 5 commits into
Lampese:mainfrom
Filip722:fix/linux-webview-vram
Open

Filip722 wants to merge 5 commits into
Lampese:mainfrom
Filip722:fix/linux-webview-vram

Conversation

@Filip722

@Filip722 Filip722 commented Oct 22, 2026 •

Copy link
Copy Markdown

Skia GPU painting retains substantial GPU-buffer allocations in the Linux dashboard. Default WEBKIT_SKIA_ENABLE_CPU_RENDERING to 1 before Tauri starts, preserving any explicit value. This moves Skia tiles and accelerated ImageBuffers such as filters to CPU painting while leaving GPU compositing and asynchronous scrolling available. Compositing and DMA-BUF rendering are not disabled.

The README documents the GPU-rendering override and hardware/version-dependent tradeoffs. It does not recommend forcing software OpenGL.

Validation

  • pnpm install --frozen-lockfile, pnpm test: 34 passed, including the ten Linux startup cases. Node 22.16.0, pnpm 9.15.9, rustc 1.85.1. The fixture compiles and executes the actual entry point with a stub library; using unchanged current-main startup code instead fails the eight cases requiring the CPU default while preserving the two explicit-override cases.
  • pnpm build: passed. git diff --check: passed. No new full native Tauri build is claimed.
  • Rendering comparison on 2026-11-15 uses the same official 0.2.22 AppImage, bundled WebKit 2.50.4, with the flag unset (A) versus 1 (B). This isolates the rendering choice in the current release; these are not measurements of a rebuilt PR binary. The startup fixture separately verifies that this PR selects B.

Three fresh launches per arm on each machine, in the fixed order A B B A A B; all twelve recorded runs retained. The table shows medians across three per-run results, with the run range in parentheses. GPU-buffer totals and PSS are MiB; CPU values are CPU-seconds over the measured scroll phase.

Hardware / mode Idle GPU-buffer totals Idle process PSS Scroll-phase CPU seconds
Intel UHD / i3-1215U, default 148.7 (148.2–150.7) 215.5 (215.1–216.1) 7.83 (7.79–7.91)
Intel UHD / i3-1215U, CPU painting 81.9 (81.9–81.9) 195.2 (195.0–213.8) 6.93 (6.91–7.06)
Radeon 760M / Ryzen 5 7640HS, default 133.8 (132.5–135.8) 342.1 (342.1–343.6) 9.20 (9.16–9.22)
Radeon 760M / Ryzen 5 7640HS, CPU painting 61.1 (61.1–61.1) 286.7 (285.8–289.3) 8.09 (7.73–8.16)

Median GPU-buffer totals fall 45% on Intel and 54% on AMD in these fixtures. Intel has 24 MiB of cross-client shared-buffer accounting in both modes; AMD reports none. PSS varies separately and is not added to GPU-buffer totals or represented as total physical-memory savings. No energy or battery-life improvement is claimed.

All twelve runs have 18 ms p99 requestAnimationFrame intervals, no interval above 50 ms, stable application/WebKit process IDs, and full-page warmup coverage. The six top-of-page PNG snapshots are byte-identical within each machine. These checks support the rendering choice in this scene; animation-callback pacing is not physical presentation timing or an input-latency measurement.

Reproduction protocol and limits
  • Official asset: Codex.Switcher_0.2.22_amd64.AppImage, SHA-256 bb37a37bd02e25e393fbfa09660d39071c0c3e449a6d38833098e6a2767cc16b, matching the GitHub release digest on both machines. Extracted and launched through its unchanged AppRun.
  • Debian 13 and Mesa 25.0.7-2+deb13u1 on both. Intel PCI 8086:46b3, i915, kernel 7.3.4-x64v3-xanmod1; AMD PCI 1002:15bf, amdgpu, kernel 7.3.3-x64v3-xanmod1. WebKit DRM engine counters advance in both rendering modes.
  • Intel: private Weston 14.0.2 headless GL display at 1024×768/60 Hz. AMD: private Xvfb 1024×768×24 display; WebKit still uses the real AMD render device. These are within-machine comparisons; absolute results from the different display paths are not pooled.
  • Identical 900×700 viewport and 24 synthetic API-key account cards, fresh HOME/XDG directories for every launch, no valid credentials, automatic account warmups disabled. Initial settling is 10 seconds, followed by an 8-second full-page scroll warmup, 10 seconds of idle samples, and a 30-second bidirectional scroll at 600 CSS pixels/second.
  • A local WebKit inspector drives the same JavaScript scroll and callback observer in every arm. Resource snapshots are sampled at 1 Hz. CPU deltas include the application and WebKit descendants and waited-for child CPU time, from just before the animation through completion of the final resource sample; sampling completion can extend slightly beyond the 30-second animation.
  • GPU-buffer totals sum drm-total-* regions once per PCI device/client ID, deduplicating repeated file descriptors. Shared buffers can still appear in multiple clients. They are driver-accounting totals, not unique physical GPU-memory ownership. Process PSS is reported separately. Desktop/test-compositor resources are excluded.
  • API-key cards do not exercise live OAuth usage charts, and isolated displays do not validate every real desktop, compositor, driver, power state, or physical input path. Existing AppImage/host GIO-module compatibility warnings occur in both arms. No recorded run crashed, was replaced, or was omitted; preparation smoke tests are separate.

@Filip722 Filip722 changed the title fix(linux): reduce idle GPU memory usage fix(linux): reduce idle VRAM while preserving smooth scrolling Oct 22, 2026
Describe CPU painting for both tiles and accelerated ImageBuffers, retain
the explicit GPU override, and remove the separate software OpenGL advice.
Use the current release's AppImage filename in the override example.

Assisted-by: OpenAI Codex
@Filip722 Filip722 changed the title fix(linux): reduce idle VRAM while preserving smooth scrolling fix(linux): reduce Skia GPU allocations with CPU rendering Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant