Skip to content

Commit

Permalink
Merge pull request #1113 from eero-t/gpu-count-log
Browse files Browse the repository at this point in the history
More detailed log for number of found GPU devices / resource types
  • Loading branch information
mythi authored Aug 29, 2022
2 parents 418964a + ddf2c8b commit d826548
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/gpu_plugin/gpu_plugin.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2017-2021 Intel Corporation. All Rights Reserved.
// Copyright 2017-2022 Intel Corporation. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -240,9 +240,15 @@ func (dp *devicePlugin) Scan(notifier dpapi.Notifier) error {
klog.Warning("Failed to scan: ", err)
}

found := len(devTree)
found := 0
for _, resource := range devTree {
found += len(resource)
}

if found != previouslyFound {
klog.V(1).Info("GPU scan update: devices found: ", found)
klog.V(1).Infof("GPU scan update: %d device resources (with %dx sharing) of %d types found",
found, dp.options.sharedDevNum, len(devTree))

previouslyFound = found
}

Expand Down

0 comments on commit d826548

Please sign in to comment.