blob: d07f2d812e354d49a03ced94df978aebddaec91f [file]
#!/bin/bash
. $LKP_SRC/lib/env.sh
download()
{
git_clone_update https://github.com/waffle-gl/waffle.git
git_clone_update https://anongit.freedesktop.org/git/xorg/app/intel-gpu-tools.git
# keep it in the last to set the effective source_dir
git_clone_update https://anongit.freedesktop.org/git/piglit.git
}
find_delete_files()
{
find $1 -name '*.c' -or -name '*.o' -delete
}
build()
{
# apt-get build-dep intel-gpu-tools
# apt-get install libglu1-mesa-dev python3-dev
local ncpu=$(nproc)
local wayland=1
gcc_major=$(gcc -dumpversion | cut -d. -f1)
if [ "$gcc_major" -ge 8 ]; then
export CC=$(which gcc7)
fi
[ "$distro" = "centos" ] && wayland=0
cd ../waffle || return
cmake -Dwaffle_has_glx=1 \
-Dwaffle_has_x11_egl=1 \
-Dwaffle_has_wayland=$wayland \
-Dwaffle_has_gbm=1 \
-DCMAKE_INSTALL_PREFIX=/usr || return
make || return
make install || return
find_delete_files || return
cd ../$BM_NAME || return
cmake -DCMAKE_INSTALL_PREFIX=$BM_ROOT || return
make || return
make install || return
find_delete_files || return
cd ../intel-gpu-tools || return
[ "$distro" = "centos" ] && local opts="--disable-amdgpu"
./autogen.sh $opts || return
make || return
find_delete_files
}
create_config()
{
cat > /lkp/benchmarks/piglit/piglit.conf <<-EOF
[igt]
path=$BM_ROOT/lib/piglit/bin/igt
EOF
}
install()
{
cd $source_dir || return
mv -T ../intel-gpu-tools $BM_ROOT/lib/$BM_NAME/bin/igt
create_config
generate_test_groups
}
generate_test_groups()
{
(
cd $BM_ROOT || exit
mkdir -p groups
local tset
for tset in sanity igt all quick
do
# the output like below:
# running: spec/!opengl 1.1/streaming-texture-leak
#
# using `sed` command may result in some errors, it is due to exist some special character such as "!"
bin/piglit run $tset /tmp/piglit-output -d -v | grep 'running:' | sed 's/^running: *//g;s/ *$//g' | tr " " . > groups/$tset-all
done
)
# In order to avoid errors or test cases that do not exist, update the relevant testcase at pack time
# In split testcase, the total number of files is specified so that you don't have to update job.yaml every time
cd $BM_ROOT/groups || exit
split quick-all -d -n r/200 -a 3 quick-
split igt-all -d -n r/300 -a 3 igt-
grep 'basic' igt-all > igt-basic
split igt-basic -d -n r/4 -a 1 igt-basic-
}
pack()
{
local libwaffle_path=/usr/lib/x86_64-linux-gnu/libwaffle-1.so*
is_clearlinux && {
libwaffle_path=/usr/lib64/libwaffle-1.so*
}
{
echo /lkp
echo /lkp/benchmarks
find /lkp/benchmarks/$BM_NAME
find $libwaffle_path
} |
cpio --quiet -o -H newc | gzip -n -9 > /lkp/benchmarks/${BM_NAME}.cgz
[[ $arch ]] && mv "/lkp/benchmarks/${BM_NAME}.cgz" "/lkp/benchmarks/${BM_NAME}-${arch}.cgz"
}
post_cleanup()
{
rm -fr "$source_dir"
}