From 3182ba780e6221016981ecc1f38175f08a09d45c Mon Sep 17 00:00:00 2001 From: The412Banner Date: Mon, 21 Sep 2026 08:57:57 -0400 Subject: [PATCH] Session: a TU_DEBUG switch, and sysmem by default for the A710/A720/A722 driver Turnip's debug flags reach the runtime's driver and everything on it through TU_DEBUG. Downloads/steamdeck-tu-debug now sets it verbatim, like the other device switches. With nothing there, an imported driver from the A710/A720/A722 legs gets "sysmem" on its own: both the patch's author and our release notes advise it for those GPUs, and nothing else in the list needs it. --- README.md | 1 + .../launcher/session/SessionService.kt | 20 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d70c6e0835..24a3072f25 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,7 @@ Files in `/sdcard/Download`, for a device that cannot be reached with a debugger | `steamdeck-driver` | `a7xx`, `a8xx` or `system` — overrides the Turnip build the compositor loads | | `steamdeck-no-hud` | Hides the top-right performance line (fps, and `base → generated` while frame generation runs) | | `steamdeck-osc` | `always` or `never` — pins the on-screen controls instead of following what is attached | +| `steamdeck-tu-debug` | Turnip's `TU_DEBUG` for the runtime's driver, verbatim (`sysmem`, `sysmem,deck_emu`). Without it, an imported A710/A720/A722 driver gets `sysmem` on its own | Session logs land in `/sdcard/Download/SteamDeck/`, one file per session, and are the first thing to look at when something does not start. Creating `~/.steamdeck-desktop-debug` inside the diff --git a/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt b/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt index 3322fb410b..648c6ea04a 100644 --- a/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt +++ b/app/src/main/java/com/steamdeck/launcher/session/SessionService.kt @@ -1,6 +1,7 @@ package com.steamdeck.launcher.session import com.steamdeck.launcher.gpu.LinuxVulkanDriver +import com.steamdeck.launcher.gpu.LinuxVulkanDriverManager import android.app.Notification import android.app.NotificationChannel @@ -71,6 +72,15 @@ class SessionService : Service() { return START_NOT_STICKY } + private fun tuDebug(linuxDriverId: String): String? { + val override = File(Environment.getExternalStorageDirectory(), TU_DEBUG_SWITCH) + .takeIf { it.isFile }?.let { FileUtils.readString(it)?.trim() } + if (!override.isNullOrEmpty()) return override + if (linuxDriverId.isEmpty()) return null + val name = LinuxVulkanDriverManager(this).getDriverName(linuxDriverId).lowercase() + return if (name.contains("710-720") || name.contains("710_720")) "sysmem" else null + } + // ── The session ───────────────────────────────────────────────────────────────────────── private fun runSession() { @@ -114,8 +124,14 @@ class SessionService : Service() { // An imported glibc Turnip for this mode, when the user chose one: the session script checks // the manifest and its library from inside and points the loader at it with VK_DRIVER_FILES, // so the runtime's own driver above stays untouched and is what a bad import falls back to. - LinuxVulkanDriver.resolveIcdPath(this, SessionPrefs.linuxDriver(this, SessionState.mode)) + val linuxDriverId = SessionPrefs.linuxDriver(this, SessionState.mode) + LinuxVulkanDriver.resolveIcdPath(this, linuxDriverId) ?.let { guest.add(LinuxVulkanDriver.ENV + "=" + it) } + // Turnip's own debug switches, for the runtime's driver and everything on it. The file in + // Downloads holds the value verbatim ("sysmem", "sysmem,deck_emu"); with nothing there, an + // imported driver from the A710/A720/A722 legs gets "sysmem" on its own, which is what both + // its authors advise for those GPUs and what nothing else in the list needs. + tuDebug(linuxDriverId)?.let { guest.add("TU_DEBUG=$it") } val pulse = PulseAudioComponent(this) pulse.setContext(this) @@ -417,6 +433,8 @@ class SessionService : Service() { companion object { private const val TAG = "SessionService" + /** Downloads file whose contents become TU_DEBUG inside the session, e.g. "sysmem". */ + private const val TU_DEBUG_SWITCH = "Download/steamdeck-tu-debug" private const val CHANNEL_ID = "session" private const val NOTIFICATION_ID = 1001 const val ACTION_STOP = "com.steamdeck.launcher.STOP_SESSION"