Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gjulianm committed Jan 8, 2025
1 parent 47fac74 commit d667588
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion comp/core/workloadmeta/collectors/internal/nvml/nvml.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func GetFxOptions() fx.Option {
return fx.Provide(NewCollector)
}

// Start initializes the NVML library and sets the store
func (c *collector) Start(_ context.Context, store workloadmeta.Component) error {
if !env.IsFeaturePresent(env.NVML) {
return errors.NewDisabled(componentName, "Agent does not have NVML library available")
Expand All @@ -64,7 +65,8 @@ func (c *collector) Start(_ context.Context, store workloadmeta.Component) error
return nil
}

func (c *collector) Pull(ctx context.Context) error {
// Pull collects the GPUs available on the node and notifies the store
func (c *collector) Pull(_ context.Context) error {
count, ret := c.nvmlLib.DeviceGetCount()
if ret != nvml.SUCCESS {
return fmt.Errorf("failed to get device count: %v", nvml.ErrorString(ret))
Expand Down
1 change: 1 addition & 0 deletions pkg/gpu/testutil/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var GPUCores = []int{DefaultGpuCores, 20, 30, 40, 50, 60, 70}
// DefaultGpuUUID is the UUID for the default device returned by the mock
var DefaultGpuUUID = GPUUUIDs[0]

// DefaultGPUName is the name for the default device returned by the mock
var DefaultGPUName = "Tesla T4"

// GetDeviceMock returns a mock of the nvml.Device with the given UUID.
Expand Down

0 comments on commit d667588

Please sign in to comment.