From a8cc610ec185f19303e3d19f9e87ad847be49083 Mon Sep 17 00:00:00 2001 From: Kiskae Date: Sun, 3 Mar 2024 14:40:43 +0100 Subject: Replace `py3nvml` with `nvidia-ml-py` --- glances/plugins/gpu/__init__.py | 3 +-- optional-requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/glances/plugins/gpu/__init__.py b/glances/plugins/gpu/__init__.py index b807c51e..4d11ce9f 100644 --- a/glances/plugins/gpu/__init__.py +++ b/glances/plugins/gpu/__init__.py @@ -13,9 +13,8 @@ from glances.globals import nativestr, to_fahrenheit from glances.logger import logger from glances.plugins.plugin.model import GlancesPluginModel -# In Glances 3.1.4 or higher, we use the py3nvml lib (see issue #1523) try: - import py3nvml.py3nvml as pynvml + import pynvml except Exception as e: import_error_tag = True # Display debug message if import KeyError diff --git a/optional-requirements.txt b/optional-requirements.txt index c1cc69c1..309353e7 100644 --- a/optional-requirements.txt +++ b/optional-requirements.txt @@ -26,7 +26,7 @@ pycouchdb pygal pymdstat pymongo; python_version >= "3.7" -py3nvml; python_version >= "3.5" +nvidia-ml-py; python_version >= "3.5" pysnmp pySMART.smartx python-dateutil diff --git a/setup.py b/setup.py index c32e6e86..a70a0d1c 100755 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ def get_install_extras_require(): 'ibmcloudant', 'influxdb>=1.0.0', 'influxdb-client', 'pymongo', 'kafka-python', 'pika', 'paho-mqtt', 'potsdb', 'prometheus_client', 'pyzmq', 'statsd'], - 'gpu': ['py3nvml'], + 'gpu': ['nvidia-ml-py'], 'graph': ['pygal'], 'ip': ['netifaces'], 'raid': ['pymdstat'], -- cgit v1.2.3 From 0bca21f8b1428e52b37bf49a4743ee299795766b Mon Sep 17 00:00:00 2001 From: Kiskae Date: Sun, 3 Mar 2024 14:40:56 +0100 Subject: update documentation for `nvidia-ml-py` --- README.rst | 2 +- docs/aoa/gpu.rst | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 8ea0b903..d83d4ff5 100644 --- a/README.rst +++ b/README.rst @@ -105,7 +105,7 @@ Optional dependencies: - ``kafka-python`` (for the Kafka export module) - ``netifaces`` (for the IP plugin) - ``orjson`` (fast JSON library, used under the hood by FastAPI) -- ``py3nvml`` (for the GPU plugin) +- ``nvidia-ml-py`` (for the GPU plugin) - ``pycouchdb`` (for the CouchDB export module) - ``pika`` (for the RabbitMQ/ActiveMQ export module) - ``podman`` (for the Containers Podman monitoring support) diff --git a/docs/aoa/gpu.rst b/docs/aoa/gpu.rst index 85d1cdba..9b61ccdd 100644 --- a/docs/aoa/gpu.rst +++ b/docs/aoa/gpu.rst @@ -4,7 +4,8 @@ GPU === .. note:: - You need to install the `py3nvml`_ library on your system. + You need to install the `nvidia-ml-py`_ library on your system. + Or `py3nvml`_ for Glances 3.4.0.2 or lower. Or `nvidia-ml-py3`_ for Glances 3.1.3 or lower. The GPU stats are shown as a percentage of value and for the configured @@ -49,5 +50,6 @@ GPU (PROC/MEM) Status ``>90%`` ``CRITICAL`` ============== ============ +.. _nvidia-ml-py: https://pypi.org/project/nvidia-ml-py/ .. _py3nvml: https://pypi.org/project/py3nvml/ .. _nvidia-ml-py3: https://pypi.org/project/nvidia-ml-py3/ -- cgit v1.2.3