From 34e90a8fd5ab51b2478e46d45b02bdc1260ffef6 Mon Sep 17 00:00:00 2001 From: Liam Middlebrook Date: Mon, 9 Sep 2024 17:12:05 -0700 Subject: [PATCH] proton: Populate NVIDIA_WINE_DLL_DIR when available NVIDIA-software may check the environment variable `NVIDIA_WINE_DLL_DIR` for a path where DLLs provided by the NVIDIA Linux driver can be found. This needs to be set by `proton` script, as it is ran inside of the pressure-vessel environment, so the paths returned will be valid within the environment. Tested with an application that reads `NVIDIA_WINE_DLL_DIR` from the environment and tries to load a known DLL from it. As expected manually setting the environment variable to the on-disk location did not work, as the path is not accurate within the pressure-vessel environment. --- proton | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proton b/proton index b6bb6a79e2..e8b36f896c 100755 --- a/proton +++ b/proton @@ -1461,6 +1461,12 @@ class Session: if "PROTON_CRASH_REPORT_DIR" in self.env: self.env["WINE_CRASH_REPORT_DIR"] = self.env["PROTON_CRASH_REPORT_DIR"] + # 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() + if nvidia_wine_dll_dir: + self.env["NVIDIA_WINE_DLL_DIR"] = nvidia_wine_dll_dir + if "PROTON_LOG" in self.env and nonzero(self.env["PROTON_LOG"]): if self.setup_logging(append_forever=False): self.log_file.write("======================\n")