Documentation ¶
Index ¶
Constants ¶
const ( // PciDevicesRoot represents base path for all pci devices under sysfs PciDevicesRoot = "/sys/bus/pci/devices" // PciStatusByte indicates status byte PciStatusByte = 0x06 // PciStatusCapabilityList indicates if capability list is supported PciStatusCapabilityList = 0x10 // PciCapabilityList indicates offset of first capability list entry PciCapabilityList = 0x34 // PciCapabilityListID indicates offset for capability id PciCapabilityListID = 0 // PciCapabilityListNext indicates offset for next capability in the list PciCapabilityListNext = 1 // PciCapabilityLength indicates offset for capability length PciCapabilityLength = 2 // PciCapabilityVendorSpecificID indicates PCI vendor specific capability id PciCapabilityVendorSpecificID = 0x09 // PciNvidiaVendorID represents PCI vendor id for Nvidia PciNvidiaVendorID = "0x10de" )
const ( // VGPUCapabilityRecordStart indicates offset of beginning vGPU capability record VGPUCapabilityRecordStart = 5 // HostDriverVersionLength indicates max length of driver version HostDriverVersionLength = 10 // HostDriverBranchLength indicates max length of driver branch HostDriverBranchLength = 10 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device is just an alias to a PCIDevice
type Interface ¶
Interface allows us to get a list of vGPU specific PCI devices
func NewMockVGPU ¶
func NewMockVGPU() Interface
NewMockVGPU initializes and returns mock Interface interface type
func NewVGPULib ¶
NewVGPULib returns an instance of Lib implementing the VGPU interface
type Lib ¶
type Lib struct {
// contains filtered or unexported fields
}
Lib implements the NvidiaVGPU interface
func (*Lib) IsVGPUDevice ¶
IsVGPUDevice returns true if the device is of type vGPU
type MockNvidiaPCI ¶
type MockNvidiaPCI struct {
// contains filtered or unexported fields
}
MockNvidiaPCI represents mock of NvidiaPCI interface
func (*MockNvidiaPCI) Devices ¶
func (p *MockNvidiaPCI) Devices() ([]*PCIDevice, error)
Devices returns PCI devices with mocked data
type NvidiaPCI ¶
NvidiaPCI interface allows us to get a list of all NVIDIA PCI devices
func NewMockNvidiaPCI ¶
func NewMockNvidiaPCI() NvidiaPCI
NewMockNvidiaPCI initializes and returns mock PCI interface type
func NewNvidiaPCILib ¶
func NewNvidiaPCILib() NvidiaPCI
NewNvidiaPCILib returns an instance of NvidiaPCILib implementing the NvidiaPCI interface
type NvidiaPCILib ¶
type NvidiaPCILib struct{}
NvidiaPCILib implements the NvidiaPCI interface
func (*NvidiaPCILib) Devices ¶
func (p *NvidiaPCILib) Devices() ([]*PCIDevice, error)
Devices returns all PCI devices on the system
type PCIDevice ¶
PCIDevice represents a single PCI device
func (*PCIDevice) GetVendorSpecificCapability ¶
GetVendorSpecificCapability returns the vendor specific capability from configuration space