gpu: skip Microsoft Basic Render Driver metrics (#2363)

Co-authored-by: Elliot Nevills <elliotnev27@users.noreply.github.com>
This commit is contained in:
Jan-Otto Kröpke
2026-03-20 01:47:27 +01:00
committed by GitHub
parent 302043390e
commit d93821bf10

View File

@@ -121,7 +121,7 @@ func (c *Collector) Close() error {
return nil return nil
} }
func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error { func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
var err error var err error
c.gpuInfo = prometheus.NewDesc( c.gpuInfo = prometheus.NewDesc(
@@ -258,6 +258,12 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
continue continue
} }
// Skip Microsoft Basic Render Driver
// https://devicehunt.com/view/type/pci/vendor/1414/device/008C
if gpu.DeviceID == `PCI\VEN_1414&DEV_008C&SUBSYS_00000000&REV_00` {
continue
}
if c.gpuDeviceCache == nil { if c.gpuDeviceCache == nil {
c.gpuDeviceCache = make(map[string]gpuDevice) c.gpuDeviceCache = make(map[string]gpuDevice)
} }
@@ -292,6 +298,17 @@ func (c *Collector) Build(_ *slog.Logger, _ *mi.Session) error {
cfgmgr32: cfgmgr32Dev, cfgmgr32: cfgmgr32Dev,
ID: deviceID, ID: deviceID,
} }
logger.Debug("Found GPU device",
slog.String("collector", Name),
slog.String("name", gpu.AdapterString),
slog.String("luid", luidKey),
slog.String("device_id", deviceID),
slog.String("name", gpu.AdapterString),
slog.Uint64("bus_number", uint64(gpu.BusNumber)),
slog.Uint64("device_number", uint64(gpu.DeviceNumber)),
slog.Uint64("function_number", uint64(gpu.FunctionNumber)),
)
} }
return errors.Join(errs...) return errors.Join(errs...)