Also, adds an example job for radv.
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
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
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.
--- /dev/null
+#!/bin/sh
+
+set -ex
+
+ARTIFACTS="$(pwd)/artifacts"
+
+# Set up the driver environment.
+export LD_LIBRARY_PATH="$(pwd)/install/lib/"
+
+# Set environment for renderdoc libraries.
+export PYTHONPATH="$PYTHONPATH:/renderdoc/build/lib"
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/renderdoc/build/lib"
+
+# Perform a self-test to ensure tracie is working properly.
+"$ARTIFACTS/tracie/tests/test.sh"
+
+ret=0
+
+# The renderdoc version we use can handle surfaceless.
+EGL_PLATFORM=surfaceless DISPLAY= \
+ "$ARTIFACTS/tracie/tracie.sh" "$ARTIFACTS/traces.yml" renderdoc \
+ || ret=1
+
+# We need a newer waffle to use surfaceless with apitrace. For now run with
+# xvfb.
+xvfb-run --server-args="-noreset" sh -c \
+ "set -ex; \
+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; \
+ export PATH=/apitrace/build:\$PATH; \
+ \"$ARTIFACTS/tracie/tracie.sh\" \"$ARTIFACTS/traces.yml\" apitrace" \
+ || ret=1
+
+exit $ret
--- /dev/null
+#!/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
+++ /dev/null
-#!/bin/sh
-
-set -ex
-
-ARTIFACTS="$(pwd)/artifacts"
-
-# Set up the driver environment.
-export LD_LIBRARY_PATH="$(pwd)/install/lib/"
-
-# Set environment for renderdoc libraries.
-export PYTHONPATH="$PYTHONPATH:/renderdoc/build/lib"
-export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/renderdoc/build/lib"
-
-# Perform a self-test to ensure tracie is working properly.
-"$ARTIFACTS/tracie/tests/test.sh"
-
-ret=0
-
-# The renderdoc version we use can handle surfaceless.
-EGL_PLATFORM=surfaceless DISPLAY= \
- "$ARTIFACTS/tracie/tracie.sh" "$ARTIFACTS/traces.yml" renderdoc \
- || ret=1
-
-# We need a newer waffle to use surfaceless with apitrace. For now run with
-# xvfb.
-xvfb-run --server-args="-noreset" sh -c \
- "set -ex; \
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH; \
- export PATH=/apitrace/build:\$PATH; \
- \"$ARTIFACTS/tracie/tracie.sh\" \"$ARTIFACTS/traces.yml\" apitrace" \
- || ret=1
-
-exit $ret
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.
### 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
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
### 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/<builddir>/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`.