From 875019be496e36ec9ea674375732733279de52af Mon Sep 17 00:00:00 2001 From: "helinfan.hlf" Date: Fri, 27 Oct 2023 14:16:56 +0800 Subject: [PATCH] Fixed dcgm.WatchPidFields using wrong time unit Signed-off-by: helinfan.hlf --- pkg/dcgm/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/dcgm/api.go b/pkg/dcgm/api.go index 6cef868..e0d9e5c 100644 --- a/pkg/dcgm/api.go +++ b/pkg/dcgm/api.go @@ -4,6 +4,7 @@ import ( "fmt" "os" "sync" + "time" ) var ( @@ -89,7 +90,7 @@ func GetDeviceTopology(gpuId uint) ([]P2PLink, error) { // WatchPidFields lets DCGM start recording stats for GPU process // It needs to be called before calling GetProcessInfo func WatchPidFields() (GroupHandle, error) { - return watchPidFields(defaultUpdateFreq, defaultMaxKeepAge, defaultMaxKeepSamples) + return watchPidFields(time.Microsecond * time.Duration(defaultUpdateFreq), time.Second * time.Duration(defaultMaxKeepAge), defaultMaxKeepSamples) } // GetProcessInfo provides detailed per GPU stats for this process