From b5b68670b3964652fd1aead9758b31b386ddac00 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Fri, 22 Aug 2025 14:13:16 +0530 Subject: [PATCH] Allow a user to temporarily override the HSA_OVERRIDE_GFX_VERSION and HIP_VISIBLE_DEVICES env variables, until ED gets proper per-process multi-gpu support --- scripts/check_modules.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index c36334e0..bea284b9 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -302,6 +302,16 @@ def launch_uvicorn(): if hasattr(torchruntime, "info"): torchruntime.info() + # allow a user to override the HSA_OVERRIDE_GFX_VERSION and HIP_VISIBLE_DEVICES variables + # until ED gets process-based multi-GPU support (which will allow different processes to use different GPUs) + backend_config = config.get("backend_config", {}) + if "HSA_OVERRIDE_GFX_VERSION" in backend_config: + os.environ["HSA_OVERRIDE_GFX_VERSION"] = str(backend_config["HSA_OVERRIDE_GFX_VERSION"]) + print(f"backend_config overrode HSA_OVERRIDE_GFX_VERSION to {os.environ['HSA_OVERRIDE_GFX_VERSION']}") + if "HIP_VISIBLE_DEVICES" in backend_config: + os.environ["HIP_VISIBLE_DEVICES"] = str(backend_config["HIP_VISIBLE_DEVICES"]) + print(f"backend_config overrode HIP_VISIBLE_DEVICES to {os.environ['HIP_VISIBLE_DEVICES']}") + if os_name == "Windows": os.environ["PYTHONPATH"] = str(Path(os.environ["INSTALL_ENV_DIR"], "lib", "site-packages")) else: