From 2dc5cb15aeaba183be8303c865a7c6d0271750ec Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Wed, 27 May 2026 01:00:49 +0200 Subject: [PATCH] Guard CUDA probe when CUDA_HOME is unset --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a0e59cf86..06555d4b0 100644 --- a/setup.py +++ b/setup.py @@ -171,7 +171,8 @@ def check_cudnn_version_and_warn(global_option: str, required_cudnn_version: int ext_modules.append(CppExtension("apex_C", ["csrc/flatten_unflatten.cpp"])) -_, bare_metal_version = get_cuda_bare_metal_version(CUDA_HOME) +if CUDA_HOME is not None: + _, bare_metal_version = get_cuda_bare_metal_version(CUDA_HOME) if has_flag("--distributed_adam", "APEX_DISTRIBUTED_ADAM"): if "--distributed_adam" in sys.argv: