Skip to content

Vendor agnostic gputop

Tvrtko Ursulin igt-dev intel-gfx 4 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest8 patches 0 repliesNew
  2. v48 patches 1 replySuperseded
  3. v38 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v18 patches3 repliesSuperseded

Changes in v5 from the cover letter

* A larger rebase this time round, catching up with some improvements which landed to intel_gpu_top in the meantime.

Patches in v5 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+648 -4840 replies
2/8lib: Allow specifying custom engine maplib/igt_drm_clients.c lib/igt_drm_clients.h lib/igt_drm_fdinfo.c +3 more+90 -320 replies
3/8lib/igt_drm_clients: Record client drm minorlib/igt_drm_clients.c lib/igt_drm_clients.h+15 -80 replies
4/8lib/igt_drm_clients: Support multiple DRM cardslib/igt_drm_clients.c+8 -60 replies
5/8lib/igt_drm_fdinfo: Track largest engine indexlib/igt_drm_fdinfo.c lib/igt_drm_fdinfo.h+3 -00 replies
6/8lib/igt_drm_clients: Decouple hardcoded engine assumptionslib/igt_drm_clients.c lib/igt_drm_clients.h tools/intel_gpu_top.c+134 -450 replies
7/8lib/igt_drm_clients: Enforce client status sort order in the librarylib/igt_drm_clients.c lib/igt_drm_clients.h tools/intel_gpu_top.c+65 -550 replies
8/8gputop: Basic vendor agnostic GPU top tooltools/gputop.c tools/meson.build+271 -00 replies

Reviews trailers per patch

1 of 8 patches has a Reviewed-by or Acked-by.

PatchChristian KönigRob Clark
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8A-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [igt-dev] [PATCH i-g-t v5 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.

Last patch is the actual tool itself. It works but it is rather rudimentary which is hopefully good enough for a start.

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 it works fine. Christian König tested it with in progress patches for amdgpu and that worked as well.

v2:
* Fixed SPDX headers and added a bunch of code comments/docs throughout.

v3:
* Rebased and some patch titles renamed as requested. (Kamil)

v4:
* Just a rebase for conflicts due passage of time.

v5:
* A larger rebase this time round, catching up with some improvements which landed to intel_gpu_top in the meantime.

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

 lib/igt_drm_clients.c   | 542 ++++++++++++++++++++++++++++++
 lib/igt_drm_clients.h   |  91 +++++
 lib/igt_drm_fdinfo.c    |  53 ++-
 lib/igt_drm_fdinfo.h    |  16 +-
 lib/meson.build         |   8 +
 tests/i915/drm_fdinfo.c |  19 +-
 tools/gputop.c          | 266 +++++++++++++++
 tools/intel_gpu_top.c   | 718 +++++++++++-----------------------------
 tools/meson.build       |   7 +-
 9 files changed, 1162 insertions(+), 558 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.37.2