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