Files
mandy/.github/workflows/runtime.yml
NRXM 49f4958a4b CI: run the GPU tests on Mesa llvmpipe
The linux-gpu-tools job built the GPU test programs but never ran them.
It now installs llvmpipe (software Vulkan), llvm-mc and SPIRV-Tools and
runs scripts/run_gpu_tests.py twice: natively (31 pass, 29 expected
skips: 8-wide subgroups, no fragment barycentrics) and the compute tests
with LEONIDA_W64_EMULATE=1 (33 pass). The emulated mesh tests are left
out because llvmpipe's compiler aborts on them. docs/testing.md gets a
section on running the suite without a GPU.

AI-assisted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D7JEiKsTUaHQbCTdc4Eghy
2026-11-21 23:39:29 +00:00

66 lines
2.9 KiB
YAML

# Builds the loader (runtime/) with MSVC on every push and pull request, as scripts/build_runtime.ps1 does, so a
# change that breaks the C++ build shows up in CI. Without the Vulkan SDK the GPU test tools are skipped.
name: Runtime
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: runtime-${{ github.ref }}
cancel-in-progress: true
jobs:
windows:
runs-on: windows-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
- name: Configure
run: cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build
run: cmake --build runtime/build
- name: CPU runtime tests
run: ctest --test-dir runtime/build --output-on-failure
# Also runs the hand-written GPU tests (runtime/test/shaders) on Mesa's llvmpipe, a software Vulkan driver, so a
# translator or harness change that breaks a test result shows up on every pull request, without a GPU.
linux-gpu-tools:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install Vulkan SDK, llvmpipe, llvm-mc and SPIRV-Tools
run: |
sudo apt-get update
sudo apt-get install -y libvulkan-dev cmake ninja-build g++ mesa-vulkan-drivers vulkan-tools spirv-tools llvm-18
- name: Configure
run: cmake -S runtime -B runtime/build -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo
- name: Build
run: cmake --build runtime/build --parallel
- name: Check GPU tools exist
run: |
for tool in vk_harness vk_pipeline_check vk_command_replay_test vk_compute_test vk_texture_test vk_store_test d3d12_state_map_test command_list_test; do
if [ ! -f "runtime/build/$tool" ] && [ ! -f "runtime/build/$tool.exe" ]; then
echo "Missing: $tool"
exit 1
fi
done
echo "All GPU tools built"
- name: GPU tests on llvmpipe
run: |
vulkaninfo --summary | grep -E 'deviceName.*llvmpipe' # fails the step if llvmpipe isn't there
python3 -I scripts/run_gpu_tests.py --build runtime/build --llvm-mc /usr/lib/llvm-18/bin/llvm-mc --work "$RUNNER_TEMP/gpu-native"
- name: GPU tests on llvmpipe, compute with wave64 emulation
# llvmpipe has 8-wide subgroups, so the wave64 compute tests only run emulated. The emulated mesh tests are
# left out: llvmpipe's LLVM backend aborts compiling them ("Cannot emit physreg copy instruction").
env:
LEONIDA_W64_EMULATE: "1"
run: python3 -I scripts/run_gpu_tests.py --build runtime/build --llvm-mc /usr/lib/llvm-18/bin/llvm-mc --work "$RUNNER_TEMP/gpu-w64" --filter cs_