From 8fb850651c77c0513c04952362b82b0ad1eff953 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Fri, 8 Oct 2021 13:17:27 -0700 Subject: [PATCH] ci: Enable testing radeonsi's libva using libva-util unit tests. We've noticed issues with these tests when uprevving Mesa in Chrome OS. This CI catches some existing failures, and some debug-build assertion failures as well. To do this, uprev deqp-runner for its new gtest-runner command. This runner is not as efficient as I would hope, due to some expensive code in gtest. I've reported the issue to gtest and it should be easily fixable, but for now it at least means we get to use the same baseline/skip/flake handling we have from deqp and piglit runners. I also fixed build-libdrm for our rootfses to not throw away libdrm's share directory, which was causing a bunch of test-time spam from radeon's libdrm when trying to look up its marketing name tables (not that big of a deal for deqp-runner, but really noisy for piglit and libva-utils which make gallium screens approximatly per-test). Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- .gitlab-ci.yml | 9 +-- .gitlab-ci/common/generate-env.sh | 6 ++ .gitlab-ci/container/build-deqp-runner.sh | 2 +- .gitlab-ci/container/build-va-tools.sh | 17 +++++ .gitlab-ci/container/create-rootfs.sh | 2 + .gitlab-ci/container/lava_build.sh | 12 +++- .gitlab-ci/gtest-runner.sh | 70 +++++++++++++++++++ .gitlab-ci/prepare-artifacts.sh | 3 +- .gitlab-ci/test-source-dep.yml | 19 +++++ src/gallium/drivers/radeonsi/ci/gitlab-ci.yml | 20 ++++++ .../radeonsi/ci/radeonsi-stoney-fails.txt | 23 ++++++ 11 files changed, 174 insertions(+), 9 deletions(-) create mode 100644 .gitlab-ci/container/build-va-tools.sh create mode 100644 .gitlab-ci/gtest-runner.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 528fa211278..7e0d90a8491 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -392,7 +392,7 @@ debian/android_build: debian/x86_test-base: extends: debian/x86_build-base variables: - MESA_IMAGE_TAG: &debian-x86_test-base "2021-09-28-deqp-runner" + MESA_IMAGE_TAG: &debian-x86_test-base "2021-10-15-va" .use-debian/x86_test-base: extends: @@ -410,13 +410,13 @@ debian/x86_test-gl: variables: FDO_DISTRIBUTION_EXEC: 'env KERNEL_URL=${KERNEL_URL} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh' KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.13-rc5-for-mesa-ci-2bb5d9ffd79c/linux-v5.13-rc5-for-mesa-ci-2bb5d9ffd79c.tar.bz2" - MESA_IMAGE_TAG: &debian-x86_test-gl "2021-2021-10-07-piglit" + MESA_IMAGE_TAG: &debian-x86_test-gl "2021-2021-10-15-va" # Debian 11 based x86 test image for VK debian/x86_test-vk: extends: .use-debian/x86_test-base variables: - MESA_IMAGE_TAG: &debian-x86_test-vk "2021-2021-10-07-piglit" + MESA_IMAGE_TAG: &debian-x86_test-vk "2021-2021-10-15-va" # Debian 11 based ARM build image debian/arm_build: @@ -465,7 +465,7 @@ fedora/x86_build: variables: GIT_STRATEGY: fetch KERNEL_URL: *kernel-rootfs-url - MESA_ROOTFS_TAG: &kernel-rootfs "2021-10-07-piglit" + MESA_ROOTFS_TAG: &kernel-rootfs "2021-10-15-va-2" DISTRIBUTION_TAG: &distribution-tag-arm "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}" script: - .gitlab-ci/container/lava_build.sh @@ -684,6 +684,7 @@ debian-testing: -D platforms=x11 GALLIUM_ST: > -D dri3=enabled + -D gallium-va=enabled GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,iris,i915" VULKAN_DRIVERS: "swrast,amd" BUILDTYPE: "debugoptimized" diff --git a/.gitlab-ci/common/generate-env.sh b/.gitlab-ci/common/generate-env.sh index db457783396..05376d4a73d 100755 --- a/.gitlab-ci/common/generate-env.sh +++ b/.gitlab-ci/common/generate-env.sh @@ -41,6 +41,12 @@ for var in \ FD_MESA_DEBUG \ FLAKES_CHANNEL \ GPU_VERSION \ + GTEST \ + GTEST_FAILS \ + GTEST_FRACTION \ + GTEST_RESULTS_DIR \ + GTEST_RUNNER_OPTIONS \ + GTEST_SKIPS \ HWCI_FREQ_MAX \ HWCI_KERNEL_MODULES \ HWCI_START_XORG \ diff --git a/.gitlab-ci/container/build-deqp-runner.sh b/.gitlab-ci/container/build-deqp-runner.sh index 4325f0d34fe..ae989be82d4 100644 --- a/.gitlab-ci/container/build-deqp-runner.sh +++ b/.gitlab-ci/container/build-deqp-runner.sh @@ -4,6 +4,6 @@ set -ex cargo install --locked deqp-runner \ -j ${FDO_CI_CONCURRENT:-4} \ - --version 0.9.0 \ + --version 0.10.0 \ --root /usr/local \ $EXTRA_CARGO_ARGS diff --git a/.gitlab-ci/container/build-va-tools.sh b/.gitlab-ci/container/build-va-tools.sh new file mode 100644 index 00000000000..150575033c9 --- /dev/null +++ b/.gitlab-ci/container/build-va-tools.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -ex + +git config --global user.email "mesa@example.com" +git config --global user.name "Mesa CI" +git clone \ + https://github.com/intel/libva-utils.git \ + -b 2.13.0 \ + --depth 1 \ + /va-utils + +pushd /va-utils +meson build -D tests=true -Dprefix=/va $EXTRA_MESON_ARGS +ninja -C build install +popd +rm -rf /va-utils diff --git a/.gitlab-ci/container/create-rootfs.sh b/.gitlab-ci/container/create-rootfs.sh index 64a6b1441ef..f8a888cad9b 100644 --- a/.gitlab-ci/container/create-rootfs.sh +++ b/.gitlab-ci/container/create-rootfs.sh @@ -8,6 +8,8 @@ elif [ $DEBIAN_ARCH = amd64 ]; then ARCH_PACKAGES="firmware-amd-graphics libelf1 libllvm11 + libva2 + libva-drm2 " fi diff --git a/.gitlab-ci/container/lava_build.sh b/.gitlab-ci/container/lava_build.sh index 10a2985d78d..6cb1954dfb8 100755 --- a/.gitlab-ci/container/lava_build.sh +++ b/.gitlab-ci/container/lava_build.sh @@ -50,6 +50,7 @@ else DEFCONFIG="arch/x86/configs/x86_64_defconfig" DEVICE_TREES="" KERNEL_IMAGE_NAME="bzImage" + ARCH_PACKAGES="libva-dev" fi # Determine if we're in a cross build. @@ -71,6 +72,7 @@ fi apt-get update apt-get install -y --no-remove \ + ${ARCH_PACKAGES} \ automake \ bc \ cmake \ @@ -129,8 +131,7 @@ rm -rf /apitrace ############### Build dEQP runner . .gitlab-ci/container/build-deqp-runner.sh mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin -mv /usr/local/bin/deqp-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/. -mv /usr/local/bin/piglit-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/. +mv /usr/local/bin/*-runner /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/. ############### Build dEQP @@ -143,6 +144,11 @@ mv /deqp /lava-files/rootfs-${DEBIAN_ARCH}/. PIGLIT_OPTS="-DPIGLIT_BUILD_DMA_BUF_TESTS=ON" . .gitlab-ci/container/build-piglit.sh mv /piglit /lava-files/rootfs-${DEBIAN_ARCH}/. +############### Build libva tests +if [[ "$DEBIAN_ARCH" = "amd64" ]]; then + . .gitlab-ci/container/build-va-tools.sh + mv /va/bin/* /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/ +fi ############### Build libdrm EXTRA_MESON_ARGS+=" -D prefix=/libdrm" @@ -179,6 +185,8 @@ rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh # created. mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH find /libdrm/ -name lib\*\.so\* | xargs cp -t /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH/. +mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/libdrm/ +cp -Rp /libdrm/share /lava-files/rootfs-${DEBIAN_ARCH}/libdrm/share rm -rf /libdrm diff --git a/.gitlab-ci/gtest-runner.sh b/.gitlab-ci/gtest-runner.sh new file mode 100644 index 00000000000..41d243bd345 --- /dev/null +++ b/.gitlab-ci/gtest-runner.sh @@ -0,0 +1,70 @@ +#!/bin/sh + +set -ex + +INSTALL=`pwd`/install + +# Set up the driver environment. +export LD_LIBRARY_PATH=`pwd`/install/lib/ +export LIBVA_DRIVERS_PATH=`pwd`/install/lib/dri/ +# libva spams driver open info by default, and that happens per testcase. +export LIBVA_MESSAGING_LEVEL=1 + +if [ -e "$INSTALL/$GPU_VERSION-fails.txt" ]; then + GTEST_RUNNER_OPTIONS="$GTEST_RUNNER_OPTIONS --baseline $INSTALL/$GPU_VERSION-fails.txt" +fi + +# Default to an empty known flakes file if it doesn't exist. +touch $INSTALL/$GPU_VERSION-flakes.txt + +if [ -n "$GALLIUM_DRIVER" ] && [ -e "$INSTALL/$GALLIUM_DRIVER-skips.txt" ]; then + GTEST_SKIPS="$GTEST_SKIPS --skips $INSTALL/$GALLIUM_DRIVER-skips.txt" +fi + +if [ -n "$DRIVER_NAME" ] && [ -e "$INSTALL/$DRIVER_NAME-skips.txt" ]; then + GTEST_SKIPS="$GTEST_SKIPS --skips $INSTALL/$DRIVER_NAME-skips.txt" +fi + +if [ -e "$INSTALL/$GPU_VERSION-skips.txt" ]; then + GTEST_SKIPS="$GTEST_SKIPS --skips $INSTALL/$GPU_VERSION-skips.txt" +fi + +set +e + +gtest-runner \ + run \ + --gtest $GTEST \ + --output ${GTEST_RESULTS_DIR:-results} \ + --jobs ${FDO_CI_CONCURRENT:-4} \ + $GTEST_SKIPS \ + --flakes $INSTALL/$GPU_VERSION-flakes.txt \ + --fraction-start ${CI_NODE_INDEX:-1} \ + --fraction $((${CI_NODE_TOTAL:-1} * ${GTEST_FRACTION:-1})) \ + --env "LD_PRELOAD=$TEST_LD_PRELOAD" \ + $GTEST_RUNNER_OPTIONS + +GTEST_EXITCODE=$? + +deqp-runner junit \ + --testsuite gtest \ + --results $RESULTS/failures.csv \ + --output $RESULTS/junit.xml \ + --limit 50 \ + --template "See https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/results/{{testcase}}.xml" + +# Report the flakes to the IRC channel for monitoring (if configured): +if [ -n "$FLAKES_CHANNEL" ]; then + python3 $INSTALL/report-flakes.py \ + --host irc.oftc.net \ + --port 6667 \ + --results $RESULTS/results.csv \ + --known-flakes $INSTALL/$GPU_VERSION-flakes.txt \ + --channel "$FLAKES_CHANNEL" \ + --runner "$CI_RUNNER_DESCRIPTION" \ + --job "$CI_JOB_ID" \ + --url "$CI_JOB_URL" \ + --branch "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-$CI_COMMIT_BRANCH}" \ + --branch-title "${CI_MERGE_REQUEST_TITLE:-$CI_COMMIT_TITLE}" +fi + +exit $GTEST_EXITCODE diff --git a/.gitlab-ci/prepare-artifacts.sh b/.gitlab-ci/prepare-artifacts.sh index 04c4c7ab24f..cbbe0a318cb 100755 --- a/.gitlab-ci/prepare-artifacts.sh +++ b/.gitlab-ci/prepare-artifacts.sh @@ -31,12 +31,11 @@ cp -Rp .gitlab-ci/piglit install/ cp -Rp .gitlab-ci/fossils.yml install/ cp -Rp .gitlab-ci/fossils install/ cp -Rp .gitlab-ci/fossilize-runner.sh install/ -cp -Rp .gitlab-ci/deqp-runner.sh install/ -cp -Rp .gitlab-ci/crosvm-runner.sh install/ cp -Rp .gitlab-ci/crosvm-init.sh install/ cp -Rp .gitlab-ci/*.txt install/ cp -Rp .gitlab-ci/report-flakes.py install/ cp -Rp .gitlab-ci/vkd3d-proton install/ +cp -Rp .gitlab-ci/*-runner.sh install/ find . -path \*/ci/\*.txt \ -o -path \*/ci/\*.toml \ -o -path \*/ci/\*traces\*.yml \ diff --git a/.gitlab-ci/test-source-dep.yml b/.gitlab-ci/test-source-dep.yml index cf7f7aebc4d..d654b928b30 100644 --- a/.gitlab-ci/test-source-dep.yml +++ b/.gitlab-ci/test-source-dep.yml @@ -398,6 +398,25 @@ when: on_success - when: never +.radeonsi-vaapi-rules: + stage: amd + rules: + - *ignore_scheduled_pipelines + - changes: + *mesa_core_file_list + when: on_success + - changes: + *gallium_core_file_list + when: on_success + - changes: + *radeonsi_file_list + when: on_success + - changes: &radeon_vcn_file_list + - src/gallium/frontends/va/**/* + - src/gallium/drivers/radeon/**/* + when: on_success + - when: never + .i915g-rules: stage: intel rules: diff --git a/src/gallium/drivers/radeonsi/ci/gitlab-ci.yml b/src/gallium/drivers/radeonsi/ci/gitlab-ci.yml index c0e8b08d219..3089742883f 100644 --- a/src/gallium/drivers/radeonsi/ci/gitlab-ci.yml +++ b/src/gallium/drivers/radeonsi/ci/gitlab-ci.yml @@ -46,3 +46,23 @@ radeonsi-stoney-piglit-gl:amd64: PIGLIT_PROFILES: quick_gl PIGLIT_JUNIT_RESULTS: 1 HWCI_START_XORG: 1 + +radeonsi-stoney-va:amd64: + extends: + - .lava-test:amd64 + - .radeonsi-stoney-test:amd64 + - .radeonsi-vaapi-rules + variables: + HWCI_TEST_SCRIPT: "/install/gtest-runner.sh" + # While the tests don't need Xorg, it's an easy way to keep DRM open so we don't + # spend all our time in drm_lastclose()'s modesetting. + HWCI_START_XORG: 1 + GTEST: test_va_api + # The big 10-surface 10k allocations oomkill us at around 2.5G of GPU memory + # allocated if we run at the normal 4 threads. + # https://github.com/intel/libva-utils/issues/248 + FDO_CI_CONCURRENT: 1 + # A whole run would be about 25 minutes currently. Fixing + # https://github.com/intel/libva-utils/issues/247 and + # https://github.com/google/googletest/issues/3614 would probably help. + GTEST_FRACTION: 5 diff --git a/src/gallium/drivers/radeonsi/ci/radeonsi-stoney-fails.txt b/src/gallium/drivers/radeonsi/ci/radeonsi-stoney-fails.txt index 3c002828f51..f56ce121a49 100644 --- a/src/gallium/drivers/radeonsi/ci/radeonsi-stoney-fails.txt +++ b/src/gallium/drivers/radeonsi/ci/radeonsi-stoney-fails.txt @@ -99,3 +99,26 @@ spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp@sRGB decode ful spec@khr_texture_compression_astc@sliced-3d-miptree-gles srgb-fp,Fail spec@khr_texture_compression_astc@sliced-3d-miptree-gl srgb-fp,Fail spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3,Fail + +CreateContext/VAAPICreateContext.CreateContext/1035,Crash +CreateContext/VAAPICreateContext.CreateContext/1120,Crash +CreateContext/VAAPICreateContext.CreateContext/1205,Crash +CreateContext/VAAPICreateContext.CreateContext/1290,Crash +CreateContext/VAAPICreateContext.CreateContext/1375,Crash +CreateContext/VAAPICreateContext.CreateContext/1545,Crash +CreateContext/VAAPICreateContext.CreateContext/1715,Crash +CreateContext/VAAPICreateContext.CreateContext/185,Crash +CreateContext/VAAPICreateContext.CreateContext/2055,Crash +CreateContext/VAAPICreateContext.CreateContext/2225,Crash +CreateContext/VAAPICreateContext.CreateContext/2310,Crash +CreateContext/VAAPICreateContext.CreateContext/2905,Crash +CreateContext/VAAPICreateContext.CreateContext/3075,Crash +CreateContext/VAAPICreateContext.CreateContext/355,Crash +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigNoAttributes/190,Fail +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigNoAttributes/195,Fail +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigNoAttributes/210,Fail +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigNoAttributes/215,Fail +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigWithAttributes/190,Fail +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigWithAttributes/195,Fail +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigWithAttributes/210,Fail +GetCreateConfig/VAAPIGetCreateConfig.CreateConfigWithAttributes/215,Fail