I tried nvidia-smi -q, and I found serial number is not printed.
I tried pynvml:
from pynvml import *
deviceCount = nvmlDeviceGetCount()
for i in range(deviceCount):
handle = nvmlDeviceGetHandleByIndex(i)
Traceback (most recent call last):
File “”, line 4, in
File “/usr/local/lib/python2.7/dist-packages/pynvml.py”, line 866, in nvmlDeviceGetSerial
File “/usr/local/lib/python2.7/dist-packages/pynvml.py”, line 310, in _nvmlCheckReturn
pynvml.NVMLError_NotSupported: Not Supported
It seems the serial is associated with the board that contains multiple devices, so query device for serial would fail on latest nvidia ml library, but I can’t find a way to do it via a different API. Anyone shade light on this?