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.

https://github.com/ValveSoftware/Proton/pull/8087
This commit is contained in:
Liam Middlebrook 2024-09-09 17:12:05 -07:00 committed by Paul Gofman
parent 97e5f6f677
commit 16dbf51c57

6
proton
View file

@ -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")