From 7bd86b0896404367bb7dc69f5b65b7703abab797 Mon Sep 17 00:00:00 2001 From: patientx Date: Fri, 16 Aug 2024 00:53:38 +0300 Subject: [PATCH] Update model_management.py --- comfy/model_management.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index a6996709b..6a3cf83ac 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -265,10 +265,24 @@ def get_torch_device_name(device): return "CUDA {}: {}".format(device, torch.cuda.get_device_name(device)) try: - logging.info("Device: {}".format(get_torch_device_name(get_torch_device()))) -except: - logging.warning("Could not pick default device.") + torch_device_name = get_torch_device_name(get_torch_device()) + if "[ZLUDA]" in torch_device_name: + print("***----------------------ZLUDA--------------------------***") + print(" :: ZLUDA detected, disabling non-supported functions.") + + if torch.backends.cudnn.enabled: + torch.backends.cudnn.enabled = False + print(" :: cuDNN , flash_sdp , mem_efficient_sdp disabled") + + torch.backends.cuda.enable_flash_sdp(False) + torch.backends.cuda.enable_math_sdp(True) + torch.backends.cuda.enable_mem_efficient_sdp(False) + print("***-----------------------------------------------------***") + + print("Device:", torch_device_name) +except: + print("Could not pick default device.") current_loaded_models = []