[GH-ISSUE #516] desktop (KDE/Wayland): compositor VRAM exhaustion when expert-cache auto fills a 24 GB card - pin framebuffer -12, KWin graphics reset #242

Closed
opened 2026-11-04 01:41:14 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @xyzzing on GitHub (Oct 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/516

Desktop compositor crashes when the serve engine's expert cache fills VRAM (24 GB cards)

Observed on: RX 7900 XTX 24 GB, Fedora/KDE (Wayland), engine 0.1.35 + our HIP line, --expert-cache auto (the serve config we run).

Symptom: KWin (the Wayland compositor) fails repeatedly once the engine's cache fills the card:

kwin_wayland: atomic commit failed: Cannot allocate memory
kwin_wayland: Waiting for glGetGraphicsResetStatus to return GL_NO_ERROR timed out!
kernel: amdgpu 0000:03:00.0: [drm] *ERROR* Not enough memory for command submission!
kernel: [drm:amdgpu_dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -12
kernel: A graphics reset of an unknown cause occurred

plasmashell SIGABRT'd twice. rocm-smi at the time: the engine held 23.33 GiB of 24 GiB.

Cause: --expert-cache auto sizes the cache from free VRAM minus a small internal reserve (~700 MiB plus draft headroom), which leaves a desktop compositor almost nothing. A cache sized seconds before a browser/video window appears can also age into the same state — the compositor's allocations then fail with ENOMEM instead of the engine yielding.

Mitigation that fixed it for us: --vram-reserve-mib 4000 on the serve config (engine VRAM 23.3 → 21.8 GiB, zero compositor failures since; the cache loses ~1k slots ≈ a few percent of hit rate). The knob exists and works — the gap is that auto's default reserve is sized for headless/dedicated setups, and nothing warns or adapts when a desktop compositor is present.

Suggestion: one of (a) raise the effective desktop reserve under auto when a DRM render node has an active compositor (detectable via which processes hold the other KFD/DRI devices), (b) document --vram-reserve-mib as required on desktop 24 GB setups in docs/AMD_HIP.md, or (c) at minimum warn at startup when free VRAM after the cache is below a threshold. Happy to send a patch for whichever shape you prefer.

Data: full kernel/KWin log excerpts and before/after rocm-smi available on request. (Filed from the xyzzing HIP integration line; same report cross-posted to our rollout records.)

Originally created by @xyzzing on GitHub (Oct 2, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/516 ## Desktop compositor crashes when the serve engine's expert cache fills VRAM (24 GB cards) **Observed on**: RX 7900 XTX 24 GB, Fedora/KDE (Wayland), engine 0.1.35 + our HIP line, `--expert-cache auto` (the serve config we run). **Symptom**: KWin (the Wayland compositor) fails repeatedly once the engine's cache fills the card: ``` kwin_wayland: atomic commit failed: Cannot allocate memory kwin_wayland: Waiting for glGetGraphicsResetStatus to return GL_NO_ERROR timed out! kernel: amdgpu 0000:03:00.0: [drm] *ERROR* Not enough memory for command submission! kernel: [drm:amdgpu_dm_plane_helper_prepare_fb [amdgpu]] *ERROR* Failed to pin framebuffer with error -12 kernel: A graphics reset of an unknown cause occurred ``` plasmashell SIGABRT'd twice. rocm-smi at the time: the engine held **23.33 GiB of 24 GiB**. **Cause**: `--expert-cache auto` sizes the cache from free VRAM minus a small internal reserve (~700 MiB plus draft headroom), which leaves a desktop compositor almost nothing. A cache sized seconds before a browser/video window appears can also age into the same state — the compositor's allocations then fail with ENOMEM instead of the engine yielding. **Mitigation that fixed it for us**: `--vram-reserve-mib 4000` on the serve config (engine VRAM 23.3 → 21.8 GiB, zero compositor failures since; the cache loses ~1k slots ≈ a few percent of hit rate). The knob exists and works — the gap is that `auto`'s default reserve is sized for headless/dedicated setups, and nothing warns or adapts when a desktop compositor is present. **Suggestion**: one of (a) raise the effective desktop reserve under `auto` when a DRM render node has an active compositor (detectable via which processes hold the other KFD/DRI devices), (b) document `--vram-reserve-mib` as required on desktop 24 GB setups in docs/AMD_HIP.md, or (c) at minimum warn at startup when free VRAM after the cache is below a threshold. Happy to send a patch for whichever shape you prefer. Data: full kernel/KWin log excerpts and before/after rocm-smi available on request. (Filed from the xyzzing HIP integration line; same report cross-posted to our rollout records.)
Author
Owner

@XeonG commented on GitHub (Oct 2, 2026):

seems like I hit the same problem with windows on a 16gb vram aswel, this didn't seem like an issue days ago when I had last tried it.

<!-- gh-comment-id:5962455541 --> @XeonG commented on GitHub (Oct 2, 2026): seems like I hit the same problem with windows on a 16gb vram aswel, this didn't seem like an issue days ago when I had last tried it.
Author
Owner

@Niko1221 commented on GitHub (Oct 3, 2026):

Thanks, this is the same problem as #560: with the default 700 MiB reserve the expert cache fills the card, and the compositor's next allocation fails or makes amdgpu move the cache to RAM.

Fixed in 0.1.38, along the lines of your (b) and (c): setup on a Linux desktop with the AMD backend recommends --vram-reserve-mib 3072. The server prints the same tip after the start when less than 2 GB of VRAM is left. docs/AMD_HIP.md and INSTALL.md document it, including the "Failed to pin framebuffer with error -12" symptom. We kept it a recommendation rather than an automatic reserve, since detecting a compositor on the same card isn't reliable across setups.

@XeonG Windows is a different path: since 0.1.37 the engine counts the desktop's VRAM there (the WDDM budget). Could you open a new issue with your card, engine version and the strata-<model>.log lines with expert cache auto and MiB of VRAM free? Meanwhile START-HERE.bat --vram-reserve-mib 2048 should keep the desktop stable.

<!-- gh-comment-id:5964031882 --> @Niko1221 commented on GitHub (Oct 3, 2026): Thanks, this is the same problem as #560: with the default 700 MiB reserve the expert cache fills the card, and the compositor's next allocation fails or makes amdgpu move the cache to RAM. Fixed in 0.1.38, along the lines of your (b) and (c): setup on a Linux desktop with the AMD backend recommends `--vram-reserve-mib 3072`. The server prints the same tip after the start when less than 2 GB of VRAM is left. docs/AMD_HIP.md and INSTALL.md document it, including the "Failed to pin framebuffer with error -12" symptom. We kept it a recommendation rather than an automatic reserve, since detecting a compositor on the same card isn't reliable across setups. @XeonG Windows is a different path: since 0.1.37 the engine counts the desktop's VRAM there (the WDDM budget). Could you open a new issue with your card, engine version and the `strata-<model>.log` lines with `expert cache auto` and `MiB of VRAM free`? Meanwhile `START-HERE.bat --vram-reserve-mib 2048` should keep the desktop stable.
Author
Owner

@xyzzing commented on GitHub (Oct 3, 2026):

Confirming from our side (the reporter's setup twin: 7900 XTX 24 GB, KDE/Wayland): our serve config has run for a day with an explicit --vram-reserve-mib 4000 (engine VRAM 23.3 → 21.8 GiB) — zero compositor failures since, vs. repeated KWin "Cannot allocate memory" / framebuffer-pin -12 / graphics resets before. Cost: ~1k expert-cache slots, no decode change we could measure.

Happy to validate 0.1.38's fix on this box (the exact hardware, 96 GB desktop Ryzen 9 + the card) once we refresh our integration line to it — will report the compositor behavior with the reserve removed.

<!-- gh-comment-id:5964442932 --> @xyzzing commented on GitHub (Oct 3, 2026): Confirming from our side (the reporter's setup twin: 7900 XTX 24 GB, KDE/Wayland): our serve config has run for a day with an explicit `--vram-reserve-mib 4000` (engine VRAM 23.3 → 21.8 GiB) — zero compositor failures since, vs. repeated KWin "Cannot allocate memory" / framebuffer-pin -12 / graphics resets before. Cost: ~1k expert-cache slots, no decode change we could measure. Happy to validate 0.1.38's fix on this box (the exact hardware, 96 GB desktop Ryzen 9 + the card) once we refresh our integration line to it — will report the compositor behavior with the reserve removed.
Author
Owner

@xyzzing commented on GitHub (Oct 3, 2026):

Validated on this hardware (7900 XTX 24 GB, KDE/Wayland, Ryzen 9 7900X, our HIP line on the 0.1.38 engine):

  • The recommended --vram-reserve-mib 3072 (setup's DESKTOP_RESERVE_MIB) holds: engine VRAM 22.79 GiB of 24 (≈2.3 GiB free to the desktop), expert-cache auto re-sized around it, and the compositor has been clean since the restart — no "Cannot allocate memory", no pin failures, no graphics resets, through serving traffic. Decode through the serve path unchanged (56.0 tok/s on the standard smoke).
  • For calibration data: our incident ran at the old ~700 MiB default reserve (engine at 23.33 GiB, <1 GiB free → repeated KWin crashes); an interim 4000 MiB was also stable for a full day (≈2.5 GiB free). So on this box the compositor's requirement sits somewhere in (0.7, 2.3] GiB — 3072 has comfortable margin.

We're leaving the serve config on 3072 (the shipped recommendation) and will report if anything glitches at that value; bumping to 4000 remains the tested fallback.

<!-- gh-comment-id:5964623168 --> @xyzzing commented on GitHub (Oct 3, 2026): Validated on this hardware (7900 XTX 24 GB, KDE/Wayland, Ryzen 9 7900X, our HIP line on the 0.1.38 engine): - **The recommended `--vram-reserve-mib 3072` (setup's DESKTOP_RESERVE_MIB) holds**: engine VRAM 22.79 GiB of 24 (≈2.3 GiB free to the desktop), expert-cache auto re-sized around it, and the compositor has been clean since the restart — no "Cannot allocate memory", no pin failures, no graphics resets, through serving traffic. Decode through the serve path unchanged (56.0 tok/s on the standard smoke). - For calibration data: our incident ran at the old ~700 MiB default reserve (engine at 23.33 GiB, <1 GiB free → repeated KWin crashes); an interim 4000 MiB was also stable for a full day (≈2.5 GiB free). So on this box the compositor's requirement sits somewhere in (0.7, 2.3] GiB — 3072 has comfortable margin. We're leaving the serve config on 3072 (the shipped recommendation) and will report if anything glitches at that value; bumping to 4000 remains the tested fallback.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#242
No description provided.