gpu

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IGPUKeywords = []string{
	"HD Graphics", "UHD Graphics", "Iris Graphics", "Iris Plus",
	"Iris Pro", "Iris Xe", "GMA",
}

核显产品名关键词(匹配到即视为核显)

Functions

This section is empty.

Types

type DeviceStat

type DeviceStat struct {
	Address     string  `json:"address"`
	Name        string  `json:"name"`
	Vendor      string  `json:"vendor"`
	MemoryUsed  uint64  `json:"memoryUsed"`
	MemoryTotal uint64  `json:"memoryTotal"`
	Utilization float64 `json:"utilization"`
	Temperature int     `json:"temperature"`
	PowerUsage  float64 `json:"powerUsage"`
	FanSpeed    int     `json:"fanSpeed"`
}

DeviceStat GPU 原始采集结果 Address 为规范化后的 PCI 地址,供上层决定是否生成稳定设备标识 Vendor 使用统一的小写厂商名:nvidia | amd | intel | apple 该结构只承载采集结果,不包含展示序号等业务字段

func GetGPUStats

func GetGPUStats(ctx context.Context) ([]*DeviceStat, error)

GetGPUStats 采集所有 GPU 原始统计信息 Linux/Windows:ghw 发现 → 按厂商分发采集(nvidia/amd/intel) macOS:通过 ioreg 采集 Apple GPU(ghw 不支持 macOS GPU 发现)

Jump to

Keyboard shortcuts

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