Skip to content

Commit

Permalink
Merge pull request #2688 from Kiskae/swap-nvml
Browse files Browse the repository at this point in the history
Replace `py3nvml` with `nvidia-ml-py`
  • Loading branch information
nicolargo committed Mar 4, 2024
2 parents 753e9f2 + 0bca21f commit 57eaa08
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion docs/aoa/gpu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
3 changes: 1 addition & 2 deletions glances/plugins/gpu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
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
Expand Down
2 changes: 1 addition & 1 deletion optional-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit 57eaa08

Please sign in to comment.