Help us shape the future of Go! Take the 2026 Go Developer Survey

gpu

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2026 License: Apache-2.0 Imports: 14 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphicsCard

type GraphicsCard struct {
	// the PCI address where the graphics card can be found
	Address string `json:"address"`
	// The "index" of the card on the bus (generally not useful information,
	// but might as well include it)
	Index int `json:"index"`
	// pointer to a PCIDevice struct that describes the vendor and product
	// model, etc
	// TODO(jaypipes): Rename this field to PCI, instead of DeviceInfo
	DeviceInfo *pci.Device `json:"pci"`
	// Topology node that the graphics card is affined to. Will be nil if the
	// architecture is not NUMA.
	Node *topology.Node `json:"node,omitempty"`
}

func (*GraphicsCard) String

func (card *GraphicsCard) String() string

type Info

type Info struct {
	GraphicsCards []*GraphicsCard `json:"cards"`
}

func New

func New(args ...any) (*Info, error)

New returns a pointer to an Info struct that contains information about the graphics cards on the host system

func (*Info) JSONString

func (i *Info) JSONString(indent bool) string

JSONString returns a string with the gpu information formatted as JSON under a top-level "gpu:" key

func (*Info) String

func (i *Info) String() string

func (*Info) YAMLString

func (i *Info) YAMLString() string

YAMLString returns a string with the gpu information formatted as YAML under a top-level "gpu:" key

Jump to

Keyboard shortcuts

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