Skip to content

CI: build Windows Vulkan/COM targets via Vulkan-Headers and add sccache - #439

Merged
ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
sombraSoft:ci/runtime-vulkan-sccache
Nov 22, 2026
Merged

ItsNotRexed merged 2 commits into
ItsNotRexed:mainfrom
sombraSoft:ci/runtime-vulkan-sccache

Conversation

@sombraSoft

@sombraSoft sombraSoft commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Depends on: #435

What and why

Part of #418 (step 8). Unlocks Windows compilation and CPU ctest coverage for Vulkan::Headers-gated targets without installing the multi-GB LunarG Vulkan SDK, and adds sccache compiler caching to both windows and linux-gpu-tools in .github/workflows/runtime.yml:

  • runtime/CMakeLists.txt: adds a header-only Vulkan::Headers fallback (find_path(Vulkan_INCLUDE_DIR NAMES vulkan/vulkan.h HINTS "$ENV{VULKAN_SDK}/Include" "$ENV{VULKAN_SDK}/include")) when find_package(Vulkan QUIET) does not find a full SDK, and gates the Vulkan/COM/test targets on if(TARGET Vulkan::Headers) instead of if(Vulkan_FOUND). Full LunarG SDK and Linux libvulkan-dev setups work unchanged; missing headers still degrade gracefully.
  • Windows Vulkan headers + Python 3.12: caches KhronosGroup/Vulkan-Headers tag vulkan-sdk-1.4.363.0 via actions/cache, sets VULKAN_SDK, and sets up Python 3.12 for deterministic tools/gen_d3d12_stubs.py execution. This compiles gta6rt_d3d12_com and d3d12_uint_clear_test and runs all Vulkan/COM CPU tests in CI (ctest 20/20 on GitHub-hosted windows-latest).
  • sccache on Windows + Linux: installs mozilla-actions/sccache-action (v0.0.11) with SCCACHE_GHA_ENABLED=true, passes -DCMAKE_CXX_COMPILER_LAUNCHER=sccache, passes -DCMAKE_POLICY_DEFAULT_CMP0141=NEW -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded on Windows (emitting -Z7 so MSVC objects are cacheable), and prints sccache --show-stats.

Action SHA verification

Action Tag Pinned Commit SHA
actions/checkout v7.0.1 3d3c42e5aac5ba805825da76410c181273ba90b1
actions/setup-python v7.1.0 6d4fd22b20465ccc0f7354476588e8df7c9ca0e0
ilammy/msvc-dev-cmd v1.13.0 0b201ec74fa43914dc39ae48a89fd1d8cb592756
mozilla-actions/sccache-action v0.0.11 fc920bf0ec8de6ee65d409111f7ec508035751ba
actions/cache v6.1.0 55cc8345863c7cc4c66a329aec7e433d2d1c52a9

AI-assisted contribution.

Tested

  • CPU only, no game files or physical GPU required.
  • Green fork CI on GitHub-hosted Windows/Ubuntu: https://github.com/sombraSoft/Leonida/actions/runs/44964806953
    • windows: 2m26s (cold cache), sccache 80/80 cacheable (0 non-cacheable), ctest 20/20 passed in 1.46s.
    • linux-gpu-tools: 45s (cold cache), sccache 12/12 cacheable (0 non-cacheable), ctest 5/5 passed in 0.02s.
  • Windows MSVC 19.51 + Ninja locally with header-only KhronosGroup/Vulkan-Headers vulkan-sdk-1.4.363.0: 114/114 targets built, build.ninja confirmed -Z7 (no /Zi), unset VULKAN_SDK gracefully logs Vulkan headers not found.
  • jactionlint v2.6.0 (shellcheck 0.11.0): --profile correctness and --profile default .github/workflows/runtime.yml -> exit 0, 0 findings.

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (N/A — CMake and CI workflow only)

@kotorvr

kotorvr commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 0554ba3 on RTX 4090 (driver 621.14), Windows 11 26200, MSVC 19.44: pass

  • Clean RelWithDebInfo Ninja build of runtime/ (Vulkan SDK 1.4.363.0), then ctest --test-dir runtime/build --output-on-failure: 18/18 passed.
  • GPU tests with LEONIDA_VK_VALIDATION=1 and VK_LAYER_KHRONOS_validation: d3d12_com_test, d3d12_descriptor_test, d3d12_uint_clear_test, d3d12_vulkan_device_test, vk_command_replay_test all exit 0, with 0 validation messages.

This is a local build with the full Vulkan SDK, not the CI's header-only setup. It shows the CMake changes don't break the SDK path.

No game files used. AI-assisted run (Claude Code).

@sombraSoft
sombraSoft force-pushed the ci/runtime-vulkan-sccache branch from 0554ba3 to 35321bd Compare November 22, 2026 00:19
@Capi360

Capi360 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested 35321bd on Windows 11 x64 with CMake 3.31.6, the Visual Studio 2022 x64 generator, MSVC 19.44, Windows SDK 10.0.28000.0, and the pinned Vulkan-Headers 6802bb4.

  • The header-only fallback configured with Vulkan_LIBRARY-NOTFOUND and built the Vulkan/COM targets. The build stopped at d3d12_state_map_test.cpp:120 with C2065: SDK 10.0.28000.0 omits D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON. That assertion is also on main.
  • I put the compatibility fix in Keep barrier state tests compatible with newer Windows SDKs #531. With that one test change applied to the same checkout, the build finished and all 19 registered CTest entries succeeded (package-dependent and opt-in portions skipped). I also compiled and ran the fixed test with SDK 10.0.26100.0.
  • A separate configure without Vulkan headers generated the core runtime and skipped the Vulkan targets as expected.

AI-assisted testing.

@sombraSoft

sombraSoft commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @kotorvr for verifying the full LunarG Vulkan SDK 1.4.363.0 + RTX 4090 validation path, and thanks @VictorJulianiR for the supply-chain review!

Rebased onto main (91b36cf) + #435 (3ef8f4f) in 8f3fc8b and addressed both review notes:

  1. Replaced the unverified tag zip download with pinned actions/checkout@3d3c42e5... # v7.0.1 fetching KhronosGroup/Vulkan-Headers at commit 6802bb4733b63ed5efd3adb308a6c885ef180ea1 (vulkan-sdk-1.4.363.0, sparse-checkout: include, persist-credentials: false), cached under .vulkan-headers/include by exact commit SHA.
  2. Dropped the redundant manual sccache --show-stats step from both jobs since sccache-action's Post step already prints the stats.

Verified live on fork CI:

Upstream CI is also running directly on this PR now.

@ItsNotRexed
ItsNotRexed merged commit 0288f1a into ItsNotRexed:main Nov 22, 2026
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants