func (v *VGPULib) Devices() ([]*VGPUDevice, error) {
	pciDevices, err := v.pci.Devices()
	if err != nil {
		return nil, fmt.Errorf("Error getting NVIDIA specific PCI devices: %v", err)
	}
	var vgpus []*VGPUDevice
	for _, device := range pciDevices {
		capability, err := device.GetVendorSpecificCapability()
		if err != nil {
			return nil, fmt.Errorf("Unable to read vendor specific capability for %s: %v", device.Address, err)
		}
		if capability == nil {
			continue
		}
		if exists := v.IsVGPUDevice(capability); exists {
			vgpu := &VGPUDevice{
				pci:            device,
				vGPUCapability: capability,
			}
			vgpus = append(vgpus, vgpu)
		}
	}
	return vgpus, nil
}
Devices returns all vGPU devices attached to the guest
package main
import (
	"fmt"
	"strings"
)
type VGPU interface {
	Devices() ([]*VGPUDevice, error)
}
type VGPUDevice struct {
	pci            *PCIDevice
	vGPUCapability []byte
}
type VGPUInfo struct {
	HostDriverVersion string
	HostDriverBranch  string
}
const (
	VGPUCapabilityRecordStart = 5
	HostDriverVersionLength = 10
	HostDriverBranchLength = 10
)
type VGPULib struct {
	pci NvidiaPCI
}
func NewVGPULib(pci NvidiaPCI) VGPU {
	return &VGPULib{pci: pci}
}