Skip to content

Vulkan device-filter CTest: distinguish unavailable hardware from probe failure - #9698

Closed
LukeOsland1 wants to merge 2 commits into
ProjectLeonida:mainfrom
LukeOsland1:codex/device-filter-probe-status
Closed

LukeOsland1 wants to merge 2 commits into
ProjectLeonida:mainfrom
LukeOsland1:codex/device-filter-probe-status

Conversation

@LukeOsland1

Copy link
Copy Markdown
Contributor

Depends on: #9605

The device-filter CTest treated every unsuccessful enumeration as a machine without a GPU. A synthetic enumerator exiting 23 made the old checker skip. The updated checker fails that case and includes the child diagnostic.

The bench has an explicit device-availability probe that distinguishes absent loader, compatible ICD or physical device from unexpected Vulkan errors. The checker verifies both the status and the diagnostic. A subprocess regression covers success, genuine unavailability and unrelated failures including an unrecognized exit 77. The list interface retains its existing behavior.

Windows 11 26300, MSVC 19.51.36248, Vulkan SDK 1.4.341.1. Five focused CTests passed: vulkan_device_filter, vk_device_filter_tools, vk_device_filter_probe_status, vk_device_pick and vk_descriptor_bench_selftest. Selecting a nonexistent Vulkan ICD produced the expected CTest skip. Real quick benchmarks selected both the RTX 4070 Ti SUPER (32.0.16.1088) and AMD Radeon(TM) Graphics (32.0.21042.62). Synthetic inputs only. AI-assisted implementation and testing.

Original claim, no new item ID assigned · Reported preflight failure

adamraskin and others added 2 commits November 23, 2026 16:36
…T-1141)

Both tools ranked the devices themselves and ignored LEONIDA_VK_DEVICE,
so on a PC with two GPUs they ran on the best-ranked one whatever the
filter said. vk_sandbox now uses vk_device_pick.h's pick_device, and
vk_descriptor_bench skips devices the filter leaves out. When the filter
matches no usable device, both report it and fail the run, as the other
harnesses do.

check_device_filter_tools.py (ctest vk_device_filter_tools) runs both
tools with a filter that matches nothing and skips on a machine with no
Vulkan device.
@adorted

adorted commented Nov 23, 2026

Copy link
Copy Markdown

Tested 41dc23ce1 merged onto main 5d74c2723 (clean merge) on Windows 10 Pro 19045, NVIDIA GeForce RTX 5090, driver 610.88, MSVC 19.44.35230, Vulkan SDK 1.4.363.0, Python 3.13. No game files. Pass.

  • ctest -R ^vk_device_filter: vk_device_filter_tools and vk_device_filter_probe_status both pass.
  • vk_descriptor_bench --probe-device: device probe available: 1 Vulkan physical device(s), exit 0.
  • Positive filter, which the new test doesn't cover: LEONIDA_VK_DEVICE=5090 and LEONIDA_VK_DEVICE=geforce rtx 5090 (lowercase) both select NVIDIA GeForce RTX 5090 and vk_descriptor_bench --quick runs to completion, exit 0.
  • Negative filter: LEONIDA_VK_DEVICE=nosuchgpu gives LEONIDA_VK_DEVICE=nosuchgpu: no Vulkan physical device matches, exit 1, instead of falling back to the 5090.

Targeted build only (vk_descriptor_bench, vk_sandbox); the change doesn't touch shared runtime code.

AI-assisted (Claude Code).

@matheusfermiano-source

Copy link
Copy Markdown

checked: #9698@41dc23ce | parent: #9605@9538218e | Arch Linux x86-64, GCC 16.2.1, Radeon RADV RENOIR | 5/5 focused CTests

The follow-up fixes the exit-23 false skip I reported on #9605. A real Vulkan probe saw the Radeon with an unmatched filter set, and --list-devices still listed it. With no compatible ICD selected, the probe returned 77 and CTest marked the test skipped. In a separate build using compile-time Vulkan stand-ins, I drove the actual probe and Python checker through zero devices (77), instance creation error VK_ERROR_OUT_OF_HOST_MEMORY (1), and enumeration error VK_ERROR_INITIALIZATION_FAILED (1).

One startup distinction remains. load_vulkan() returns the same null pointer if the library is unavailable or if it was opened but is missing the required vkGetInstanceProcAddr export. The latter is a broken loader and currently becomes device probe unavailable: Vulkan loader not found with exit 77. I verified this by stubbing the open and symbol-lookup results at compile time. No installed library was involved.

In a Linux-only scratch refinement, passing the open-state alongside the function pointer makes the checker fail when a library opens without that export (1). The genuine unavailable cases still skip (77), and the create/enumeration errors still fail (1). It would be useful to preserve that distinction when adjusting the shared API in #9615.

Diff and no-game-data checks passed. Validation was limited to the focused tests and the probe. AI-assisted (Codex).

@Grimkaaah Grimkaaah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (Linux CPU) — PASS (self-test; Vulkan tools not run)

Checked

  • vk_descriptor_bench / vk_sandbox refuse a non-matching LEONIDA_VK_DEVICE instead of falling back; new CTest helper + probe-status self-test.
  • python3 -I runtime/test/check_device_filter_tools.py --self-test-probe-status → exit 0.

Not executed here: live Vulkan binaries against a real filter (needs built harnesses).

No game files. Reviewer: Grimkeh (AI-assisted Cursor / Composer).

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.

6 participants