Documentation ¶
Index ¶
- type ConfigSpace
- type ConfigSpaceIO
- type Interface
- type MemoryResource
- type MockNvpci
- func (m *MockNvpci) AddMockA100(address string, numaNode int) error
- func (m *MockNvpci) Cleanup()
- func (p MockNvpci) Get3DControllers() ([]*NvidiaPCIDevice, error)
- func (p MockNvpci) GetAllDevices() ([]*NvidiaPCIDevice, error)
- func (p MockNvpci) GetGPUs() ([]*NvidiaPCIDevice, error)
- func (p MockNvpci) GetNVSwitches() ([]*NvidiaPCIDevice, error)
- func (p MockNvpci) GetVGAControllers() ([]*NvidiaPCIDevice, error)
- type NvidiaPCIDevice
- type PCICapabilities
- type PCIExtendedCapability
- type PCIStandardCapability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigSpace ¶
type ConfigSpace struct {
Path string
}
ConfigSpace PCI configuration space (standard extended) file path
func (*ConfigSpace) Read ¶
func (cs *ConfigSpace) Read() (ConfigSpaceIO, error)
type ConfigSpaceIO ¶
type ConfigSpaceIO interface { bytes.Bytes GetVendorID() uint16 GetDeviceID() uint16 GetPCICapabilities() (*PCICapabilities, error) }
ConfigSpaceIO Interface for reading and writing raw and preconfigured values
type Interface ¶
type Interface interface { GetAllDevices() ([]*NvidiaPCIDevice, error) Get3DControllers() ([]*NvidiaPCIDevice, error) GetVGAControllers() ([]*NvidiaPCIDevice, error) GetNVSwitches() ([]*NvidiaPCIDevice, error) GetGPUs() ([]*NvidiaPCIDevice, error) }
Interface allows us to get a list of all NVIDIA PCI devices
type MemoryResource ¶
MemoryResource represents a mmio region
type MockNvpci ¶
type MockNvpci struct {
// contains filtered or unexported fields
}
MockNvpci mock pci device
func NewMockNvpci ¶
NewMockNvpci create new mock PCI and remove old devices
func (*MockNvpci) AddMockA100 ¶
AddMockA100 Create an A100 like GPU mock device
func (*MockNvpci) Cleanup ¶
func (m *MockNvpci) Cleanup()
Cleanup remove the mocked PCI devices root folder
func (MockNvpci) Get3DControllers ¶
func (p MockNvpci) Get3DControllers() ([]*NvidiaPCIDevice, error)
Get3DControllers returns all NVIDIA 3D Controller PCI devices on the system
func (MockNvpci) GetAllDevices ¶
func (p MockNvpci) GetAllDevices() ([]*NvidiaPCIDevice, error)
GetAllDevices returns all Nvidia PCI devices on the system
func (MockNvpci) GetGPUs ¶
func (p MockNvpci) GetGPUs() ([]*NvidiaPCIDevice, error)
GetGPUs returns all NVIDIA GPU devices on the system
func (MockNvpci) GetNVSwitches ¶
func (p MockNvpci) GetNVSwitches() ([]*NvidiaPCIDevice, error)
GetNVSwitches returns all NVIDIA NVSwitch PCI devices on the system
func (MockNvpci) GetVGAControllers ¶
func (p MockNvpci) GetVGAControllers() ([]*NvidiaPCIDevice, error)
GetVGAControllers returns all NVIDIA VGA Controller PCI devices on the system
type NvidiaPCIDevice ¶
type NvidiaPCIDevice struct { Path string Address string Vendor uint16 Class uint32 Device uint16 NumaNode int Config *ConfigSpace Resources map[int]*MemoryResource }
NvidiaPCIDevice represents a PCI device for an NVIDIA product
func (*NvidiaPCIDevice) Is3DController ¶
func (d *NvidiaPCIDevice) Is3DController() bool
Is3DController if class == 0x302
func (*NvidiaPCIDevice) IsGPU ¶
func (d *NvidiaPCIDevice) IsGPU() bool
IsGPU either VGA for older cards or 3D for newer
func (*NvidiaPCIDevice) IsNVSwitch ¶
func (d *NvidiaPCIDevice) IsNVSwitch() bool
IsNVSwitch if classe == 0x068
func (*NvidiaPCIDevice) IsResetAvailable ¶
func (d *NvidiaPCIDevice) IsResetAvailable() bool
IsResetAvailable some devices can be reset without rebooting, check if applicable
func (*NvidiaPCIDevice) IsVGAController ¶
func (d *NvidiaPCIDevice) IsVGAController() bool
IsVGAController if class == 0x300
func (*NvidiaPCIDevice) Reset ¶
func (d *NvidiaPCIDevice) Reset() error
Reset perform a reset to apply a new configuration at HW level
type PCICapabilities ¶
type PCICapabilities struct { Standard map[uint8]*PCIStandardCapability Extended map[uint16]*PCIExtendedCapability }
PCICapabilities combines the standard and extended config space
type PCIExtendedCapability ¶
PCIExtendedCapability extended PCI config space
type PCIStandardCapability ¶
PCIStandardCapability standard PCI config space