From 0408efc6d0c17fba17b2be38d0d0f02e96d2bf9d Mon Sep 17 00:00:00 2001 From: youkaichao Date: Thu, 6 Feb 2025 15:23:50 +0800 Subject: [PATCH] [Misc] Improve error message for incorrect pynvml (#12809) Signed-off-by: youkaichao --- vllm/platforms/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vllm/platforms/__init__.py b/vllm/platforms/__init__.py index 9c98942b55699..e4767a378f45f 100644 --- a/vllm/platforms/__init__.py +++ b/vllm/platforms/__init__.py @@ -41,7 +41,11 @@ def cuda_platform_plugin() -> Optional[str]: is_cuda = True finally: pynvml.nvmlShutdown() - except Exception: + except Exception as e: + if "nvml" not in e.__class__.__name__.lower(): + # If the error is not related to NVML, re-raise it. + raise e + # CUDA is supported on Jetson, but NVML may not be. import os