A sparse texture can reserve a larger grid than the set of tiles currently backed by physical memory.
Gear / The story

AMDGPU patches target a Radeon stutter that starts before a frame is drawn

A Linux driver proposal would let games group texture-mapping changes and keep unrelated graphics work moving. The submission includes no game benchmarks.

GeekRadar3 min read

A Radeon GPU can have everything it needs to draw the next frame and still be told to wait. That’s the hitch Natalie Vock, a developer working on Linux graphics for Valve, is trying to remove. The ten patches she submitted on November 17 target some Windows games running through Proton on Linux. They address what happens when a game changes which pieces of a large texture have physical memory behind them.

This is a proposed change to AMDGPU, the Linux kernel driver. The submission gives a concrete reason for uneven frame delivery, but contains no game benchmarks or release date. A Proton update alone would not put the proposal into players’ hands.

What a texture has to do with a late frame

Imagine a game with a detailed terrain texture. It can reserve addresses for the whole texture while assigning actual memory to individual tiles. The game can change those assignments as it runs. The Vulkan guide to sparse resources describes the mechanism: a texture or buffer can keep its identity while the physical pages backing parts of it change. A mapping update changes that association. It needn’t mean copying the whole texture, or even drawing anything.

Now consider two jobs submitted close together. One updates the mapping for a tile the game will use later. Another draws a frame using tiles that are already available. If the frame needs the new tile, the order matters: drawing must wait until the mapping is ready. If it uses other tiles, the two jobs may be able to overlap. Vock’s account says the current driver synchronises certain sparse mapping changes with unrelated submissions too. With enough changes in flight, a perfectly ready frame can sit behind memory work it never needed.

That distinction gets lost in an average frame rate. A brief pause as the camera turns is visible even if the following frames arrive quickly enough to leave the average looking respectable.

Top: three changes enter the kernel separately. Bottom: the same three changes arrive in one request and can be validated together.
Top: three changes enter the kernel separately. Bottom: the same three changes arrive in one request and can be validated together.

Two ways to shorten the wait

The proposed interface gives the software submitting work a way to identify which operations depend on others. That would let the graphics queue keep moving where it is safe to do so. The second change is on the CPU side. At present each mapping update takes a separate call into the kernel. With the new interface, the driver could receive a group of changes, validate the group and apply it together. Reducing the number of calls and removing an unnecessary wait solve different parts of the same hitch.

Coverage of the proposal by Forge PC identifies another step between the submitted code and a playable result: the user-space driver has to use the new interface. Our guide to Radeon and GeForce drivers on Linux explains why the kernel, graphics driver and game compatibility layer can move on different schedules.

The telling measurement, once that software exists in a testable combination, would be the length of the slow frames in a scene that repeatedly changes texture mappings. Shorten those frames and a camera turn can feel smoother even if the fastest frame the card can draw stays exactly as fast as before.