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

Collected GPM metrics are not returned to caller #121

Closed
elezar opened this issue May 16, 2024 · 0 comments · Fixed by #122
Closed

Collected GPM metrics are not returned to caller #121

elezar opened this issue May 16, 2024 · 0 comments · Fixed by #122
Assignees
Labels
bug Something isn't working

Comments

@elezar
Copy link
Member

elezar commented May 16, 2024

When calling GpmMetricsGet we convert the GpmMetricsGetType to an nvmlGpmMetricsGetType for the call to nvmlGpmMetricsGet.

On returning from nvmlGpmMetricsGet the contents of the nvmlGpmMetricsGetType.Metrics field corresponds to the collected metrics. These are never transferred into the GpmMetricsGetType passed as input.

This should be addressed by changing:

func (l *library) GpmMetricsGet(metricsGet *GpmMetricsGetType) Return {
	metricsGet.Version = GPM_METRICS_GET_VERSION
	return nvmlGpmMetricsGet(metricsGet.convert())
}

to something equivalent to:

func (l *library) GpmMetricsGet(metricsGet *GpmMetricsGetType) Return {
	metricsGet.Version = GPM_METRICS_GET_VERSION
	nvmlMetricsGet := metricsGet.convert()
	defer func() {
		for i := range nvmlMetricsGet.Metrics {
			metricsGet.Metrics[i] = nvmlMetricsGet.Metrics[i]
		}
	}()
	return nvmlGpmMetricsGet(nvmlMetricsGet)
}
@elezar elezar added the bug Something isn't working label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants