From 6ceb2e8d3026cc2f9ca09a330872736ac4dedf3b Mon Sep 17 00:00:00 2001 From: Paul Gofman Date: Tue, 26 Mar 2024 16:07:17 -0600 Subject: [PATCH] proton: Limit CPU count for some games. CW-Bug-Id: #22223 --- proton | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/proton b/proton index ce82ea31..dda71c88 100755 --- a/proton +++ b/proton @@ -1147,6 +1147,19 @@ def default_compat_config(): return ret +default_cpu_limit = { + "19900" : 16, # Far Cry 2 + "298110" : 16, # Far Cry 4 + "20920" : 16, # The Witcher 2: Assassins of Kings Enchanced Edition + "35130" : 16, # Lara Croft and the Guardian of Light + "55150" : 16, # Warhammer 40,000: Space Marine + "15620" : 8, # Warhammer 40,000: Dawn of War II + "20570" : 8, # Warhammer 40,000: Dawn of War II - Chaos Rising + "56400" : 8, # Warhammer 40,000: Dawn of War II - Retribution + "618970" : 4, # Outcast - Second Contact + "10150" : 8, # Prototype +} + class Session: def __init__(self): self.log_file = None @@ -1184,6 +1197,10 @@ class Session: if not "noforcelgadd" in self.compat_config: self.compat_config.add("forcelgadd") + appid = os.environ.get("SteamGameId", 0) + if not "WINE_CPU_TOPOLOGY" in self.env and appid in default_cpu_limit: + self.env["WINE_CPU_TOPOLOGY"] = str(default_cpu_limit[appid]) + def init_wine(self): if "HOST_LC_ALL" in self.env and len(self.env["HOST_LC_ALL"]) > 0: #steam sets LC_ALL=C to help some games, but Wine requires the real value