HN
Today

Linux 7.3 improves performance when running out of vRAM

A deep dive into Linux kernel graphics drivers reveals how new VRAM management patches in Linux 7.3 tackle stubborn issues like game crashes and performance dips when GPUs overcommit memory. This detailed explanation of deadlocks, ping-ponging, and eviction heuristics resonates with gamers and developers alike, offering crucial insights into previously arcane system behaviors. The community praises the author's work and clarity, highlighting the practical impact on Linux gaming performance.

65
Score
7
Comments
#1
Highest Rank
3h
on Front Page
First Seen
Aug 18, 9:00 AM
Last Seen
Aug 18, 11:00 AM
Rank Over Time
111

The Lowdown

Natalie Vock details the significant improvements to VRAM management in Linux kernel 7.3, focusing on making overcommitted VRAM scenarios more stable and performant, particularly for gaming. Her work addresses long-standing issues that caused crashes and severe performance degradation when applications requested more VRAM than physically available.

  • Addressing Instability: Previous issues caused application crashes, specifically due to unhandled EDEADLCK errors in the amdgpu driver's memory management (TTM) during VRAM overcommit.
  • Preventing Ping-Ponging: A major performance bottleneck was the "ping-ponging" of memory between VRAM and system RAM when applications or system components (like display scanout) repeatedly evicted and reloaded the same data.
  • Display Scanout Challenges: The need for physically contiguous memory for display scanout images led to disproportionately large evictions (e.g., 4GiB for a 32MiB image) due to inefficient eviction algorithms that did not consider physical contiguity.
  • Heuristic-Driven Throttling: New "hard throttle" and "soft throttle" heuristics have been introduced to manage memory eviction more intelligently, preventing aggressive ping-pong behavior and allowing the system to stabilize after an eviction event.
  • Prioritized Eviction: The kernel's LRU (Least Recently Used) list for eviction now integrates VK_EXT_pageable_device_local_memory priorities, allowing applications to hint which memory blocks are most critical, leading to more stable and predictable performance.
  • Real-World Impact: Testing with demanding games shows playable performance even with 1-2GiB of VRAM overcommitment, a stark improvement over previous instability and unplayability.
  • Upstreaming Efforts: While these improvements are already live in SteamOS, the author is actively working to upstream the patches to the mainline Linux kernel for broader availability.

These kernel-level optimizations fundamentally transform how Linux handles VRAM overcommit, moving it from a catastrophic failure point to a manageable performance challenge. By making eviction smarter and more cooperative between applications and the driver, the user experience, especially for demanding graphics workloads like gaming, is significantly enhanced.

The Gossip

Kernel Kudos & Clarification

Commenters expressed widespread appreciation for the blog post's clarity and detailed explanation of complex VRAM management. Many Linux gamers and users noted how the article demystified issues they'd previously encountered, praising the author's enthusiasm and contribution to kernel development. The thorough breakdown of technical challenges and solutions was highly valued.

Compute vs. Console Concerns

A key discussion point revolved around the applicability of these VRAM improvements to non-gaming workloads, specifically LLM inference. Commenters questioned if these kernel-level optimizations would benefit general compute tasks or if LLMs, often involving manually managed data, operate under different constraints. The specific issue of display hardware requiring physically contiguous memory, leading to disproportionate evictions, also prompted discussion, with some suggesting dedicated memory reservations for such critical components.