tests/gem_watchdog: Initial set of tests for GPU watchdog
RFC v4 1/1 tests/gem_watchdog: Initial set of tests for GPU watchdog
This test adds basic set of tests to reset the different GPU engines through the gpu watchdog timer.
Credits to Antonio for the original codebase this is based on.
v2: remove gem_context_get_param() during set (Antonio)
remove clearing of the engines_threshold[] in the default case inside context_set_watchdog(). (Antonio)
fix indexing when creating low/high priority contexts
get rid of 2 threads idea (Antonio)
fix context prio bug due to wrong indexing (Antonio)
v3: no need to force clear drm_i915_gem_watchdog_timeout struct
when setting the watchdog timeouts (Antonio)
-use gem_context_set_priority() instead to use error checking -always use a looper to test all engines (Antonio)
-modify test gpu_watchodg_hang_long_batch_single_engine()
to use a couple of batches and set the timeout in between them (Antonio) -make use of for_each_engine_class_instance() (Antonio)
v4: -tests should be able to handle s/w watchdog timeout (Tvrtko)
-remove dead code inside batch_buffer factory (Tvrtko) -set_watchdog() should return ENODEV for fail cases (Tvrtko) -enclose name, priority and reset params inside array (Tvrtko)
Test Plan:
Assumptions:
1. Use fence status to figure out which ctx was reset
2. Use spin batches w/ user space timers to control duration and corking to control ordering
3. Use context priorities to force preemption
Tests:
1. ctx1, long_batch -> execute
2. ctx1, set_watchdog -> reset
3. ctx2/ctx1 -> execute, reset
4. ctx1/ctx2 -> reset, execute
5. ctx1_just_below_threshold -> execute
6. ctx_over_the_threshold -> reset
7. set watchdog on some engines -> execute
8. submit long_batch and after half of the
expected runtime submit higher prio batch
9. submit low prio batch w/o watchdog then
higher prio with watchdog
Unsresolved items:
1. the uAPI array of structs...
2. The check for sync_fence_status(*fence)
returns -1 instead of EIO.
3. Tests 5,6 and 8 above are tbd
--- tests/Makefile.sources | 3 + tests/i915/gem_watchdog.c | 461 ++++++++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 1 + 3 files changed, 465 insertions(+) create mode 100644 tests/i915/gem_watchdog.c
tests/Makefile.sources +3 -0
@@ -444,6 +444,9 @@ gem_userptr_blits_SOURCES = i915/gem_userptr_blits.c TESTS_progs += gem_wait gem_wait_SOURCES = i915/gem_wait.c +TESTS_progs += gem_watchdog +gem_watchdog_SOURCES = i915/gem_watchdog.c + TESTS_progs += gem_workarounds gem_workarounds_SOURCES = i915/gem_workarounds.c
tests/i915/gem_watchdog.c new file +461 -0
461 lines not on this page · raw message
tests/meson.build +1 -0
@@ -210,6 +210,7 @@ i915_progs = [ 'gem_unref_active_buffers', 'gem_userptr_blits', 'gem_wait', + 'gem_watchdog', 'gem_workarounds', 'gem_write_read_ring_switch', 'i915_fb_tiling',
Signature · 6 lines
2.7.4 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: failure for tests/gem_watchdog: Initial set of tests for GPU watchdog (rev6)
== Series Details ==
== Series Details ==
Series: tests/gem_watchdog: Initial set of tests for GPU watchdog (rev6)
URL : https://patchwork.freedesktop.org/series/50041/
State : failure
== Summary ==
IGT patchset build failed on latest successful build ab54de9937678583437eee4546bc25a9885b87a6 lib/igt_audio: fix filemode not specified in open(O_CREAT)
ccache cc -Itests/tests@@gem_watchdog@exe -Itests -I../tests -I../include/drm-uapi -Ilib -I../lib -I../lib/stubs/syscalls -I. -I../ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/opt/igt/include -I/opt/igt/include/libdrm -I/usr/include/x86_64-linux-gnu -I/usr/include/alsa -I/usr/include -I/usr/include/libdrm -I/usr/include/libdrm/nouveau -I/home/cidrm/kernel_headers/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -D_GNU_SOURCE -include config.h -Wbad-function-cast -Wdeclaration-after-statement -Wformat=2 -Wimplicit-fallthrough=0 -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wuninitialized -Wunused -Wno-clobbered -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-pointer-arith -Wno-sign-compare -Wno-type-limits -Wno-unused-parameter -Wno-unused-result -Werror=address -Werror=array-bounds -Werror=implicit -Werror=init-self -Werror=int-to-pointer-cast -Werror=main -Werror=missing-braces -Werror=nonnull -Werror=pointer-to-int-cast -Werror=return-type -Werror=sequence-point -Werror=trigraphs -Werror=write-strings -pthread -MD -MQ 'tests/tests@@gem_watchdog@exe/i915_gem_watchdog.c.o' -MF 'tests/tests@@gem_watchdog@exe/i915_gem_watchdog.c.o.d' -o 'tests/tests@@gem_watchdog@exe/i915_gem_watchdog.c.o' -c ../tests/i915/gem_watchdog.c ../tests/i915/gem_watchdog.c: In function ‘batch_buffer_factory’:../tests/i915/gem_watchdog.c:181:12: error: implicit declaration of function ‘igt_spin_batch_new’; did you mean ‘igt_spin_new’? [-Werror=implicit-function-declaration]
spin = igt_spin_batch_new(fd, .dependency = obj[0].handle);
^~~~~~~~~~~~~~~~~~
igt_spin_new
../tests/i915/gem_watchdog.c:181:12: warning: nested extern declaration of ‘igt_spin_batch_new’ [-Wnested-externs]
../tests/i915/gem_watchdog.c:181:35: error: expected expression before ‘.’ token
spin = igt_spin_batch_new(fd, .dependency = obj[0].handle);
^
../tests/i915/gem_watchdog.c:182:5: error: implicit declaration of function ‘igt_spin_batch_set_timeout’; did you mean ‘igt_spin_set_timeout’? [-Werror=implicit-function-declaration]
igt_spin_batch_set_timeout(spin, timeout);
^~~~~~~~~~~~~~~~~~~~~~~~~~
igt_spin_set_timeout
../tests/i915/gem_watchdog.c:182:5: warning: nested extern declaration of ‘igt_spin_batch_set_timeout’ [-Wnested-externs]
../tests/i915/gem_watchdog.c:186:5: error: implicit declaration of function ‘igt_spin_batch_free’; did you mean ‘igt_spin_free’? [-Werror=implicit-function-declaration]
igt_spin_batch_free(fd, spin);
^~~~~~~~~~~~~~~~~~~
igt_spin_free../tests/i915/gem_watchdog.c:186:5: warning: nested extern declaration of ‘igt_spin_batch_free’ [-Wnested-externs] ../tests/i915/gem_watchdog.c: In function ‘__real_main407’:../tests/i915/gem_watchdog.c:418:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx1-execute-ctx2-execute-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:420:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx1-reset-ctx2-execute-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:422:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx2-reset-ctx1-execute-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:424:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx2-reset-ctx1-reset-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:426:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx1-high-prio-execute-ctx2-low-prio-execute-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:428:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx1-high-prio-reset-ctx2-low-prio-execute-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:430:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx1-low-prio-reset-ctx2-high-prio-execute-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:432:4: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
{"ctx1-low-prio-reset-ctx2-high-prio-reset-all-engines",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tests/i915/gem_watchdog.c:412:40: warning: unused variable ‘e’ [-Wunused-variable]
const struct intel_execution_engine2 *e;
^cc1: some warnings being treated as errors
ninja: build stopped: subcommand failed.
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev