Skip to content

Commit ae42bf5

Browse files
committed
Fix the wrong warning condition for wookayin#143.
1 parent 647bd34 commit ae42bf5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gpustat/nvml.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def nvmlDeviceGetMemoryInfo(handle):
118118
"""
119119
M = pynvml_monkeypatch
120120

121-
if M.has_memoryinfo_v2 is not None:
121+
if M.has_memoryinfo_v2 is None:
122122
try:
123123
pynvml._nvmlGetFunctionPointer("nvmlDeviceGetMemoryInfo_v2")
124124
M.has_memoryinfo_v2 = True
@@ -138,7 +138,8 @@ def nvmlDeviceGetMemoryInfo(handle):
138138
"Your NVIDIA driver requires a compatible version of "
139139
"pynvml (>= 11.510.69) installed to display the correct "
140140
"memory usage information (See #141 for more details). "
141-
"Please try `pip install --upgrade pynvml`.")
141+
"Please try `pip install --upgrade pynvml`.",
142+
category=UserWarning)
142143
memory = M.original_nvmlDeviceGetMemoryInfo(handle)
143144

144145
return memory

0 commit comments

Comments
 (0)