Skip to content

Vendor agnostic gputop

Tvrtko Ursulin igt-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8lib: Extract igt_drm_clients from intel_gpu_toplib/igt_drm_clients.c lib/igt_drm_clients.h lib/meson.build +2 more+573 -4493 replies
2/8libdrmfdinfo: Allow specifying custom engine maplib/igt_drm_clients.c lib/igt_drm_clients.h lib/igt_drm_fdinfo.c +3 more+75 -290 replies
3/8libdrmclients: Record client drm minorlib/igt_drm_clients.c lib/igt_drm_clients.h+15 -80 replies
4/8libdrmclient: Support multiple DRM cardslib/igt_drm_clients.c lib/igt_drm_clients.h+9 -70 replies
5/8libdrmfdinfo: Track largest engine indexlib/igt_drm_fdinfo.c lib/igt_drm_fdinfo.h+3 -00 replies
6/8libdrmclient/intel_gpu_top: Decouple hardcoded engine assumptionslib/igt_drm_clients.c lib/igt_drm_clients.h tools/intel_gpu_top.c+117 -400 replies
7/8libdrmclient: Enforce client status sort order in the librarylib/igt_drm_clients.c lib/igt_drm_clients.h tools/intel_gpu_top.c+58 -500 replies
8/8gputop: Basic vendor agnostic GPU top tooltools/gputop.c tools/meson.build+281 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [igt-dev] [PATCH i-g-t 0/8] Vendor agnostic gputop

From: Tvrtko Ursulin <[email protected]>

This is a pile of patches which implements a rudimentary vendor agnostic gputop tool based of the new DRM spec as documented in Documentation/gpu/drm-usage-stats.rst.

First part of the series is code refactoring which should be reasonably stable, I've tested it all while working on it both against intel_gpu_top and gputop, albeit probably needs more and better comments.

The actual tools itself (last patch) works but I think not quite nice enough to be user facing. Ideally someone gets intrigued enough to improve it? Although it is only IGT so maybe it is good enough for a start? Not sure. To start with it depends on more drivers adopting the spec.

Fundamental difference between intel_gpu_top and gputop is that the former is centered around a single card and only shows processes belonging to it. Gputop on the other hand has an idea to show all processes with DRM file descriptors open and sort them into groups per card. It also makes no effort to provide sorting modes, well any interactivity, or any pretty names for GPUs or engines.

It looks like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DRM minor 0

    PID               NAME    render       copy       video
    3816          kwin_x11 |███▎      ||          ||          ||          |
    3523              Xorg |▊         ||          ||          ||          |
 1120449               mpv |          ||          ||▋         ||          |
 1120529          glxgears |▋         ||          ||          ||          |
 1120449               mpv |▍         ||          ||          ||          |
    3860       plasmashell |▏         ||          ||          ||          |
    4764           krunner |          ||          ||          ||          |
  575206            chrome |          ||          ||          ||          |
  833481           firefox |          ||          ||          ||          |
  892924       thunderbird |          ||          ||          ||          |

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I did test it as well with two cards and confirmed that too works.

Rob Clark also tested it with a patch which exports the respective data from the msm driver and confirmed that too works.

Tvrtko Ursulin (8):
lib: Extract igt_drm_clients from intel_gpu_top
libdrmfdinfo: Allow specifying custom engine map
libdrmclients: Record client drm minor
libdrmclient: Support multiple DRM cards
libdrmfdinfo: Track largest engine index libdrmclient/intel_gpu_top: Decouple hardcoded engine assumptions
libdrmclient: Enforce client status sort order in the library
gputop: Basic vendor agnostic GPU top tool

 lib/igt_drm_clients.c   | 451 +++++++++++++++++++++++++++
 lib/igt_drm_clients.h   |  97 ++++++
 lib/igt_drm_fdinfo.c    |  50 ++-
 lib/igt_drm_fdinfo.h    |  16 +-
 lib/meson.build         |   8 +
 tests/i915/drm_fdinfo.c |  18 +-
 tools/gputop.c          | 276 +++++++++++++++++
 tools/intel_gpu_top.c   | 663 ++++++++++------------------------------
 tools/meson.build       |   7 +-
 9 files changed, 1067 insertions(+), 519 deletions(-)
 create mode 100644 lib/igt_drm_clients.c
 create mode 100644 lib/igt_drm_clients.h
 create mode 100644 tools/gputop.c
Signature · 1 line
2.32.0