Skip to content

Comments

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

Merged
SuperQ merged 2 commits intoprometheus:masterfrom
siavashs:drm
Jun 23, 2021
Merged

Parse /sys/class/drm/cardN/device/ stats#370
SuperQ merged 2 commits intoprometheus:masterfrom
siavashs:drm

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.

siavashs added 2 commits June 6, 2021 16:45
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