Skip to content

Commit

Permalink
Add GE-Proton9-19 changes to the proton file
Browse files Browse the repository at this point in the history
  • Loading branch information
pythonlover02 authored Nov 9, 2024
1 parent 8e0f161 commit 930efe1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Sarek-Patches/proton
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,26 @@ class Session:
if "PROTON_CRASH_REPORT_DIR" in self.env:
self.env["WINE_CRASH_REPORT_DIR"] = self.env["PROTON_CRASH_REPORT_DIR"]

# Always set DRI_PRIME=1 if more than one GPU is detected.
# Fixes Diablo IV grey screen with igpu + dgpu
try:
# Execute the lspci command to list all PCI devices
output = subprocess.check_output(['lspci'], encoding='utf-8')

# Filter the output for VGA compatible controllers
gpu_list = [line for line in output.split('\n') if 'VGA compatible controller' in line]

# Count the number of GPUs
num_gpus = len(gpu_list)

if num_gpus > 1:
self.env["DRI_PRIME"] = "1"

except subprocess.CalledProcessError:
print("Failed to execute lspci. Ensure the command is available on your system.")
except FileNotFoundError:
print("lspci command not found. Ensure it is installed on your system.")

# NVIDIA software may check NVIDIA_WINE_DLL_DIR as a search-path for
# driver-provided DLLs for use by Proton/Wine.
nvidia_wine_dll_dir = find_nvidia_wine_dll_dir()
Expand Down

0 comments on commit 930efe1

Please sign in to comment.