mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-22 14:26:00 +00:00
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
This commit is contained in:
1 parent
9ed658c45c
commit
d9328c39df
2 files changed
+21
-2
No files matched your search
@@ -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()
|
||||
Reference in new issue
Block a user