how to get Grid K2 serial number from nvidia-ml-py ?

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)
print nvmlDeviceGetName(handle)
print nvmlDeviceGetSerial(handle)

Traceback (most recent call last):
File “”, line 4, in
File “/usr/local/lib/python2.7/dist-packages/”, line 866, in nvmlDeviceGetSerial
File “/usr/local/lib/python2.7/dist-packages/”, line 310, in _nvmlCheckReturn
raise NVMLError(ret)
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?

Thank you

what is the output of nvidia-smi -q ?