pci

package
v0.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACS

type ACS struct {
	SrcValid    bool `json:"src_valid"`
	TransBlk    bool `json:"trans_blk"`
	ReqRedir    bool `json:"req_redir"`
	CmpltRedir  bool `json:"cmplt_redir"`
	UpstreamFwd bool `json:"upstream_fwd"`
	EgressCtrl  bool `json:"egress_ctrl"`
	DirectTrans bool `json:"direct_trans"`
}

e.g., ACSCap: SrcValid+ TransBlk+ ReqRedir- CmpltRedir- UpstreamFwd+ EgressCtrl- DirectTrans- ACSCtl: SrcValid- TransBlk- ReqRedir- CmpltRedir- UpstreamFwd- EgressCtrl- DirectTrans-

func ParseACS

func ParseACS(s string) ACS

type AccessControlService

type AccessControlService struct {
	ACSCap ACS `json:"acs_cap"`

	// Access Control Service Control, useful to validate bare metal PCI config.
	// e.g.,
	// If this device sets SrcValid+ (SrcValid: true), then ACS is enabled:
	// "IO virtualization (also known as VT-d or IOMMU) can interfere with GPU Direct
	// by redirecting all PCI point-to-point traffic to the CPU root complex,
	// causing a significant performance reduction or even a hang.
	// If PCI switches have ACS enabled (on baremetal systems), it needs to be disabled."
	// ref. https://docs.nvidia.com/deeplearning/nccl/user-guide/docs/troubleshooting.html#pci-access-control-services-acs
	ACSCtl ACS `json:"acs_ctl"`
}

type Device

type Device struct {
	// ID of the PCI device.
	// e.g., "00:0e.0" in "00:0e.0 PCI ..."
	ID string `json:"id"`

	// Name that comes after the ID.
	// e.g., "3D controller" in "00:0e.0 3D controller"
	Name string `json:"name"`

	// Access control service.
	// e.g., Capabilities: [170 v1] Access Control Services
	AccessControlService *AccessControlService `json:"access_control_service,omitempty"`

	// Kernel driver in use.
	// e.g., Kernel driver in use: pcieport
	KernelDriverInUse string `json:"kernel_driver_in_use,omitempty"`

	// Kernel modules.
	// e.g., Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
	KernelModules []string `json:"kernel_modules,omitempty"`
}

type Devices

type Devices []Device

func List

func List(ctx context.Context, opts ...OpOption) (Devices, error)

Lists all PCI devices.

func (Devices) JSON

func (devs Devices) JSON() ([]byte, error)

func (Devices) YAML

func (devs Devices) YAML() ([]byte, error)

type Op

type Op struct {
	// contains filtered or unexported fields
}

type OpOption

type OpOption func(*Op)

func WithNameMatch

func WithNameMatch(fn func(string) bool) OpOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL