From c6d46a2da9086009d741f1fa29ddc854aba3ad54 Mon Sep 17 00:00:00 2001 From: Chuan Li Date: Tue, 14 Jul 2026 21:02:35 -0700 Subject: [PATCH] [ROCm][Bugfix] Return empty UUID string when amdsmi uuid query fails RocmPlatform.get_device_uuid caught AmdSmiException from amdsmi_get_gpu_device_uuid but did not return, leaving device_uuid unbound. The trailing `return device_uuid` then raised UnboundLocalError, masking the original amdsmi error. Return "" on failure, matching the handling of the preceding handle-query block. Signed-off-by: Chuan Li Co-authored-by: Cursor Co-authored-by: Cursor --- vllm/platforms/rocm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vllm/platforms/rocm.py b/vllm/platforms/rocm.py index 4b182aeb8852..3e2b78c30748 100644 --- a/vllm/platforms/rocm.py +++ b/vllm/platforms/rocm.py @@ -753,6 +753,7 @@ def get_device_uuid(cls, device_id: int = 0) -> str: device_uuid = amdsmi_get_gpu_device_uuid(device) except AmdSmiException as error: logger.error("amdsmi device uuid query failed ", exc_info=error) + return "" return device_uuid @classmethod