gitlab-ci: Add a shader-db run using v3d on drm-shim.
authorEric Anholt <eric@anholt.net>
Wed, 10 Apr 2019 22:59:12 +0000 (15:59 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 25 Jul 2019 15:56:55 +0000 (08:56 -0700)
This provides significant compiler coverage during CI at a fairly low
cost in CPU time (~17s per thread for 4 threads on
gst-gitlab-htz-runner3).

I'm leaving wget in the docker image, as once this is in master I'm
planning on having an automatic shader-db comparison between master
and the branch included in the artifacts.  I also haven't done
freedreno yet, because it has some races when run in multithreaded
mode that I'm still tracking down.

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
.gitlab-ci.yml
.gitlab-ci/debian-install.sh
.gitlab-ci/meson-build.sh
.gitlab-ci/run-shader-db.sh [new file with mode: 0755]

index a8a16f6..792bbfb 100644 (file)
@@ -14,7 +14,7 @@
 # repository's registry will be used there as well.
 variables:
   UPSTREAM_REPO: mesa/mesa
-  DEBIAN_TAG: "2019-07-11"
+  DEBIAN_TAG: "2019-07-23"
   DEBIAN_VERSION: stretch-slim
   DEBIAN_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
 
@@ -66,6 +66,7 @@ debian:
       - _build/meson-logs/*.txt
       # scons:
       - _build/*/config.log
+      - shader-db
   variables:
     CCACHE_COMPILERCHECK: "content"
   # Use ccache transparently, and print stats before/after
@@ -166,6 +167,7 @@ meson-main:
     DRI_DRIVERS: "i915,i965,r100,r200,swrast,nouveau"
     GALLIUM_ST: >
       -D dri3=true
+      -D tools=drm-shim
       -D gallium-extra-hud=true
       -D gallium-vdpau=true
       -D gallium-xvmc=true
@@ -178,6 +180,7 @@ meson-main:
     LLVM_VERSION: "7"
     EXTRA_OPTION: >
       -D tools=all
+    MESON_SHADERDB: "true"
 
 meson-clover:
   extends: .meson-build
index 64f970f..578074d 100644 (file)
@@ -57,6 +57,10 @@ apt-get install -y \
       libxdamage-dev \
       libxxf86vm-dev \
       gcc \
+      git \
+      libepoxy-dev \
+      libegl1-mesa-dev \
+      libgbm-dev \
       libclc-dev \
       libxvmc-dev \
       libomxil-bellagio-dev \
@@ -196,6 +200,13 @@ tar -xvf $WAYLAND_PROTOCOLS_VERSION.tar.xz && rm $WAYLAND_PROTOCOLS_VERSION.tar.
 cd $WAYLAND_PROTOCOLS_VERSION; ./configure; make install; cd ..
 rm -rf $WAYLAND_PROTOCOLS_VERSION
 
+pushd /usr/local
+git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
+rm -rf shader-db/.git
+cd shader-db
+make
+popd
+
 # Use ccache to speed up builds
 apt-get install -y ccache
 
@@ -205,10 +216,10 @@ apt-get install -y libxml2-utils
 # Remove unused packages
 apt-get purge -y \
       automake \
+      git \
       libtool \
       curl \
       unzip \
-      wget \
       gnupg \
       software-properties-common
 apt-get autoremove -y --purge
index 04b0189..c7fef6f 100755 (executable)
@@ -33,3 +33,8 @@ meson configure
 ninja -j4
 LC_ALL=C.UTF-8 ninja test
 DESTDIR=$PWD/../install ninja install
+cd ..
+
+if test -n "$MESON_SHADERDB"; then
+    ./.gitlab-ci/run-shader-db.sh;
+fi
diff --git a/.gitlab-ci/run-shader-db.sh b/.gitlab-ci/run-shader-db.sh
new file mode 100755 (executable)
index 0000000..70a434c
--- /dev/null
@@ -0,0 +1,15 @@
+set -e
+set -v
+
+ARTIFACTSDIR=`pwd`/shader-db
+mkdir -p $ARTIFACTSDIR
+export DRM_SHIM_DEBUG=true
+
+LIBDIR=`pwd`/install/usr/local/lib
+export LIBGL_DRIVERS_PATH=$LIBDIR/dri
+
+cd /usr/local/shader-db
+
+env LD_PRELOAD=$LIBDIR/libv3d_noop_drm_shim.so \
+    ./run -j 4 ./shaders \
+        > $ARTIFACTSDIR/v3d-shader-db.txt