From e2919d38b4a7cfc03eb8a31b28c5a1ac4c9f10a4 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Sun, 16 Feb 2025 05:45:08 -0500 Subject: [PATCH] Disable bf16 on AMD GPUs that don't support it. --- comfy/model_management.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/comfy/model_management.py b/comfy/model_management.py index fb924f432..9f6522967 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -1106,6 +1106,11 @@ def should_use_bf16(device=None, model_params=0, prioritize_performance=True, ma if is_ascend_npu(): return True + if is_amd(): + arch = torch.cuda.get_device_properties(device).gcnArchName + if arch in ["gfx1030", "gfx1031", "gfx1010", "gfx1011", "gfx1012", "gfx906", "gfx900", "gfx803"]: # RDNA2 and older don't support bf16 + return False + props = torch.cuda.get_device_properties(device) if props.major >= 8: return True