diff --git a/agent/gpu_intel.go b/agent/gpu_intel.go index 31c982c3..2d5f9370 100644 --- a/agent/gpu_intel.go +++ b/agent/gpu_intel.go @@ -134,7 +134,9 @@ func (gm *GPUManager) parseIntelHeaders(header1 string, header2 string) (engineN powerIndex = -1 // Initialize to -1, will be set to actual index if found // Collect engine names from header1 for _, col := range h1 { - key := strings.TrimRightFunc(col, func(r rune) bool { return r >= '0' && r <= '9' }) + key := strings.TrimRightFunc(col, func(r rune) bool { + return (r >= '0' && r <= '9') || r == '/' + }) var friendly string switch key { case "RCS": diff --git a/agent/gpu_test.go b/agent/gpu_test.go index 748037b7..7361e945 100644 --- a/agent/gpu_test.go +++ b/agent/gpu_test.go @@ -1439,6 +1439,15 @@ func TestParseIntelHeaders(t *testing.T) { wantPowerIndex: 4, // "gpu" is at index 4 wantPreEngineCols: 8, // 17 total cols - 3*3 = 8 }, + { + name: "basic headers with RCS BCS VCS using index in name", + header1: "Freq MHz IRQ RC6 Power W IMC MiB/s RCS/0 BCS/1 VCS/2", + header2: " req act /s % gpu pkg rd wr % se wa % se wa % se wa", + wantEngineNames: []string{"RCS", "BCS", "VCS"}, + wantFriendlyNames: []string{"Render/3D", "Blitter", "Video"}, + wantPowerIndex: 4, // "gpu" is at index 4 + wantPreEngineCols: 8, // 17 total cols - 3*3 = 8 + }, { name: "headers with only RCS", header1: "Freq MHz IRQ RC6 Power W IMC MiB/s RCS",