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

Parse /sys/class/drm/cardN/device/ stats #370

Merged
merged 2 commits into from
Jun 23, 2021
Merged

Parse /sys/class/drm/cardN/device/ stats #370

merged 2 commits into from
Jun 23, 2021

Conversation

siavashs
Copy link
Contributor

@siavashs siavashs commented Mar 14, 2021

This PR adds support for reading card stats exposed by drm.
Only amdgpu driver currently exposes these stats but it should be easy to add more driver support if required.
FreeBSD uses the same driver through kms-drm but it does not expose the attributes we are interested in through niether sysctl or linsysfs.

sysfs/class_drm.go Outdated Show resolved Hide resolved
sysfs/class_drm.go Outdated Show resolved Hide resolved
sysfs/class_drm.go Outdated Show resolved Hide resolved
This commits adds support for reading card stats exposed by drm.
Only `amdgpu` driver currently exposes these stats but it should be
easy to add more driver support if required.
FreeBSD uses the same driver through `kms-drm` but it does not expose
the attributes we are interested in through niether `sysctl` or `linsysfs`.

Signed-off-by: Siavash Safi <siavash.safi@gmail.com>
The fixtures are a snapshot from my Vega64 GPU, other cards might expose
more or less stats based on kernel documentation.
https://www.kernel.org/doc/html/latest/gpu/amdgpu.html

Signed-off-by: Siavash Safi <siavash.safi@gmail.com>
Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ
Copy link
Member

SuperQ commented Jun 23, 2021

Hopefully other GPU vendors also add similar stats.

@SuperQ SuperQ merged commit cc9b84f into prometheus:master Jun 23, 2021
@siavashs siavashs deleted the drm branch June 26, 2021 08:26
remijouannet pushed a commit to remijouannet/procfs that referenced this pull request Oct 20, 2022
Parse /sys/class/drm/cardN/device/ stats
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 this pull request may close these issues.

4 participants