1 | #!/usr/bin/env bash
|
---|
2 | # shellcheck disable=SC2086 # we want word splitting
|
---|
3 |
|
---|
4 | set -ex
|
---|
5 |
|
---|
6 | if [[ -z "$VK_DRIVER" ]]; then
|
---|
7 | exit 1
|
---|
8 | fi
|
---|
9 |
|
---|
10 | # Useful debug output, you rarely know what envirnoment you'll be
|
---|
11 | # running in within container-land, this can be a landmark.
|
---|
12 | ls -l
|
---|
13 |
|
---|
14 | INSTALL=$(realpath -s "$PWD"/install)
|
---|
15 | RESULTS=$(realpath -s "$PWD"/results)
|
---|
16 |
|
---|
17 | # Set up the driver environment.
|
---|
18 | # Modifiying here directly LD_LIBRARY_PATH may cause problems when
|
---|
19 | # using a command wrapper. Hence, we will just set it when running the
|
---|
20 | # command.
|
---|
21 | export __LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$INSTALL/lib/"
|
---|
22 |
|
---|
23 | # Sanity check to ensure that our environment is sufficient to make our tests
|
---|
24 | # run against the Mesa built by CI, rather than any installed distro version.
|
---|
25 | MESA_VERSION=$(sed 's/\./\\./g' "$INSTALL/VERSION")
|
---|
26 |
|
---|
27 | # Force the stdout and stderr streams to be unbuffered in python.
|
---|
28 | export PYTHONUNBUFFERED=1
|
---|
29 |
|
---|
30 | # Set the Vulkan driver to use.
|
---|
31 | export VK_ICD_FILENAMES="$INSTALL/share/vulkan/icd.d/${VK_DRIVER}_icd.x86_64.json"
|
---|
32 | if [ "${VK_DRIVER}" = "radeon" ]; then
|
---|
33 | # Disable vsync
|
---|
34 | export MESA_VK_WSI_PRESENT_MODE=mailbox
|
---|
35 | export vblank_mode=0
|
---|
36 | fi
|
---|
37 |
|
---|
38 | # Set environment for Wine.
|
---|
39 | export WINEDEBUG="-all"
|
---|
40 | export WINEPREFIX="/dxvk-wine64"
|
---|
41 | export WINEESYNC=1
|
---|
42 |
|
---|
43 | # Wait for amdgpu to be fully loaded
|
---|
44 | sleep 1
|
---|
45 |
|
---|
46 | # Avoid having to perform nasty command pre-processing to insert the
|
---|
47 | # wine executable in front of the test executables. Instead, use the
|
---|
48 | # kernel's binfmt support to automatically use Wine as an interpreter
|
---|
49 | # when asked to load PE executables.
|
---|
50 | # TODO: Have boot2container mount this filesystem for all jobs?
|
---|
51 | mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
|
---|
52 | echo ':DOSWin:M::MZ::/usr/bin/wine64:' > /proc/sys/fs/binfmt_misc/register
|
---|
53 |
|
---|
54 | # Set environment for DXVK.
|
---|
55 | export DXVK_LOG_LEVEL="info"
|
---|
56 | export DXVK_LOG="$RESULTS/dxvk"
|
---|
57 | [ -d "$DXVK_LOG" ] || mkdir -pv "$DXVK_LOG"
|
---|
58 | export DXVK_STATE_CACHE=0
|
---|
59 |
|
---|
60 | # Set environment for replaying traces.
|
---|
61 | export PATH="/apitrace-msvc-win64/bin:/gfxreconstruct/build/bin:$PATH"
|
---|
62 |
|
---|
63 | SANITY_MESA_VERSION_CMD="vulkaninfo"
|
---|
64 |
|
---|
65 | # Set up the Window System Interface (WSI)
|
---|
66 | # TODO: Can we get away with GBM?
|
---|
67 | if [ "${TEST_START_XORG:-0}" -eq 1 ]; then
|
---|
68 | "$INSTALL"/common/start-x.sh "$INSTALL"
|
---|
69 | export DISPLAY=:0
|
---|
70 | fi
|
---|
71 |
|
---|
72 | wine64 --version
|
---|
73 |
|
---|
74 | SANITY_MESA_VERSION_CMD="$SANITY_MESA_VERSION_CMD | tee /tmp/version.txt | grep \"Mesa $MESA_VERSION\(\s\|$\)\""
|
---|
75 |
|
---|
76 | RUN_CMD="export LD_LIBRARY_PATH=$__LD_LIBRARY_PATH; $SANITY_MESA_VERSION_CMD"
|
---|
77 |
|
---|
78 | set +e
|
---|
79 | if ! eval $RUN_CMD;
|
---|
80 | then
|
---|
81 | printf "%s\n" "Found $(cat /tmp/version.txt), expected $MESA_VERSION"
|
---|
82 | fi
|
---|
83 | set -e
|
---|
84 |
|
---|
85 | # Just to be sure...
|
---|
86 | chmod +x ./valvetraces-run.sh
|
---|
87 | ./valvetraces-run.sh
|
---|