[misc][cuda] add warning for pynvml user (#7675)

This commit is contained in:
youkaichao 2024-08-20 00:35:09 -07:00 committed by GitHub
parent e6d811dd13
commit ad28a74beb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,6 +18,12 @@ logger = init_logger(__name__)
_P = ParamSpec("_P") _P = ParamSpec("_P")
_R = TypeVar("_R") _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 # NVML utils
# Note that NVML is not affected by `CUDA_VISIBLE_DEVICES`, # Note that NVML is not affected by `CUDA_VISIBLE_DEVICES`,
# all the related functions work on real physical device ids. # all the related functions work on real physical device ids.