From d9328c39df29f98c1859e9588aae5bed414731b7 Mon Sep 17 00:00:00 2001 From: Jordan Y <41272328+coffeemeist3r@users.noreply.github.com> Date: Thu, 22 Oct 2026 09:08:25 -0500 Subject: [PATCH] fix: Game cores also apply to games started through "Linux x86 (FEX)" (#1294) * Run FEX-tool games on the chosen game cores Performance > Game cores reached only the Proton launchers: games started through "Linux x86 (FEX)" ran on every core, including the slowest cluster. * Test that SteamVR FEX launches keep the game cores --- .../overlay/usr/local/bin/steam-compatibility | 6 ++++-- tools/tests/test_droiddeck_fex.py | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility index 04ce24149..41a37a9aa 100755 --- a/tools/linuxfs/overlay/usr/local/bin/steam-compatibility +++ b/tools/linuxfs/overlay/usr/local/bin/steam-compatibility @@ -466,10 +466,12 @@ verb=$1; shift case $verb in getcompatpath | getnativepath) printf '%s\\n' "$1"; exit 0 ;; esac +""" + BL_GAME_CPUS_SETUP + """ +bl_game_cpus if [ -x /usr/local/bin/droiddeck-steamvr-flat ] && /usr/local/bin/droiddeck-steamvr-flat "$verb"; then - exec /usr/local/bin/droiddeck-steamvr-game /usr/local/bin/droiddeck-fex steam "$verb" "$@" + exec /usr/local/bin/droiddeck-steamvr-game ${BL_TASKSET:-} /usr/local/bin/droiddeck-fex steam "$verb" "$@" fi -exec /usr/local/bin/droiddeck-fex steam "$verb" "$@" +exec ${BL_TASKSET:-} /usr/local/bin/droiddeck-fex steam "$verb" "$@" """ diff --git a/tools/tests/test_droiddeck_fex.py b/tools/tests/test_droiddeck_fex.py index 3bfbabc86..fed546ddd 100644 --- a/tools/tests/test_droiddeck_fex.py +++ b/tools/tests/test_droiddeck_fex.py @@ -6,6 +6,7 @@ import os import runpy import shutil import struct +import subprocess import tempfile import unittest from pathlib import Path @@ -866,6 +867,22 @@ class AppInfoTest(unittest.TestCase): self.assertIn('"from_oslist" "linux"', vdf) self.assertIn('"to_oslist" "linux"', vdf) + def test_the_tool_runs_games_on_the_chosen_cores(self): + with tempfile.TemporaryDirectory() as tmp: + tool, bin_dir = Path(tmp) / "droiddeck-fex", Path(tmp) / "bin" + self.COMPAT["build_fex_tool"](str(tool)) + bin_dir.mkdir() + (bin_dir / "taskset").write_text('#!/bin/sh\necho "taskset $*"\n') + (bin_dir / "taskset").chmod(0o755) + env = dict(os.environ, PATH="%s:%s" % (bin_dir, os.environ.get("PATH", "")), BL_GAME_CPUS="2-7") + run = subprocess.run([str(tool / "droiddeck-fex-tool"), "waitforexitandrun", "/games/a/game"], + env=env, capture_output=True, text=True, timeout=10) + self.assertEqual(run.stdout, + "taskset -c 2-7 /usr/local/bin/droiddeck-fex steam waitforexitandrun /games/a/game\n") + self.assertIn("game cores 2-7", run.stderr) + self.assertIn('exec /usr/local/bin/droiddeck-steamvr-game ${BL_TASKSET:-} ' + '/usr/local/bin/droiddeck-fex steam "$verb" "$@"', self.COMPAT["FEX_LAUNCHER_SH"]) + if __name__ == "__main__": unittest.main()