From 78ab98b92e16bcd560e2571407b73ab005e38825 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Mon, 8 Sep 2025 08:38:47 -0400 Subject: [PATCH] guard against zluda and directml on non-windows platforms Signed-off-by: Vladimir Mandic --- CHANGELOG.md | 1 + installer.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b1bde1aa..94ae9d541 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -73,6 +73,7 @@ Also, there are quite a few offloading improvements and many quality-of-life cha - add `--new` command line flag to enable testing of new packages without breaking existing installs - downgrade rocm to `torch==2.7.1` - set the minimum supported rocm version on linux to `rocm==6.0` + - disallow `zluda` and `directml` on non-windows platforms - **OpenVINO** - update to `openvino==2025.3.0` - add deprecation warning for Python 3.9 diff --git a/installer.py b/installer.py index d96fb4887..0f14c3f3d 100644 --- a/installer.py +++ b/installer.py @@ -909,6 +909,16 @@ def check_torch(): # log.debug(f'Torch allowed: cuda={allow_cuda} rocm={allow_rocm} ipex={allow_ipex} diml={allow_directml} openvino={allow_openvino}') torch_command = os.environ.get('TORCH_COMMAND', '') + if sys.platform != 'win32': + if args.use_zluda: + log.error('ZLUDA is only supported on Windows') + if not args.ignore: + sys.exit(1) + if args.use_directml: + log.error('DirectML is only supported on Windows') + if not args.ignore: + sys.exit(1) + if torch_command != '': pass else: