Skip to content

Commit 53075cd

Browse files
committed
Added warning message to nvidia_smi xmldevicequery
I think this was only ever meant to be an example in the original nvml library. Given that nvidia update the nvidia smi query, it will be too hard to keep this query up to date. Instead, calling 'nvidia-smi -q -x' from python with subprocess would achieve the same result.
1 parent f528f99 commit 53075cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

py3nvml/nvidia_smi.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141

4242
from .py3nvml import *
4343
import datetime
44+
import warnings
45+
import logging
46+
import os
4447

4548
#
4649
# Helper functions
@@ -200,6 +203,10 @@ def handleError(err):
200203

201204
#######
202205
def XmlDeviceQuery():
206+
logger = logging.getLogger(__name__)
207+
str_ = """Warning this function is deprecated and will be removed in future releases."""
208+
warnings.warn(str_, RuntimeWarning)
209+
logger.warn(str_)
203210

204211
strResult = ''
205212
try:

0 commit comments

Comments
 (0)