Skip to content
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

provide more flexible WatchPidFields API #59

Open
rootfs opened this issue Feb 16, 2024 · 2 comments · May be fixed by #60
Open

provide more flexible WatchPidFields API #59

rootfs opened this issue Feb 16, 2024 · 2 comments · May be fixed by #60

Comments

@rootfs
Copy link

rootfs commented Feb 16, 2024

I am using go-dcgm to estimate power consumption of processes running in MIG device. The current pid watch function watchPidFields doesn't track the MIG devices.

Would it be possible to create yet another API to pass group.handle directly? So caller can create device groups that consist MIG and call the dcgm API to watch pid.

A hypothetical prototype is like the following:

func WatchPidFieldsWithGroup(updateFreq, maxKeepAge time.Duration, maxKeepSamples int, groupId GroupHandle) error {
	result := C.dcgmWatchPidFields(handle.handle, groupId.handle, C.longlong(updateFreq.Microseconds()), C.double(maxKeepAge.Seconds()), C.int(maxKeepSamples))
	if err := errorString(result); err != nil {
		return &DcgmError{msg: C.GoString(C.errorString(result)), Code: result}
	}
	_ = UpdateAllFields()
	return nil
}
@nvvfedorov
Copy link
Collaborator

@rootfs , Thank you for submitting the issue. We accept PRs if you have a good solution.

@rootfs
Copy link
Author

rootfs commented Feb 16, 2024

@nvvfedorov that sounds good, i'll test it locally and if this works, i'll submit a PR, thanks

@rootfs rootfs linked a pull request Feb 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants