diff --git a/pkg/gpu/consumer.go b/pkg/gpu/consumer.go index 5cd65a1569e74..fa259cd75f0fe 100644 --- a/pkg/gpu/consumer.go +++ b/pkg/gpu/consumer.go @@ -51,7 +51,6 @@ func (c *cudaEventConsumer) Stop() { if c == nil { return } - c.eventHandler.Stop() c.once.Do(func() { close(c.closed) }) diff --git a/pkg/gpu/probe.go b/pkg/gpu/probe.go index 93d0c5ead5357..b063b0d0a7190 100644 --- a/pkg/gpu/probe.go +++ b/pkg/gpu/probe.go @@ -163,19 +163,11 @@ func (p *Probe) start() error { // Close stops the probe func (p *Probe) Close() { - if p.procMon != nil { - p.procMon.Stop() - } - - if p.attacher != nil { - p.attacher.Stop() - } - + p.procMon.Stop() + p.attacher.Stop() _ = p.m.Stop(manager.CleanAll) - - if p.consumer != nil { - p.consumer.Stop() - } + p.consumer.Stop() + p.eventHandler.Stop() } // GetAndFlush returns the GPU stats