[igt-dev] [PATCH i-g-t 00/17] Media scalability tooling

Tvrtko Ursulin
2018-10-18T15:28:24Z

A bunch of patches to trace.pl and gem_wsim which enable simulation and load
balancing analysis of the Virtual Engine work done separately by Chris Wilson.

Culmination is being able to simulate a so called frame split media workloads.

Example workload for this looks like this (annotated only for cover letter):

X.1.0 ; disable preemption on context 1
M.1.VCS1 ; configure engine map on context 1
B.1 ; turn on load balancing on context 1
X.2.0 ; \
M.2.VCS2 ; -> same as above but for context 2
B.2 ; /
b.2.1.VCS1 ; bond VCS2 in context 2 with VCS1
f ; create an unsignaled fence
1.DEFAULT.*.f-1.0 ; submit an infinite batch to ctx 1, with input fence
2.DEFAULT.4000-6000.s-1.0 ; submit a 4-6ms batch to ctx 2, with submit fence from the previous step
a.-3 ; advance the fence created 3 lines above
s.-2 ; wait for ctx 2 batch to complete
T.-4 ; terminate ctx 1 infinite batch
3.RCS.2000-4000.-5/-4.0 ; submit 2-4ms ctx 3 batch to RCS, with data dependencies
3.VECS.2000.-1.0 ; submit 2ms ctx 3 batch to VECS, data dependency on previous batch
4.BCS.1000.-1.0 ; submit 1ms ctx 4 batch to BCS, data dependency on previous batch
s.-2 ; wait for ctx 3 batch to complete
p.16667 ; start next iteration to hit 60fps simulation

And can be run for instance like this:

./gem_wsim -n <calibration> -w wsim/frame_split_60fps.wsim -r 60 -c 3

This runs three clients of the same workload, 60 iterations each.

This can then also be captured with trace.pl and a HTML representation of the
execution timeline analysed:

../scripts/trace.pl --trace ./gem_wsim ...
perf script | ../scripts/trace.pl -s -c --gpu-timeline --html >timeline.html

[Vis npm module is required to be present in the same directory as the HTML ]
[file, see trace.pl --help for instructions. ]

Tvrtko Ursulin (17):
lib: Update uapi headers
trace.pl: Virtual engine support
trace.pl: Virtual engine preemption support
wsim/media-bench: i915 balancing
gem_wsim: Use IGT uapi headers
gem_wsim: Fix shadowed local
gem_wsim: Factor out common error handling
gem_wsim: More wsim_err
gem_wsim: Submit fence support
gem_wsim: Extract str to engine lookup
gem_wsim: Engine map support
gem_wsim: Save some lines by changing to implicit NULL checking
gem_wsim: Compact int command parsing with a macro
gem_wsim: Engine map load balance command
gem_wsim: Engine bond command
gem_wsim: Some more example workloads
gem_wsim: Infinite batch support

benchmarks/gem_wsim.c | 1060 +++++++++++++------
benchmarks/wsim/README | 111 +-
benchmarks/wsim/frame-split-60fps.wsim | 18 +
benchmarks/wsim/high-composited-game.wsim | 11 +
benchmarks/wsim/media-1080p-player.wsim | 5 +
benchmarks/wsim/medium-composited-game.wsim | 9 +
include/drm-uapi/amdgpu_drm.h | 52 +-
include/drm-uapi/drm.h | 16 +
include/drm-uapi/drm_fourcc.h | 224 ++++
include/drm-uapi/drm_mode.h | 26 +-
include/drm-uapi/etnaviv_drm.h | 6 +
include/drm-uapi/exynos_drm.h | 240 +++++
include/drm-uapi/i915_drm.h | 239 ++++-
include/drm-uapi/msm_drm.h | 2 +
include/drm-uapi/sync_file.h | 98 --
include/drm-uapi/tegra_drm.h | 492 ++++++++-
include/drm-uapi/v3d_drm.h | 194 ++++
include/drm-uapi/vc4_drm.h | 13 +-
include/drm-uapi/virtgpu_drm.h | 1 +
include/drm-uapi/vmwgfx_drm.h | 166 ++-
scripts/media-bench.pl | 9 +-
scripts/trace.pl | 244 ++++-
22 files changed, 2705 insertions(+), 531 deletions(-)
create mode 100644 benchmarks/wsim/frame-split-60fps.wsim
create mode 100644 benchmarks/wsim/high-composited-game.wsim
create mode 100644 benchmarks/wsim/media-1080p-player.wsim
create mode 100644 benchmarks/wsim/medium-composited-game.wsim
delete mode 100644 include/drm-uapi/sync_file.h
create mode 100644 include/drm-uapi/v3d_drm.h