How to get GPU's UUID directly?(except call API:nvmlDeviceGetUUID)

we all know that we can get GPU’s UUID by calling nvmlDeviceGetUUID API.But how to get UUID directly such as read PCIE configuration space or other way.If we can get UUID by reading pcie configuration space,what’s the address that the UUID stored?

Thanks for your attention.

There is a proc file that could contain this information but when I use it the UUID is unknown.

I agree that nvml is a real let down and cannot be used within a nvidia docker container. The whole thing is a real dogs breakfast.

sudo cat /proc/driver/nvidia/gpus/0000:01:00.0/information
Model: GeForce GTX 1070
IRQ: 127
GPU UUID: GPU-???-???-???-???-???
Video BIOS: ??.??.??.??.??
Bus Type: PCIe
DMA Size: 47 bits
DMA Mask: 0x7fffffffffff
Bus Location: 0000:01:00.0
Device Minor: 0