KDE developer fixes major Linux eGPU performance bottleneck
Linux users running games on a secondary GPU may soon see much better performance. KDE developer Xaver Hugl has detailed a new Wayland protocol designed to stop data from being copied between GPUs when it is not required.
The change is aimed at laptops with integrated and dedicated graphics, as well as systems using external GPUs. Hugl demonstrated Cyberpunk 2077 jumping from 27 FPS to 50 FPS on an AMD Radeon RX 5700 XT connected through an external GPU enclosure.
Linux was sending rendered frames on an unnecessary trip
On current multi-GPU setups, a game may render a frame on the dedicated GPU before copying it to system memory. The integrated GPU then imports and composites the frame, even when the monitor is connected directly to the dedicated GPU.
© Xaver Hugl
© Xaver Hugl The completed image may then be copied back to the dedicated GPU for display output. This consumes memory bandwidth and PCIe or USB-C bandwidth, while adding more latency to every frame. External GPU setups are hit harder because all data must pass through a single cable.
Hugl tested this using a Framework Laptop 13, an RX 5700 XT eGPU and a 5120×1440 monitor running at 120 Hz. A fullscreen vkcube test reached only 55 FPS with the existing Mesa implementation, despite the monitor supporting 120 Hz.
Linux-dmabuf v6 cuts out unnecessary copies
The new linux-dmabuf version 6 protocol allows a Wayland compositor to advertise support for multiple GPUs. Applications can also tell the compositor which GPU should import each buffer, allowing it to keep rendered frames on the dedicated GPU where possible.
With the updated protocol, vkcube reached the monitor’s full 120 FPS refresh rate. Cyberpunk 2077 also improved from 27 FPS to 50 FPS using the low graphics preset, an increase of more than 80%.
The protocol has now been merged after more than two years of development. KWin support has also been merged, while Mesa support is expected soon. NVIDIA reportedly has an implementation in development, although the required driver has not been released.
Source: Xaver’s Blog