From 0ac731b1ff96de46998948aa06081efa5140d50e Mon Sep 17 00:00:00 2001 From: Andres Gomez Date: Thu, 20 Feb 2020 18:26:30 +0200 Subject: [PATCH] gitlab-ci: Add jobs to be able to test Vulkan Also, adds an example job for radv. Signed-off-by: Andres Gomez Reviewed-by: Samuel Pitoiset Reviewed-by: Alexandros Frantzis --- .gitlab-ci.yml | 28 +++++++++++-- .gitlab-ci/prepare-artifacts.sh | 3 +- .../{tracie-runner.sh => tracie-runner-gl.sh} | 0 .gitlab-ci/tracie-runner-vk.sh | 28 +++++++++++++ .gitlab-ci/tracie/README.md | 48 +++++++++++++++++----- 5 files changed, 92 insertions(+), 15 deletions(-) rename .gitlab-ci/{tracie-runner.sh => tracie-runner-gl.sh} (100%) create mode 100755 .gitlab-ci/tracie-runner-vk.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 999f4c0..63d3539 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -722,19 +722,39 @@ radv_polaris10_vkcts: tags: - polaris10 +# Traces CI .traces-test: - extends: - - .test-gl cache: key: ${CI_JOB_NAME} paths: - .git-lfs-storage/ + +.traces-test-gl: + extends: + - .test-gl + - .traces-test script: - - ./artifacts/tracie-runner.sh + - ./artifacts/tracie-runner-gl.sh + +.traces-test-vk: + extends: + - .test-vk + - .traces-test + script: + - ./artifacts/tracie-runner-vk.sh llvmpipe-traces: + extends: .traces-test-gl variables: LIBGL_ALWAYS_SOFTWARE: "true" GALLIUM_DRIVER: "llvmpipe" DEVICE_NAME: "gl-vmware-llvmpipe" - extends: .traces-test + +radv-polaris10-traces: + extends: + - .traces-test-vk + - .test-radv + variables: + DEVICE_NAME: "vk-amd-polaris10" + tags: + - polaris10 diff --git a/.gitlab-ci/prepare-artifacts.sh b/.gitlab-ci/prepare-artifacts.sh index 1d259ad..9391052 100755 --- a/.gitlab-ci/prepare-artifacts.sh +++ b/.gitlab-ci/prepare-artifacts.sh @@ -28,7 +28,8 @@ cp -Rp .gitlab-ci/deqp* artifacts/ cp -Rp .gitlab-ci/piglit artifacts/ cp -Rp .gitlab-ci/traces.yml artifacts/ cp -Rp .gitlab-ci/tracie artifacts/ -cp -Rp .gitlab-ci/tracie-runner.sh artifacts/ +cp -Rp .gitlab-ci/tracie-runner-gl.sh artifacts/ +cp -Rp .gitlab-ci/tracie-runner-vk.sh artifacts/ # Tar up the install dir so that symlinks and hardlinks aren't each # packed separately in the zip file. diff --git a/.gitlab-ci/tracie-runner.sh b/.gitlab-ci/tracie-runner-gl.sh similarity index 100% rename from .gitlab-ci/tracie-runner.sh rename to .gitlab-ci/tracie-runner-gl.sh diff --git a/.gitlab-ci/tracie-runner-vk.sh b/.gitlab-ci/tracie-runner-vk.sh new file mode 100755 index 0000000..81ac001 --- /dev/null +++ b/.gitlab-ci/tracie-runner-vk.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +set -ex + +ARTIFACTS="$(pwd)/artifacts" + +# Set the Vulkan driver to use. +export VK_ICD_FILENAMES="$(pwd)/install/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json" + +# Set environment for VulkanTools' VK_LAYER_LUNARG_screenshot layer. +export VK_LAYER_PATH="$VK_LAYER_PATH:/VulkanTools/build/etc/vulkan/explicit_layer.d" +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/VulkanTools/build/lib" + +# Perform a self-test to ensure tracie is working properly. +"$ARTIFACTS/tracie/tests/test.sh" + +ret=0 + +# Run gfxreconstruct traces against the host's running X server (xvfb +# doesn't have DRI3 support). +# Set the DISPLAY env variable in each gitlab-runner's configuration +# file: +# https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runners-section +PATH="/gfxreconstruct/build/bin:$PATH" \ + "$ARTIFACTS/tracie/tracie.sh" "$ARTIFACTS/traces.yml" gfxreconstruct \ + || ret=1 + +exit $ret diff --git a/.gitlab-ci/tracie/README.md b/.gitlab-ci/tracie/README.md index 8ea51c6..e7fccfa 100644 --- a/.gitlab-ci/tracie/README.md +++ b/.gitlab-ci/tracie/README.md @@ -50,15 +50,29 @@ individually, thus reducing storage requirements during CI runs. To enable trace testing on a new device: 1. Create a new job in .gitlab-ci.yml. The job will need to be tagged - to run on runners with the appropriate hardware. Use the `.traces-test` - template job as a base, and make sure you set a unique value for the - `DEVICE_NAME` variable: + to run on runners with the appropriate hardware. + + 1. If you mean to test GL traces, use the `.traces-test-gl` + template jobs as a base, and make sure you set a unique value for the + `DEVICE_NAME` variable: ```yaml - my-hardware-traces: + my-hardware-gl-traces: extends: .traces-test-gl variables: - DEVICE_NAME: "myhardware" + DEVICE_NAME: "gl-myhardware" + ``` + + 2. If you mean to test Vulkan traces, use the `.traces-test-vk` + template jobs as a base, set the `VK_DRIVER` variable, and make + sure you set a unique value for the `DEVICE_NAME` variable: + + ```yaml + my-hardware-vk-traces: + extends: .traces-test-vk + variables: + VK_DRIVER: "radeon" + DEVICE_NAME: "vk-myhardware" ``` 2. Update the .gitlab-ci/traces.yml file with expectations for the new device. @@ -68,8 +82,9 @@ To enable trace testing on a new device: ### Trace files -Tracie supports both renderdoc (.rdc) and apitrace (.trace) files. Trace files -need to have the correct extension so that tracie can detect them properly. +Tracie supports renderdoc (.rdc), apitrace (.trace) and gfxreconstruct +(.gfxr) files. Trace files need to have the correct extension so that +tracie can detect them properly. The trace files that are contained in public traces-db repositories must be legally redistributable. This is typically true for FOSS games and @@ -83,7 +98,8 @@ Mesa traces CI uses a set of scripts to replay traces and check the output against reference checksums. The high level script [tracie.sh](.gitlab-ci/tracie/tracie.sh) accepts -a traces definition file and the type of traces (apitrace/renderdoc) to run: +a traces definition file and the type of traces +(apitrace/renderdoc/gfxreconstruct) to run: tracie.sh .gitlab-ci/traces.yml renderdoc @@ -116,11 +132,23 @@ Examples: ### Running the replay scripts locally It's often useful, especially during development, to be able to run the scripts -locally. The scripts require a recent version of apitrace being in the path, -and also the renderdoc python module being available. +locally. + +Depending on the target 3D API, the scripts require a recent version +of apitrace being in the path, and also the renderdoc python module +being available, for GL traces. To ensure python3 can find the renderdoc python module you need to set `PYTHONPATH` to point to the location of `renderdoc.so` (binary python modules) and `LD_LIBRARY_PATH` to point to the location of `librenderdoc.so`. In the renderdoc build tree, both of these are in `renderdoc//lib`. Note that renderdoc doesn't install the `renderdoc.so` python module. + +In the case of Vulkan traces, the scripts need a recent version of +gfxrecon-replay being in the path, and also the +`VK_LAYER_LUNARG_screenshot` Vulkan layer from LunarG's VulkanTools. + +To ensure that this layer can be found when running the trace you need +to set `VK_LAYER_PATH` to point to the location of +`VkLayer_screenshot.json` and `LD_LIBRARY_PATH` to point to the +location of `libVkLayer_screenshot.so`. -- 2.7.4