diff options
author | Nicolas Hennion <nicolashennion@gmail.com> | 2024-03-04 09:57:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-04 09:57:02 +0100 |
commit | 57eaa08a525585da5b34ec8120837fa230ac3045 (patch) | |
tree | 08439a51e35f1afaf70b816274ae6160346bd8da | |
parent | 753e9f2d974eef022251b5b539abfae22439c5b1 (diff) | |
parent | 0bca21f8b1428e52b37bf49a4743ee299795766b (diff) |
Merge pull request #2688 from Kiskae/swap-nvml
Replace `py3nvml` with `nvidia-ml-py`
-rw-r--r-- | README.rst | 2 | ||||
-rw-r--r-- | docs/aoa/gpu.rst | 4 | ||||
-rw-r--r-- | glances/plugins/gpu/__init__.py | 3 | ||||
-rw-r--r-- | optional-requirements.txt | 2 | ||||
-rwxr-xr-x | setup.py | 2 |
5 files changed, 7 insertions, 6 deletions
@@ -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/ 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 @@ -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'], |