Closed ksangeek closed 4 years ago
Unit test results -
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 19:18:58)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pynvml
>>> pynvml.nvmlInit()
>>> pynvml.nvmlSystemGetDriverVersion().decode()
'440.33.01'
>>> vsn = pynvml.nvmlSystemGetDriverVersion().decode()
>>> print('[Driver Version: '+vsn+']', end =' ')
[Driver Version: 440.33.01] >>>
>>> int(vsn.split('.')[0])
440
>>> int(vsn.split('.')[0]) > 0.0
True
>>> vsn = pynvml.nvmlSystemGetNVMLVersion().decode()
>>> print('[NVML Version: '+vsn+']', end =' ')
[NVML Version: 10.440.33.01] >>>
>>> int(vsn.split('.')[0])
10
>>> int(vsn.split('.')[0]) > 0.0
True
LGTM - Thanks @ksangeek !
float
, as that does not work with driver versions like440.33.01
or418.87.00
. I have modified the version check test case to check if the major version number is greater than 0. Please let me know if there are suggestions to improve the test.test_nvmlSystemGetNVMLVersion
to test the APInvmlSystemGetNVMLVersion()
instead ofnvmlSystemGetDriverVersion()
, which I think it was intended to. Elsetest_nvmlSystemGetNVMLVersion()
andtest_nvmlSystemGetDriverVersion()
were testing the same API.