Add checks to not apply "gpu" setting if it would be disabled.

This commit is contained in:
Daniel Johnson 2024-02-17 19:17:00 -05:00
parent 8bda741ce2
commit 7ae13cea67
2 changed files with 3 additions and 3 deletions

View file

@ -125,7 +125,7 @@ def get_gamescope_args(launch_arguments, system_config):
launch_arguments.insert(0, "-h")
launch_arguments.insert(0, game_width)
launch_arguments.insert(0, "-w")
if system_config.get("gpu"):
if system_config.get("gpu") and len(GPUS) > 1:
gpu = GPUS[system_config["gpu"]]
launch_arguments.insert(0, gpu.pci_id)
launch_arguments.insert(0, "--prefer-vk-device")

View file

@ -235,7 +235,7 @@ class Runner: # pylint: disable=too-many-public-methods
if sdl_video_fullscreen and sdl_video_fullscreen != "off":
env["SDL_VIDEO_FULLSCREEN_DISPLAY"] = sdl_video_fullscreen
if self.system_config.get("gpu"):
if self.system_config.get("gpu") and len(GPUS) > 1:
gpu = GPUS[self.system_config["gpu"]]
if gpu.driver == "nvidia":
env["DRI_PRIME"] = "1"
@ -245,7 +245,7 @@ class Runner: # pylint: disable=too-many-public-methods
else:
env["DRI_PRIME"] = gpu.pci_id
env["VK_ICD_FILENAMES"] = gpu.icd_files # Deprecated
env["VK_DRIVER_FILES"] = gpu.icd_files # Current form
env["VK_DRIVER_FILES"] = gpu.icd_files # Current form
# Set PulseAudio latency to 60ms
if self.system_config.get("pulse_latency"):