From 30e07061ba12fa08589a8089baf3ab00dd2845cb Mon Sep 17 00:00:00 2001 From: borodatych Date: Tue, 17 Nov 2026 08:58:32 +0300 Subject: [PATCH] icd_shim: keep Xwayland on the payload driver Xwayland's glamor renders through zink on this shim, and the shim loads whatever ADRENOTOOLS_DRIVER_PATH points at, i.e. the container's Turnip. Importing client buffers there leaks one dma-buf fd per buffer: on an AYN Thor (Adreno 740) Xwayland went from 758 to 3199 dma-buf fds in 40 s under a CEF launcher, and Android killed the app within ~3 minutes. Turnip v26.2.0 R4 and 26.0.0 R8 both leak; the payload's own driver does not (Xwayland holds 9-18 buffers and the count stays flat). Turning adrenotools off for the whole container is not an option: guest launchers stop rendering. So only the Xwayland process skips try_adrenotools; games keep the container driver. --- icd_shim/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/icd_shim/src/lib.rs b/icd_shim/src/lib.rs index 01b4d3e..67928a3 100644 --- a/icd_shim/src/lib.rs +++ b/icd_shim/src/lib.rs @@ -563,7 +563,10 @@ fn init_once() { try_system_driver(); } if kgsl && unsafe { DRIVER.handle }.is_null() { - if std::env::var_os("GN_VKSHIM_NO_ADRENOTOOLS").is_none() { + // Xwayland's glamor (zink) stays on the payload driver: a container's + // adrenotools Turnip leaks a dma-buf fd per imported client buffer there, + // and a CEF client exhausts device memory within minutes. + if std::env::var_os("GN_VKSHIM_NO_ADRENOTOOLS").is_none() && !is_xwayland_binary() { try_adrenotools(); } // A wrapper container with no adrenotools driver is on the system