Skip to contentSkip to conversation

Craft a list of tests to run in simulation (and tune them)

PATCH In review Damien Lespiau 4 participants 14 messages Mar 26, 2013 – Apr 2, 2013 Library code

lore
Share & tools
lore
#0 lore raw

For early bring-up, it's useful to have a list of tests to check everything is in order. The Makefile file is a great place to keep such a list.

The IGT_SIMULATION environment variable controls the list of tests to run (either with make test/check or with piglit) and allows us to tune the various tests we execute to run in an acceptable amount of time in simulation.

#1 lore raw

PATCH 1/5 README: Reword a few sentences

To be a bit more correct (they were understandable though).

---
 README | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
README +4 -4
index be29177..c484a93 100644
@@ -27,17 +27,17 @@ tests/
 	Run this tests with "make test" as root from this directory. Note that
 	no other drm clients (X server) may run.
 
-	"make test" only runs a default of test usefull for regression testing.
-	Other tests not run are:
+	"make test" only runs a default set of tests and is useful for
+	regression testing. Other tests not run are:
 	- tests that might hang the gpu, see HANG in Makefile.am
 	- gem_stress, a stress test suite. Look at the source for all the
 	  various options.
 	- testdisplay is only run in the default mode. testdisplay has tons of
-	  options to test different kms functionality, again read the source of
+	  options to test different kms functionality, again read the source for
 	  the details.
 
 	The more comfortable way to run tests is with piglit. First grab piglit
-	from
+	from:
 
 	git://anongit.freedesktop.org/piglit
 
Signature · 1 line
1.7.11.7
#2 lore raw

PATCH 2/5 lib: Rename IGT_QUICK to IGT_SIMULATION

In reply to Damien Lespiau

It's more accurate this way as the quick mode is really useful for in the simulation environment.

---
 lib/drmtest.c | 10 +++++-----
 lib/drmtest.h |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)
lib/drmtest.c +5 -5
index a60a3a6..6e272d7 100644
@@ -587,14 +587,14 @@ static bool env_set(const char *env_var)
 	return atoi(val) != 0;
 }
 
-bool drmtest_run_quick(void)
+bool drmtest_run_in_simulation(void)
 {
-	static int run_quick = -1;
+	static int simulation = -1;
 
-	if (run_quick == -1)
-		run_quick = env_set("IGT_QUICK");
+	if (simulation == -1)
+		simulation = env_set("IGT_SIMULATION");
 
-	return run_quick;
+	return simulation;
 }
 
 /* other helpers */
lib/drmtest.h +2 -2
index 78732a0..07f971c 100644
@@ -88,8 +88,8 @@ void drmtest_subtest_init(int argc, char **argv);
 bool drmtest_run_subtest(const char *subtest_name);
 bool drmtest_only_list_subtests(void);
 
-bool drmtest_run_quick(void);
-#define SLOW_QUICK(slow,quick) (drmtest_run_quick() ? (quick) : (slow))
+bool drmtest_run_in_simulation(void);
+#define SLOW_QUICK(slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow))
 
 /* helpers based upon the libdrm buffer manager */
 void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr);
Signature · 1 line
1.7.11.7
#3 lore raw

PATCH 3/5 tests: Use IGT_SIMULATION to tune the list of tests to run

In reply to Damien Lespiau

There are two ways to run tests, directly with make check/test or through piglit.

When IGT_SIMULATION is set to '1', we substitute the list of tests in those two code paths with carefully selected tests. The stress tests and other horrors are left to torture the real hardware as they don't make too much sense in simulation.

---
 tests/Makefile.am | 43 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)
tests/Makefile.am +40 -3
index 2fddfe8..33db962 100644
@@ -137,22 +137,59 @@ kernel_tests = \
 	$(multi_kernel_tests) \
 	$(NULL)
 
+# We maintain here a list of tests to run in our simulation environments
+single_simulation_tests = \
+	gem_mmap \
+	gem_pread_after_blit \
+	gem_ring_sync_loop \
+	gem_ctx_basic \
+	gem_pipe_control_store_loop \
+	gem_storedw_loop_render \
+	gem_storedw_loop_blt \
+	gem_storedw_loop_bsd \
+	gem_render_linear_blits \
+	gem_tiled_blits \
+	gem_cpu_reloc \
+	$(NULL)
+
+multi_simulation_tests = \
+	gem_exec_nop \
+	gem_mmap_gtt \
+	$(NULL)
+
+simulation_tests = \
+	$(single_simulation_tests) \
+	$(multi_simulation_tests) \
+	$(NULL)
+
 TESTS = \
 	$(NULL)
 
 test:
 	@whoami | grep root || ( echo ERROR: not running as root; exit 1 )
 	@./check_drm_clients
-	@make TESTS="${kernel_tests}" check
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		make TESTS="${simulation_tests}" check; \
+	else \
+		make TESTS="${kernel_tests}" check; \
+	fi
 
 list-single-tests:
 	@echo TESTLIST
-	@echo ${single_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${single_simulation_tests}; \
+	else \
+		echo ${single_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 list-multi-tests:
 	@echo TESTLIST
-	@echo ${multi_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${multi_simulation_tests}; \
+	else \
+		echo ${multi_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 HANG = \
Signature · 1 line
1.7.11.7
#4 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Quoted 9 lines · Damien Lespiau

There are two ways to run tests, directly with make check/test or through piglit.

When IGT_SIMULATION is set to '1', we substitute the list of tests in those two code paths with carefully selected tests. The stress tests and other horrors are left to torture the real hardware as they don't make too much sense in simulation.

This feels a bit fragile since even just now I often fail to put a test newly converted to the subtest stuff into the right single/multi make target list. Also, this way we exclude a test by default, which also feels like the wrong way round (most of the tests we're adding aren't heavy stress-tests, but more excercise some corner-case).

So what about a sprinkling

drmtest_skip_on_simulation();

over the remaining testcases instead, which just calls exit(77);? Only caveat is that for subtests we need to put it into the right spot to not break subtest enumeration in piglit (it's a bit fragile).

Cheers, Daniel

Quoted 78 lines
---
 tests/Makefile.am | 43 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)
tests/Makefile.am +40 -3
index 2fddfe8..33db962 100644
@@ -137,22 +137,59 @@ kernel_tests = \
 	$(multi_kernel_tests) \
 	$(NULL)
 
+# We maintain here a list of tests to run in our simulation environments
+single_simulation_tests = \
+	gem_mmap \
+	gem_pread_after_blit \
+	gem_ring_sync_loop \
+	gem_ctx_basic \
+	gem_pipe_control_store_loop \
+	gem_storedw_loop_render \
+	gem_storedw_loop_blt \
+	gem_storedw_loop_bsd \
+	gem_render_linear_blits \
+	gem_tiled_blits \
+	gem_cpu_reloc \
+	$(NULL)
+
+multi_simulation_tests = \
+	gem_exec_nop \
+	gem_mmap_gtt \
+	$(NULL)
+
+simulation_tests = \
+	$(single_simulation_tests) \
+	$(multi_simulation_tests) \
+	$(NULL)
+
 TESTS = \
 	$(NULL)
 
 test:
 	@whoami | grep root || ( echo ERROR: not running as root; exit 1 )
 	@./check_drm_clients
-	@make TESTS="${kernel_tests}" check
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		make TESTS="${simulation_tests}" check; \
+	else \
+		make TESTS="${kernel_tests}" check; \
+	fi
 
 list-single-tests:
 	@echo TESTLIST
-	@echo ${single_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${single_simulation_tests}; \
+	else \
+		echo ${single_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 list-multi-tests:
 	@echo TESTLIST
-	@echo ${multi_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${multi_simulation_tests}; \
+	else \
+		echo ${multi_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 HANG = \
Signature · 6 lines
1.7.11.7

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Quoted 19 lines · Daniel Vetter
Quoted 9 lines · Damien Lespiau

There are two ways to run tests, directly with make check/test or through piglit.

When IGT_SIMULATION is set to '1', we substitute the list of tests in those two code paths with carefully selected tests. The stress tests and other horrors are left to torture the real hardware as they don't make too much sense in simulation.

This feels a bit fragile since even just now I often fail to put a test newly converted to the subtest stuff into the right single/multi make target list. Also, this way we exclude a test by default, which also feels like the wrong way round (most of the tests we're adding aren't heavy stress-tests, but more excercise some corner-case).

So what about a sprinkling

Quoted 7 lines

drmtest_skip_on_simulation();

over the remaining testcases instead, which just calls exit(77);? Only caveat is that for subtests we need to put it into the right spot to not break subtest enumeration in piglit (it's a bit fragile).

Cheers, Daniel

I prefer Damien's explicit definitions in a file. It makes it much easier to see exactly what's run, and add a test as needed. Since simulation testing will always be a massive subset of the whole i-g-t suite, and we'll probably only rarely add or remove a test, I think it's not a big concern that we might miss a test.

Quoted 88 lines
Quoted 79 lines
---
 tests/Makefile.am | 43 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)
tests/Makefile.am +40 -3
index 2fddfe8..33db962 100644
@@ -137,22 +137,59 @@ kernel_tests = \
 	$(multi_kernel_tests) \
 	$(NULL)
 
+# We maintain here a list of tests to run in our simulation environments
+single_simulation_tests = \
+	gem_mmap \
+	gem_pread_after_blit \
+	gem_ring_sync_loop \
+	gem_ctx_basic \
+	gem_pipe_control_store_loop \
+	gem_storedw_loop_render \
+	gem_storedw_loop_blt \
+	gem_storedw_loop_bsd \
+	gem_render_linear_blits \
+	gem_tiled_blits \
+	gem_cpu_reloc \
+	$(NULL)
+
+multi_simulation_tests = \
+	gem_exec_nop \
+	gem_mmap_gtt \
+	$(NULL)
+
+simulation_tests = \
+	$(single_simulation_tests) \
+	$(multi_simulation_tests) \
+	$(NULL)
+
 TESTS = \
 	$(NULL)
 
 test:
 	@whoami | grep root || ( echo ERROR: not running as root; exit 1 )
 	@./check_drm_clients
-	@make TESTS="${kernel_tests}" check
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		make TESTS="${simulation_tests}" check; \
+	else \
+		make TESTS="${kernel_tests}" check; \
+	fi
 
 list-single-tests:
 	@echo TESTLIST
-	@echo ${single_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${single_simulation_tests}; \
+	else \
+		echo ${single_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 list-multi-tests:
 	@echo TESTLIST
-	@echo ${multi_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${multi_simulation_tests}; \
+	else \
+		echo ${multi_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 HANG = \
Signature · 6 lines
1.7.11.7

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#6 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Quoted 26 lines · Ben Widawsky
Quoted 25 lines · Daniel Vetter
Quoted 9 lines · Damien Lespiau

There are two ways to run tests, directly with make check/test or through piglit.

When IGT_SIMULATION is set to '1', we substitute the list of tests in those two code paths with carefully selected tests. The stress tests and other horrors are left to torture the real hardware as they don't make too much sense in simulation.

This feels a bit fragile since even just now I often fail to put a test newly converted to the subtest stuff into the right single/multi make target list. Also, this way we exclude a test by default, which also feels like the wrong way round (most of the tests we're adding aren't heavy stress-tests, but more excercise some corner-case).

So what about a sprinkling

drmtest_skip_on_simulation();

over the remaining testcases instead, which just calls exit(77);? Only caveat is that for subtests we need to put it into the right spot to not break subtest enumeration in piglit (it's a bit fragile).

Quoted 7 lines
Quoted 1 line

Cheers, Daniel

I prefer Damien's explicit definitions in a file. It makes it much easier to see exactly what's run, and add a test as needed. Since simulation testing will always be a massive subset of the whole i-g-t suite, and we'll probably only rarely add or remove a test, I think it's not a big concern that we might miss a test.

Imo that's the wrong approach, since most of the tests we've recently added exercise corner-cases of our code, and in a rather deterministic way. If we currently have too many tests to get through all of the useful ones in a day, we need more machines, not fewer tests.

In the end we want to be able to run full piglit on all this stuff in simulation after all. Cc'ing Yi so he knows where I'm aiming at ;-) -Daniel

Quoted 92 lines
Quoted 89 lines
Quoted 80 lines

---
 tests/Makefile.am | 43 ++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)
tests/Makefile.am +40 -3
index 2fddfe8..33db962 100644
@@ -137,22 +137,59 @@ kernel_tests = \
 	$(multi_kernel_tests) \
 	$(NULL)
 
+# We maintain here a list of tests to run in our simulation environments
+single_simulation_tests = \
+	gem_mmap \
+	gem_pread_after_blit \
+	gem_ring_sync_loop \
+	gem_ctx_basic \
+	gem_pipe_control_store_loop \
+	gem_storedw_loop_render \
+	gem_storedw_loop_blt \
+	gem_storedw_loop_bsd \
+	gem_render_linear_blits \
+	gem_tiled_blits \
+	gem_cpu_reloc \
+	$(NULL)
+
+multi_simulation_tests = \
+	gem_exec_nop \
+	gem_mmap_gtt \
+	$(NULL)
+
+simulation_tests = \
+	$(single_simulation_tests) \
+	$(multi_simulation_tests) \
+	$(NULL)
+
 TESTS = \
 	$(NULL)
 
 test:
 	@whoami | grep root || ( echo ERROR: not running as root; exit 1 )
 	@./check_drm_clients
-	@make TESTS="${kernel_tests}" check
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		make TESTS="${simulation_tests}" check; \
+	else \
+		make TESTS="${kernel_tests}" check; \
+	fi
 
 list-single-tests:
 	@echo TESTLIST
-	@echo ${single_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${single_simulation_tests}; \
+	else \
+		echo ${single_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 list-multi-tests:
 	@echo TESTLIST
-	@echo ${multi_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${multi_simulation_tests}; \
+	else \
+		echo ${multi_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 HANG = \
Signature · 6 lines
1.7.11.7

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#7 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Hi Daniel,

Thank you for your notification. This would make it easy to run sub suite on simulation during this stage. I know the goal is to run the whole i-g-t test case. So we can run tests/igt.test just like any other real machines. Ok, I'll add it to our nightly ASAP.

Thanks

    --Sun, Yi
Quoted 150 lines

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Wednesday, March 27, 2013 8:25 AM
To: Ben Widawsky
Cc: Daniel Vetter; Lespiau, Damien; [email protected]; Sun, Yi
Subject: Re: [Intel-gfx] [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Quoted 10 lines · Ben Widawsky
Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Damien Lespiau

There are two ways to run tests, directly with make check/test or through piglit.

When IGT_SIMULATION is set to '1', we substitute the list of tests in those two code paths with carefully selected tests. The stress tests and other horrors are left to torture the real hardware as they don't make too much sense in simulation.

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

This feels a bit fragile since even just now I often fail to put a test newly converted to the subtest stuff into the right single/multi make target list. Also, this way we exclude a test by default, which also feels like the wrong way round (most of the tests we're adding aren't heavy stress-tests, but more excercise some

corner-case).

Quoted 9 lines
Quoted 9 lines

So what about a sprinkling

drmtest_skip_on_simulation();

over the remaining testcases instead, which just calls exit(77);? Only caveat is that for subtests we need to put it into the right spot to not break subtest enumeration in piglit (it's a bit fragile).

Quoted 7 lines
Quoted 1 line

Cheers, Daniel

I prefer Damien's explicit definitions in a file. It makes it much easier to see exactly what's run, and add a test as needed. Since simulation testing will always be a massive subset of the whole i-g-t suite, and we'll probably only rarely add or remove a test, I think it's not a big concern that we might miss a test.

Imo that's the wrong approach, since most of the tests we've recently added exercise corner-cases of our code, and in a rather deterministic way. If we currently have too many tests to get through all of the useful ones in a day, we need more machines, not fewer tests.

In the end we want to be able to run full piglit on all this stuff in simulation after all. Cc'ing Yi so he knows where I'm aiming at ;-) -Daniel

Quoted 91 lines
Quoted 77 lines
Quoted 77 lines

---
 tests/Makefile.am | 43
++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 40 insertions(+), 3 deletions(-)
tests/Makefile.am index renamed from tests/Makefile.am +0 -0

2fddfe8..33db962 100644

tests/Makefile.am +40 -4
@@ -137,22 +137,59 @@ kernel_tests = \
 	$(multi_kernel_tests) \
 	$(NULL)
 
+# We maintain here a list of tests to run in our simulation
+environments single_simulation_tests = \
+	gem_mmap \
+	gem_pread_after_blit \
+	gem_ring_sync_loop \
+	gem_ctx_basic \
+	gem_pipe_control_store_loop \
+	gem_storedw_loop_render \
+	gem_storedw_loop_blt \
+	gem_storedw_loop_bsd \
+	gem_render_linear_blits \
+	gem_tiled_blits \
+	gem_cpu_reloc \
+	$(NULL)
+
+multi_simulation_tests = \
+	gem_exec_nop \
+	gem_mmap_gtt \
+	$(NULL)
+
+simulation_tests = \
+	$(single_simulation_tests) \
+	$(multi_simulation_tests) \
+	$(NULL)
+
 TESTS = \
 	$(NULL)
 
 test:
 	@whoami | grep root || ( echo ERROR: not running as root; exit 1 )
 	@./check_drm_clients
-	@make TESTS="${kernel_tests}" check
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		make TESTS="${simulation_tests}" check; \
+	else \
+		make TESTS="${kernel_tests}" check; \
+	fi
 
 list-single-tests:
 	@echo TESTLIST
-	@echo ${single_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${single_simulation_tests}; \
+	else \
+		echo ${single_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 list-multi-tests:
 	@echo TESTLIST
-	@echo ${multi_kernel_tests}
+	@if [ "${IGT_SIMULATION}" == 1 ]; then \
+		echo ${multi_simulation_tests}; \
+	else \
+		echo ${multi_kernel_tests}; \
+	fi
 	@echo END TESTLIST
 
 HANG = \
--

1.7.11.7

Quoted 13 lines
Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Quoted 2 lines

--
Ben Widawsky, Intel Open Source Technology Center

--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

#8 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

In reply to Daniel Vetter
Quoted 36 lines · Ben Widawsky
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Damien Lespiau
Quoted 8 lines

There are two ways to run tests, directly with make check/test or through piglit.

When IGT_SIMULATION is set to '1', we substitute the list of tests in those two code paths with carefully selected tests. The stress tests and other horrors are left to torture the real hardware as they don't make too much sense in simulation.

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

This feels a bit fragile since even just now I often fail to put a test newly converted to the subtest stuff into the right single/multi make target list. Also, this way we exclude a test by default, which also feels like the wrong way round (most of the tests we're adding aren't heavy stress-tests, but more excercise some

corner-case).

Quoted 9 lines
Quoted 9 lines

So what about a sprinkling

drmtest_skip_on_simulation();

over the remaining testcases instead, which just calls exit(77);? Only caveat is that for subtests we need to put it into the right spot to not break subtest enumeration in piglit (it's a bit fragile).

Quoted 7 lines
Quoted 1 line

Cheers, Daniel

I prefer Damien's explicit definitions in a file. It makes it much easier to see exactly what's run, and add a test as needed. Since simulation testing will always be a massive subset of the whole i-g-t suite, and we'll probably only rarely add or remove a test, I think it's not a big concern that we might miss a test.

Quoted 8 lines

Imo that's the wrong approach, since most of the tests we've recently added exercise corner-cases of our code, and in a rather deterministic way. If we currently have too many tests to get through all of the useful ones in a day, we need more machines, not fewer tests.

In the end we want to be able to run full piglit on all this stuff in simulation after all. Cc'ing Yi so he knows where I'm aiming at ;-) -Daniel

[Sun, Yi] So what's the conclusion, how can I do to solve the too long time issue? I noticed Damien's patches aren't on the branch yet.
If we want to split all i-g-t test cases to different HAS, how can we split it?

Thanks
--Yi Sun

#9 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Quoted 41 lines · Yi
Quoted 41 lines · Ben Widawsky
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · Damien Lespiau
Quoted 8 lines

There are two ways to run tests, directly with make check/test or through piglit.

When IGT_SIMULATION is set to '1', we substitute the list of tests in those two code paths with carefully selected tests. The stress tests and other horrors are left to torture the real hardware as they don't make too much sense in simulation.

Quoted 7 lines
Quoted 7 lines
Quoted 1 line

This feels a bit fragile since even just now I often fail to put a test newly converted to the subtest stuff into the right single/multi make target list. Also, this way we exclude a test by default, which also feels like the wrong way round (most of the tests we're adding aren't heavy stress-tests, but more excercise some

corner-case).

Quoted 9 lines
Quoted 9 lines

So what about a sprinkling

drmtest_skip_on_simulation();

over the remaining testcases instead, which just calls exit(77);? Only caveat is that for subtests we need to put it into the right spot to not break subtest enumeration in piglit (it's a bit fragile).

Quoted 7 lines
Quoted 1 line

Cheers, Daniel

I prefer Damien's explicit definitions in a file. It makes it much easier to see exactly what's run, and add a test as needed. Since simulation testing will always be a massive subset of the whole i-g-t suite, and we'll probably only rarely add or remove a test, I think it's not a big concern that we might miss a test.

Imo that's the wrong approach, since most of the tests we've recently added exercise corner-cases of our code, and in a rather deterministic way. If we currently have too many tests to get through all of the useful ones in a day, we need more machines, not fewer tests.

Quoted 7 lines
Quoted 3 lines

In the end we want to be able to run full piglit on all this stuff in simulation after all. Cc'ing Yi so he knows where I'm aiming at ;-) -Daniel

[Sun, Yi] So what's the conclusion, how can I do to solve the too long time issue? I noticed Damien's patches aren't on the branch yet.
If we want to split all i-g-t test cases to different HAS, how can we split it?

Daniel, can you please advise Sun Yi since the solution I like has been shot down?

Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#10 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Quoted 7 lines · Ben Widawsky
Quoted 4 lines

[Sun, Yi] So what's the conclusion, how can I do to solve the too long time issue? I noticed Damien's patches aren't on the branch yet.
If we want to split all i-g-t test cases to different HAS, how can we split it?

Daniel, can you please advise Sun Yi since the solution I like has been shot down?

It's not unreasonable to want to run test cases by default and black list the ones we don't want to run. I'm on holidays soon though and won't be able to rework this before a little while.

Signature · 1 line
Damien
#11 lore raw

Re: [PATCH i-g-t 3/5] tests: Use IGT_SIMULATION to tune the list of tests to run

Quoted 6 lines · Damien Lespiau
Quoted 5 lines · Ben Widawsky
Quoted 4 lines

[Sun, Yi] So what's the conclusion, how can I do to solve the too long time issue? I noticed Damien's patches aren't on the branch yet.
If we want to split all i-g-t test cases to different HAS, how can we split it?

Quoted 6 lines
Quoted 2 lines

Daniel, can you please advise Sun Yi since the solution I like has been shot down?

It's not unreasonable to want to run test cases by default and black list the ones we don't want to run. I'm on holidays soon though and won't be able to rework this before a little while.

tbh I'm not set in stone on this issue, and blocking enabling on fulsim feels bad, too. So please go ahead with whatever approach you deem best. Since for both approaches the interface for QA/testing would be just a magic enviroment variable, we could even switch without much fuzz. So I don't mind if you go ahead with the current patches.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#12 lore raw

PATCH 4/5 tests: Instrument tests run in simulation to run quickly

In reply to Damien Lespiau

We tweak the tests marked as runnable in simulation to run more quickly, more often then not at the expense of stress testing (which is of an arguable interest for the initial bring up in simulation). Hopefully the values chosen still test something, which is not always straightforward.

It does run quickly, the number on an IVB machines are:

$ time sudo IGT_SIMULATION=0 ./piglit-run.py tests/igt.tests foo
[...]
real	2m0.141s
user	0m16.365s
sys	1m33.382s

Vs.

$ time sudo IGT_SIMULATION=1 ./piglit-run.py tests/igt.tests foo
[...]
real	0m0.448s
user	0m0.226s
sys	0m0.183s
---
 tests/gem_cpu_reloc.c               | 3 +++
 tests/gem_ctx_basic.c               | 5 +++++
 tests/gem_exec_nop.c                | 2 +-
 tests/gem_mmap_gtt.c                | 5 ++++-
 tests/gem_pipe_control_store_loop.c | 2 +-
 tests/gem_render_linear_blits.c     | 6 ++++++
 tests/gem_ring_sync_loop.c          | 2 +-
 tests/gem_storedw_batches_loop.c    | 8 +++++---
 tests/gem_storedw_loop_blt.c        | 8 +++++---
 tests/gem_storedw_loop_bsd.c        | 8 +++++---
 tests/gem_storedw_loop_render.c     | 8 +++++---
 tests/gem_tiled_blits.c             | 6 ++++++
 12 files changed, 47 insertions(+), 16 deletions(-)
tests/gem_cpu_reloc.c +3 -0
index baf8301..ad70e40 100644
@@ -153,6 +153,9 @@ int main(int argc, char **argv)
 	}
 
 	count = aper_size / 4096 * 2;
+	if (drmtest_run_in_simulation())
+		count = 10;
+
 	handles = malloc (count * sizeof(uint32_t));
 	assert(handles);
 
tests/gem_ctx_basic.c +5 -0
index 3757d84..729c79c 100644
@@ -143,6 +143,11 @@ int main(int argc, char *argv[])
 	fd = drm_open_any();
 	devid = intel_get_drm_devid(fd);
 
+	if (drmtest_run_in_simulation()) {
+		num_contexts = 2;
+		iter = 4;
+	}
+
 	parse(argc, argv);
 
 	threads = calloc(num_contexts, sizeof(*threads));
tests/gem_exec_nop.c +1 -1
index 8608592..2307983 100644
@@ -95,7 +95,7 @@ static void loop(int fd, uint32_t handle, unsigned ring_id, const char *ring_nam
 
 	skipped_all = false;
 
-	for (count = 1; count <= 1<<17; count <<= 1) {
+	for (count = 1; count <= SLOW_QUICK(1<<17, 1<<4); count <<= 1) {
 		struct timeval start, end;
 
 		gettimeofday(&start, NULL);
tests/gem_mmap_gtt.c +4 -1
index d759340..e53a942 100644
@@ -40,7 +40,7 @@
 #include "i915_drm.h"
 #include "drmtest.h"
 
-#define OBJECT_SIZE (16*1024*1024)
+static int OBJECT_SIZE = 16*1024*1024;
 
 static void set_domain(int fd, uint32_t handle)
 {
@@ -148,6 +148,9 @@ int main(int argc, char **argv)
 {
 	int fd;
 
+	if (drmtest_run_in_simulation())
+		OBJECT_SIZE = 1 * 1024 * 1024;
+
 	drmtest_subtest_init(argc, argv);
 
 	fd = drm_open_any();
tests/gem_pipe_control_store_loop.c +1 -1
index e03cddd..af6a758 100644
@@ -70,7 +70,7 @@ store_pipe_control_loop(void)
 	uint32_t *buf;
 	drm_intel_bo *target_bo;
 
-	for (i = 0; i < 0x10000; i++) {
+	for (i = 0; i < SLOW_QUICK(0x10000, 4); i++) {
 		/* we want to check tlb consistency of the pipe_control target,
 		 * so get a new buffer every time around */
 		target_bo = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096);
tests/gem_render_linear_blits.c +6 -0
index a7e0189..c94f451 100644
@@ -81,8 +81,11 @@ int main(int argc, char **argv)
 	batch = intel_batchbuffer_alloc(bufmgr, intel_get_drm_devid(fd));
 
 	count = 0;
+	if (drmtest_run_in_simulation())
+		count = 2;
 	if (argc > 1)
 		count = atoi(argv[1]);
+
 	if (count == 0)
 		count = 3 * gem_aperture_size(fd) / SIZE / 2;
 	else if (count < 2) {
@@ -127,6 +130,9 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(fd, bo[i]->handle, start_val[i]);
 
+	if (drmtest_run_in_simulation())
+		return 0;
+
 	printf("Cyclic blits, backward...\n");
 	for (i = 0; i < count * 4; i++) {
 		struct scratch_buf src, dst;
tests/gem_ring_sync_loop.c +1 -1
index b689bcd..6ba1052 100644
@@ -62,7 +62,7 @@ store_dword_loop(void)
 
 	srandom(0xdeadbeef);
 
-	for (i = 0; i < 0x100000; i++) {
+	for (i = 0; i < SLOW_QUICK(0x100000, 10); i++) {
 		int ring = random() % 3 + 1;
 
 		if (ring == I915_EXEC_RENDER) {
tests/gem_storedw_batches_loop.c +5 -3
index 86c3469..7d07c59 100644
@@ -60,7 +60,7 @@ store_dword_loop(int divider)
 	if (!has_ppgtt)
 		cmd |= MI_MEM_VIRTUAL;
 
-	for (i = 0; i < SLOW_QUICK(0x80000, 0x10); i++) {
+	for (i = 0; i < SLOW_QUICK(0x80000, 4); i++) {
 		cmd_bo = drm_intel_bo_alloc(bufmgr, "cmd bo", 4096, 4096);
 		if (!cmd_bo) {
 			fprintf(stderr, "failed to alloc cmd bo\n");
@@ -170,8 +170,10 @@ int main(int argc, char **argv)
 
 	store_dword_loop(1);
 	store_dword_loop(2);
-	store_dword_loop(3);
-	store_dword_loop(5);
+	if (!drmtest_run_in_simulation()) {
+		store_dword_loop(3);
+		store_dword_loop(5);
+	}
 
 	drm_intel_bo_unreference(target_bo);
 	drm_intel_bufmgr_destroy(bufmgr);
tests/gem_storedw_loop_blt.c +5 -3
index cacae3a..dfb613b 100644
@@ -63,7 +63,7 @@ store_dword_loop(int divider)
 	if (!has_ppgtt)
 		cmd |= MI_MEM_VIRTUAL;
 
-	for (i = 0; i < SLOW_QUICK(0x100000, 0x10); i++) {
+	for (i = 0; i < SLOW_QUICK(0x100000, 4); i++) {
 		BEGIN_BATCH(4);
 		OUT_BATCH(cmd);
 		OUT_BATCH(0); /* reserved */
@@ -150,8 +150,10 @@ int main(int argc, char **argv)
 
 	store_dword_loop(1);
 	store_dword_loop(2);
-	store_dword_loop(3);
-	store_dword_loop(5);
+	if (!drmtest_run_in_simulation()) {
+		store_dword_loop(3);
+		store_dword_loop(5);
+	}
 
 	drm_intel_bo_unreference(target_buffer);
 	intel_batchbuffer_free(batch);
tests/gem_storedw_loop_bsd.c +5 -3
index 232c3a6..6aefb9a 100644
@@ -63,7 +63,7 @@ store_dword_loop(int divider)
 	if (!has_ppgtt)
 		cmd |= MI_MEM_VIRTUAL;
 
-	for (i = 0; i < SLOW_QUICK(0x100000, 0x10); i++) {
+	for (i = 0; i < SLOW_QUICK(0x100000, 4); i++) {
 		BEGIN_BATCH(4);
 		OUT_BATCH(cmd);
 		OUT_BATCH(0); /* reserved */
@@ -156,8 +156,10 @@ int main(int argc, char **argv)
 
 	store_dword_loop(1);
 	store_dword_loop(2);
-	store_dword_loop(3);
-	store_dword_loop(5);
+	if (!drmtest_run_in_simulation()) {
+		store_dword_loop(3);
+		store_dword_loop(5);
+	}
 
 	drm_intel_bo_unreference(target_buffer);
 	intel_batchbuffer_free(batch);
tests/gem_storedw_loop_render.c +5 -3
index fe09834..e41ecc7 100644
@@ -63,7 +63,7 @@ store_dword_loop(int divider)
 	if (!has_ppgtt)
 		cmd |= MI_MEM_VIRTUAL;
 
-	for (i = 0; i < SLOW_QUICK(0x100000, 0x10); i++) {
+	for (i = 0; i < SLOW_QUICK(0x100000, 4); i++) {
 		BEGIN_BATCH(4);
 		OUT_BATCH(cmd);
 		OUT_BATCH(0); /* reserved */
@@ -144,8 +144,10 @@ int main(int argc, char **argv)
 
 	store_dword_loop(1);
 	store_dword_loop(2);
-	store_dword_loop(3);
-	store_dword_loop(5);
+	if (!drmtest_run_in_simulation()) {
+		store_dword_loop(3);
+		store_dword_loop(5);
+	}
 
 	drm_intel_bo_unreference(target_buffer);
 	intel_batchbuffer_free(batch);
tests/gem_tiled_blits.c +6 -0
index bb43976..86ff745 100644
@@ -127,8 +127,11 @@ int main(int argc, char **argv)
 	fd = drm_open_any();
 
 	count = 0;
+	if (drmtest_run_in_simulation())
+		count = 2;
 	if (argc > 1)
 		count = atoi(argv[1]);
+
 	if (count == 0) {
 		count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
 		count += (count & 1) == 0;
@@ -175,6 +178,9 @@ int main(int argc, char **argv)
 	for (i = 0; i < count; i++)
 		check_bo(bo[i], bo_start_val[i]);
 
+	if (drmtest_run_in_simulation())
+		return 0;
+
 	printf("Cyclic blits, backward...\n");
 	for (i = 0; i < count * 4; i++) {
 		int src = (i+1) % count;
Signature · 1 line
1.7.11.7
#13 lore raw

PATCH 5/5 build: Make grep silent with running make test

In reply to Damien Lespiau

-q will prevent grep from writing to stdout and print "root" when make test is running as root.

---
 tests/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile.am +1 -1
index 33db962..d32e944 100644
@@ -166,7 +166,7 @@ TESTS = \
 	$(NULL)
 
 test:
-	@whoami | grep root || ( echo ERROR: not running as root; exit 1 )
+	@whoami | grep -q root || ( echo ERROR: not running as root; exit 1 )
 	@./check_drm_clients
 	@if [ "${IGT_SIMULATION}" == 1 ]; then \
 		make TESTS="${simulation_tests}" check; \
Signature · 1 line
1.7.11.7