From 84be5c3e79e900148b30e373207dfb1938b5e8cb Mon Sep 17 00:00:00 2001 From: Alex Butler Date: Thu, 23 Oct 2025 10:36:32 +0100 Subject: [PATCH] Default MIOPEN_FIND_MODE=FAST for amd instead of disabling cudnn --- comfy/model_management.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index 79d6ff9d4..477f3fe2a 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -26,6 +26,7 @@ import importlib import platform import weakref import gc +import os class VRAMState(Enum): DISABLED = 0 #No vram present: no need to move models to vram @@ -335,11 +336,11 @@ AMD_RDNA2_AND_OLDER_ARCH = ["gfx1030", "gfx1031", "gfx1010", "gfx1011", "gfx1012 try: if is_amd(): - arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName - if not (any((a in arch) for a in AMD_RDNA2_AND_OLDER_ARCH)): - torch.backends.cudnn.enabled = False # Seems to improve things a lot on AMD - logging.info("Set: torch.backends.cudnn.enabled = False for better AMD performance.") + if os.getenv('MIOPEN_FIND_MODE') is None: + os.environ['MIOPEN_FIND_MODE'] = "FAST" + logging.info("Set: MIOPEN_FIND_MODE=FAST for better AMD performance, change by setting MIOPEN_FIND_MODE.") + arch = torch.cuda.get_device_properties(get_torch_device()).gcnArchName try: rocm_version = tuple(map(int, str(torch.version.hip).split(".")[:2])) except: