mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 13:26:02 +00:00
fix(proton): Windows games see only the cores they are pinned to
Game cores pinned the game with taskset, but Wine counts the online CPUs, so a game held to two cores still saw eight processors and sized its thread pools for them. Prototype freezes at its splash screen that way. When the session or a game profile limits the game cores, Wine now gets WINE_CPU_TOPOLOGY for exactly those cores unless the profile sets its own.
This commit is contained in:
1 parent
d905f03bf7
commit
9d85af7558
2 files changed
+32
No files matched your search
@@ -351,6 +351,20 @@ def game_cores(env):
|
||||
print("droiddeck-game-env: could not use game cores %r (%s)" % (text, error), file=sys.stderr)
|
||||
|
||||
|
||||
def cpu_topology(env):
|
||||
if env.get("WINE_CPU_TOPOLOGY") or not (env.get("DROIDDECK_GAME_CORES", "").strip() or env.get("BL_GAME_CPUS", "").strip()):
|
||||
return
|
||||
try:
|
||||
cores = sorted(os.sched_getaffinity(0))
|
||||
except OSError:
|
||||
return
|
||||
online = online_cores()
|
||||
if not cores or set(cores) >= online or cores[-1] >= len(online):
|
||||
return
|
||||
env["WINE_CPU_TOPOLOGY"] = "%d:%s" % (len(cores), ",".join(map(str, cores)))
|
||||
print("droiddeck-game-env: Windows sees %d cores (%s)" % (len(cores), env["WINE_CPU_TOPOLOGY"]), file=sys.stderr)
|
||||
|
||||
|
||||
def apply_config(env, config, app_id, fixes=None):
|
||||
if config.get("version") != 1:
|
||||
raise ValueError("unsupported environment configuration")
|
||||
@@ -627,6 +641,7 @@ def main():
|
||||
env = vram_cap(env)
|
||||
env = force_ssbs(command, env)
|
||||
game_cores(env)
|
||||
cpu_topology(env)
|
||||
try:
|
||||
xbox = runpy.run_path(str(Path(__file__).with_name("droiddeck-xbox")))
|
||||
except Exception as error:
|
||||
|
||||
Reference in new issue
Block a user