From a27abf73630898341c528b870a17c6ee431ed968 Mon Sep 17 00:00:00 2001 From: Seunghoon Lee Date: Fri, 9 May 2025 20:01:53 +0900 Subject: [PATCH] zluda fix old cards --- modules/zluda.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/zluda.py b/modules/zluda.py index 82b825936..330377ab8 100644 --- a/modules/zluda.py +++ b/modules/zluda.py @@ -34,8 +34,11 @@ def initialize_zluda(): do_hijack() torch.backends.cudnn.enabled = zluda_installer.MIOpen_enabled - if not zluda_installer.MIOpen_enabled: - torch.backends.cuda.enable_cudnn_sdp(False) + if hasattr(torch.backends.cuda, "enable_cudnn_sdp"): + if not zluda_installer.MIOpen_enabled: + torch.backends.cuda.enable_cudnn_sdp(False) + torch.backends.cuda.enable_cudnn_sdp = do_nothing + else: torch.backends.cuda.enable_cudnn_sdp = do_nothing torch.backends.cuda.enable_flash_sdp(False) torch.backends.cuda.enable_flash_sdp = torch.backends.cuda.enable_cudnn_sdp