From 1d0b5d7fe192a30d89284268598faf5049c2b4aa Mon Sep 17 00:00:00 2001 From: Lucy Date: Sat, 8 Feb 2025 20:21:14 -0600 Subject: [PATCH] force quit when get pynvml version issue --- vllm/utils.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/vllm/utils.py b/vllm/utils.py index 8b9269598757..a162dd5b7bf2 100644 --- a/vllm/utils.py +++ b/vllm/utils.py @@ -2252,11 +2252,13 @@ def import_pynvml(): import pynvml if pynvml.__file__.endswith("__init__.py"): # this is pynvml < 12.0 - raise RuntimeError( - "You are using a deprecated `pynvml` package. " - "Please uninstall `pynvml` or upgrade to at least" - " version 12.0. See https://pypi.org/project/pynvml " - "for more information.") + print( + "ERROR: You are using a deprecated `pynvml` package. " + "Please uninstall `pynvml` or upgrade to at least version 12.0. " + "See https://pypi.org/project/pynvml for more information.", + file=sys.stderr, + ) + sys.exit(1) # Forcefully terminate the script return sys.modules["pynvml"] import importlib.util import os