From ddf2c8bc8f2df250c72c72fb86d2440725be3a46 Mon Sep 17 00:00:00 2001 From: Eero Tamminen Date: Thu, 11 Aug 2022 16:11:50 +0300 Subject: [PATCH] More detailed log for number of found GPU devices / resource types Signed-off-by: Eero Tamminen --- cmd/gpu_plugin/gpu_plugin.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/gpu_plugin/gpu_plugin.go b/cmd/gpu_plugin/gpu_plugin.go index 9ecb9d003..0d5076424 100644 --- a/cmd/gpu_plugin/gpu_plugin.go +++ b/cmd/gpu_plugin/gpu_plugin.go @@ -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. @@ -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 }