panfrost: ci: Tweak dEQP to improve throughput
[mesa.git] / src / gallium / drivers / panfrost / ci / deqp-runner.sh
1 #!/bin/sh
2
3 set -x
4
5 # To prevent memory leaks from slowing throughput, restart everything between batches
6 BATCH_SIZE=5000
7
8 DEQP_OPTIONS="--deqp-surface-width=256 --deqp-surface-height=256"
9 DEQP_OPTIONS="$DEQP_OPTIONS --deqp-visibility=hidden"
10 DEQP_OPTIONS="$DEQP_OPTIONS --deqp-log-images=disable"
11 DEQP_OPTIONS="$DEQP_OPTIONS --deqp-watchdog=enable"
12 DEQP_OPTIONS="$DEQP_OPTIONS --deqp-crashhandler=enable"
13
14 export XDG_RUNTIME_DIR=/tmp
15 export LIBGL_DRIVERS_PATH=/mesa/lib/dri/
16 export LD_LIBRARY_PATH=/mesa/lib/
17 export XDG_CONFIG_HOME=$(pwd)
18
19 echo "[core]\nidle-time=0\nrequire-input=false\n[shell]\nlocking=false" > weston.ini
20
21 cd /deqp/modules/gles2
22
23 # Generate test case list file
24 weston --tty=7 &
25 sleep 1 # Give some time for Weston to start up
26 ./deqp-gles2 $DEQP_OPTIONS --deqp-runmode=stdout-caselist | grep "TEST: dEQP-GLES2" | cut -d ' ' -f 2 > /tmp/case-list.txt
27
28 # Disable for now tests that are very slow, either by just using lots of CPU or by crashing
29 sed -i '/dEQP-GLES2.performance/d' /tmp/case-list.txt
30 sed -i '/dEQP-GLES2.functional.texture.filtering.2d.linear_mipmap_linear_/d' /tmp/case-list.txt
31 sed -i '/dEQP-GLES2.functional.texture.filtering.cube.linear_mipmap_linear_/d' /tmp/case-list.txt
32 sed -i '/dEQP-GLES2.functional.texture.filtering.cube.linear_mipmap_nearest_/d' /tmp/case-list.txt
33
34 # Cannot use tee because dash doesn't have pipefail
35 touch /tmp/result.txt
36 tail -f /tmp/result.txt &
37
38 while [ -s /tmp/case-list.txt ]; do
39 head -$BATCH_SIZE /tmp/case-list.txt > /tmp/next-batch.txt
40 ./deqp-gles2 $DEQP_OPTIONS --deqp-log-filename=/dev/null --deqp-caselist-file=/tmp/next-batch.txt >> /tmp/result.txt
41 deqp_status=$?
42
43 kill $(pidof weston)
44 sleep 1 # Give some time for Weston to release the VT
45 weston --tty=7 &
46 sleep 1 # Give some time for Weston to start up
47
48 if [ $deqp_status -ne 0 ]; then
49 # Continue from the subtest after the failing one
50 crashed_test=$(grep "Test case" /tmp/result.txt | tail -1 | sed "s/Test case '\(.*\)'\.\./\1/")
51 sed -i "0,/^$crashed_test$/d" /tmp/case-list.txt
52
53 # So LAVA knows what happened
54 echo "Test case '$crashed_test'.."
55 echo " Crash"
56 else
57 # Consume a whole batch
58 sed -i '1,'$BATCH_SIZE'd' /tmp/case-list.txt
59 fi
60 done