-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow watch pid with pre-created group. #60
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Huamin Chen <[email protected]>
Thank you for your contribution. The reason sample test is failing because the Please share output with a successful run on a MIG device and suggested changes. |
for _, gpu := range pidInfo { | ||
log.Printf("gpu %d, process info: %+v\n", gpu.GPU, gpu) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using template for output same as samples/processInfo/main.go
for consistency.
// create a tick to watch the process every 5 seconds | ||
ticker := time.NewTicker(5 * time.Second) | ||
defer ticker.Stop() | ||
for range ticker.C { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider running it once or twice but not every 5 seconds.
if err != nil { | ||
return fmt.Errorf("failed to find supported devices: %v", err) | ||
} | ||
log.Printf("found %d supported devices\n", len(supportedDeviceIndices)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
s/found/Found
as it is not an error.
Fix #59
The existing
WatchPidFieldsEx
API always creates device group. If the MIG is enabled, the device group doesn't capture the MIG device and may fail to watch processes there.The PR allows a pre-created device to pass into the
WatchPidFieldsWithGroup
API.I am also adding a sample test file here, but for certain reason I am not able to run it successfully:
In fact, the existing sample also failed with the same error: