-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.sh
executable file
·42 lines (34 loc) · 1.38 KB
/
benchmark.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#/usr/bin/env bash
export LIBGL_ALWAYS_SOFTWARE=true
export GALLIUM_DRIVER=llvmpipe
# Avoid error dialog if OpenArena was force-closed previously.
rm -f /tmp/ioq3.pid
echo "Benchmarks should take around 4 hours to run, be patient!"
echo ""
lscpu | grep "^CPU(s):"
echo "Memory:"
lshw -class memory | grep " size" || exit -1
glxinfo | grep -i "OpenGL version"
glxgears > /dev/null &
sleep 5s
echo "LP_MAX_THREADS: $(ps H -o 'tid comm' $(ps -e | grep glxgears | cut -f 1 -d ' ') | grep -i llvmpipe | wc -l)"
killall glxgears
sleep 5s
openarena +timedemo 1 +cg_drawfps 1 +quit 2>&1 | grep 'MODE'
echo ""
# Work around "HUNK_ALLOC FAILED" error with default OpenArena settings
sed -i 's/seta com_hunkMegs "[0-9]*"/seta com_hunkMegs "256"/' ~/.openarena/baseoa/q3config.cfg
echo "Frames TotalTime averageFPS minimum/average/maximum/std deviation"
echo ""
# All publicly documented Sforza core counts, in single and double CPU configurations.
# Also test 8 threads (not a Sforza core count) for comparison purposes.
for THREADS in 8 16 32 48 64 72 80 88 96 128 144 160 176 ; do
echo "$THREADS Threads:"
export LP_NUM_THREADS="$THREADS"
for I in {1..5} ; do
# Avoid error dialog if OpenArena was force-closed previously.
rm -f /tmp/ioq3.pid
openarena +timedemo 1 +cg_drawfps 1 +demo demo088-test1.dm_71 +set nextdemo quit 2>&1 | grep 'frames'
done
echo ""
done