master
go 21 lines 487 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 package intelgpu
4
5 import (
6 "fmt"
7 "os"
8 "path/filepath"
9
10 "github.com/netdata/netdata/go/plugins/pkg/executable"
11 )
12
13 func (c *Collector) initIntelGPUTopExec() (intelGpuTop, error) {
14 ndsudoPath := filepath.Join(executable.Directory, c.ndsudoName)
15 if _, err := os.Stat(ndsudoPath); err != nil {
16 return nil, fmt.Errorf("ndsudo executable not found: %v", err)
17
18 }
19
20 return newIntelGpuTopExec(c.Logger, ndsudoPath, c.UpdateEvery, c.Device)
21 }