From ad28a74beb8497a6961cfb39c63d6070712f1ef7 Mon Sep 17 00:00:00 2001 From: youkaichao Date: Tue, 20 Aug 2024 00:35:09 -0700 Subject: [PATCH] [misc][cuda] add warning for pynvml user (#7675) --- vllm/platforms/cuda.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vllm/platforms/cuda.py b/vllm/platforms/cuda.py index c7557dc34ff64..84301afabe9d8 100644 --- a/vllm/platforms/cuda.py +++ b/vllm/platforms/cuda.py @@ -18,6 +18,12 @@ _P = ParamSpec("_P") _R = TypeVar("_R") +if pynvml.__file__.endswith("__init__.py"): + logger.warning( + "You are using a deprecated `pynvml` package. Please install" + " `nvidia-ml-py` instead. See https://pypi.org/project/pynvml " + "for more information.") + # NVML utils # Note that NVML is not affected by `CUDA_VISIBLE_DEVICES`, # all the related functions work on real physical device ids.