From 868c29cff3e9fe5bee91ede16a8c336d5d950429 Mon Sep 17 00:00:00 2001 From: Alan Li Date: Fri, 24 Jul 2026 16:01:01 -0400 Subject: [PATCH 1/2] Gate supports_nvfp4_compute on CUDA 13+ build (fixes #11864) cuBLAS FP4 matmul kernels (cublasLtMatmulAlgoGetHeuristic) require CUDA 13.0+. On Blackwell GPUs with torch built against CUDA <13 (e.g. cu128), the previous check only looked at compute capability and let native NVFP4 through, causing CUBLAS_STATUS_NOT_SUPPORTED errors or VRAM blowups at matmul time. Now falls back to the regular quantized-storage path when the CUDA build is too old. Co-Authored-By: Claude Fable 5 --- comfy/model_management.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/comfy/model_management.py b/comfy/model_management.py index 9f8e7f07b..017df17d1 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -1963,6 +1963,14 @@ def supports_nvfp4_compute(device=None): if props.major < 10: return False + # cuBLAS FP4 matmul kernels require CUDA 13+, see #11864 + try: + cuda_version_major = int(torch.version.cuda.split(".")[0]) + except: + return False + if cuda_version_major < 13: + return False + return True def supports_mxfp8_compute(device=None): From 8f4e58d29f7a3aed4099bc9e76c20845db709d9a Mon Sep 17 00:00:00 2001 From: Alan Li Date: Fri, 31 Jul 2026 22:33:14 -0400 Subject: [PATCH 2/2] Use specific exception types in CUDA version parse Per AGENTS.md: prefer specific exception types in new code. AttributeError covers torch.version.cuda being None, ValueError covers an unparseable version string. --- comfy/model_management.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index 017df17d1..7dcfca35d 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -1966,7 +1966,7 @@ def supports_nvfp4_compute(device=None): # cuBLAS FP4 matmul kernels require CUDA 13+, see #11864 try: cuda_version_major = int(torch.version.cuda.split(".")[0]) - except: + except (AttributeError, ValueError): return False if cuda_version_major < 13: return False