Documentation
¶
Overview ¶
Package intel_gpu_top generates utilization statistics for an Intel GPU, using the 'intel-gpu-top' command. Currently, we support V1.17 and V1.18.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadGPUStats ¶
ReadGPUStats decodes the output of "intel-gpu-top -J" and iterates through the GPUStats records.
Works with intel-gpu-top v1.17. If you want to use v1.18 (which uses a different layout), see V118toV117. This middleware converts the output back to v1.17 layout, so it can be processed by ReadGPUStats
Types ¶
type ClientStats ¶
type ClientStats struct { EngineClasses map[string]struct { Busy string `json:"busy"` Unit string `json:"unit"` } `json:"engine-classes"` Name string `json:"name"` Pid string `json:"pid"` }
ClientStats contains statistics for one client, currently using the GPU.
type EngineStats ¶
type EngineStats struct { Unit string `json:"unit"` Busy float64 `json:"busy"` Sema float64 `json:"sema"` Wait float64 `json:"wait"` }
EngineStats contains the utilization of one GPU engine.
type GPUStats ¶
type GPUStats struct { Engines map[string]EngineStats `json:"engines"` Clients map[string]ClientStats `json:"clients"` Period struct { Unit string `json:"unit"` Duration float64 `json:"duration"` } `json:"period"` Interrupts struct { Unit string `json:"unit"` Count float64 `json:"count"` } `json:"interrupts"` Rc6 struct { Unit string `json:"unit"` Value float64 `json:"value"` } `json:"rc6"` Frequency struct { Unit string `json:"unit"` Requested float64 `json:"requested"` Actual float64 `json:"actual"` } `json:"frequency"` Power struct { Unit string `json:"unit"` GPU float64 `json:"GPU"` Package float64 `json:"Package"` } `json:"power"` ImcBandwidth struct { Unit string `json:"unit"` Reads float64 `json:"reads"` Writes float64 `json:"writes"` } `json:"imc-bandwidth"` }
GPUStats contains GPU utilization, as presented by intel-gpu-top
type V118toV117 ¶
V118toV117 converts the input from v1.18 of intel_gpu_top to v1.17 syntax. Specifically:
- V1.18 generates the stats as a json array ("[" and "]").
- V1.18 *sometimes* (?) writes commas between the stats.
This means json.Decoder will try to read in the full array, where we want to stream the individual records. V118toV117 solves this by removed the array & comma tokens, turning the data back to V1.17 layout.