Repository navigation
Debugging Tool Vulkan Validation Layers
← Debugging Tools and Commands
The Khronos validation layer intercepts Vulkan calls and reports API misuse that drivers are not required to diagnose. Use it for object lifetime, parameter, descriptor, command-buffer, render-pass, and synchronization investigations.
| Property | Details |
|---|---|
| Supported OS | Windows, Linux, macOS through portability implementations, and Android |
| Layer | VK_LAYER_KHRONOS_validation |
| Download | Install the current LunarG Vulkan SDK or platform validation-layer package. |
| Verify |
vulkaninfo --summary and vulkaninfo | Select-String VK_LAYER_KHRONOS_validation on PowerShell |
| Output | Vulkan debug-messenger messages containing severity, type, message ID/VUID, objects, and call context |
Use validation when a graphics failure suggests:
- invalid object lifetime or destruction order;
- descriptor, image-view, render-pass, or pipeline incompatibility;
- missing or incorrect image/buffer barriers;
- simultaneous or conflicting resource access;
- invalid command-buffer state;
- out-of-bounds shader/resource use that GPU-assisted validation can observe;
- a problem that differs across drivers because undefined Vulkan behavior is involved.
Validation does not verify Xbox/NV2A semantics, game rendering intent, shader arithmetic, correct pixels, or performance. A clean log narrows the investigation but does not prove correctness.
Install the SDK or distribution package, then confirm that the Vulkan loader can enumerate the layer.
vulkaninfo --summary
vulkaninfo | Select-String 'VK_LAYER_KHRONOS_validation'vulkaninfo --summary
vulkaninfo | rg 'VK_LAYER_KHRONOS_validation'If enumeration fails, verify the selected process architecture, Vulkan loader, layer manifest paths, SDK environment, and GPU driver before changing xemu.
Use an isolated diagnostic configuration. The relevant TOML shape is:
[display]
renderer = "VULKAN"
[display.vulkan]
validation_layers = true
assert_on_validation_msg = falseKeep assert_on_validation_msg false for evidence collection unless the investigation explicitly needs a debugger break. An assertion can stop the run at the first message and hide later context.
Confirm effective enablement in xemu's log. The configuration request is not proof that the layer was found and loaded.
- Reproduce with an exact optimized diagnostic executable and isolated configuration.
- Start logging before xemu initializes Vulkan.
- Reproduce the shortest deterministic failing sequence.
- Retain complete messages, including VUID/message ID, object handles/types, severity, and surrounding xemu markers.
- Deduplicate repeated messages by VUID and relevant object/state, while preserving counts and first/last occurrence.
- Locate each VUID in the Vulkan specification.
- Trace the reported host object back to its renderer-owned guest resource and lifetime.
- Implement one focused correction, rerun validation, then validate rendering without layers.
Synchronization validation tracks conflicting buffer/image accesses around draws, dispatches, copies, clears, and barriers. Enable it with Vulkan Configurator or the layer-settings mechanism supplied by the installed SDK.
A typical vk_layer_settings.txt entry is:
khronos_validation.enables = VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION_EXT
Record the exact settings file and SDK/layer version. Do not assume core validation implies synchronization validation was active.
Synchronization validation can report a hazard between host Vulkan operations. It cannot by itself prove which guest NV2A rule was intended or whether the visible defect is caused by that hazard.
GPU-assisted validation instruments shaders to detect some GPU-time resource errors. It can materially alter shader code, descriptor use, memory pressure, pipeline creation, and timing.
Use it only after core validation and a narrow target justify the extra perturbation. Record whether shader instrumentation, descriptor validation, or reserve-binding-slot features were enabled. Do not use GPU-assisted results as ordinary performance evidence.
Retain the whole record. The useful fields are:
severity and type
VUID or message ID
Vulkan command
object type and handle
reported access/stage/layout/range
xemu draw/submit/resource identity near the message
Look up the VUID in the current Vulkan specification. Fix the violated contract at the ownership boundary rather than filtering the message because one driver appears to tolerate it.
Warnings and best-practice messages are not automatically correctness failures. Classify them by the referenced rule, actual renderer contract, and reproduction.
- Running a performance comparison with validation enabled on only one role.
- Treating an empty log as proof that the layer loaded.
- Setting an environment variable to
0when the program treats any nonempty value as enabled or as a file path. - Enabling core, synchronization, and GPU-assisted validation together without recording the configuration.
- Publishing only a cropped line that omits the VUID and object context.
- Suppressing a repeated message before counting when and where it occurs.
- Changing queue waits or fence assertions to hide a device-loss symptom.
- Assuming a validation-clean run rules out host-memory races, incorrect guest translation, or shader logic bugs.
Validation is diagnostic instrumentation and can be expensive. Keep it disabled in release and acceptance-performance configurations. After the run:
- restore
validation_layers = false; - remove temporary layer settings and SDK override variables;
- confirm the next ordinary run does not load validation;
- retain the diagnostic config separately from the release config.
- xemu commit/tree and executable SHA-256;
- Vulkan loader, SDK/layer, GPU, and driver versions;
- full effective xemu configuration and layer settings;
- complete log and reproduction timestamps;
- whether core, synchronization, GPU-assisted, or best-practices validation was enabled;
- VUID counts and the first relevant occurrence;
- rendering result with validation enabled and again after the fix with validation disabled.
DSP tooling guide and navigation updated November 2, 2026 for experimental PR #384, source 8f51d237. Capture/replay usage and limits.
The earlier wiki-wide review was published November 1, 2026. Emulator source: b7140848. Reviewed wiki content: 1d2b671. Current status · Release availability · Publication process.
- Home
- Current status
- Stable versus main
- Implemented mechanisms
- Controls and defaults
- Measured results and limits
- Complete change register
- System
- CPU and vCPU
- Memory and DMA
- Graphics / NV2A
- APU and audio
- Timing and timers
- Platform and I/O
- Hardware observations
- Fidelity boundaries
- Methodology
- PGR2 routes
- Debugging lag / hot paths
- Tools and commands
- DSP capture, replay and fuzzing
- HLE readiness and public XISO proof
- Concurrent DSP shadow and OpenAL proof
- DSP HLE operation inventory
- DSP HLE fix examples and testing
- Development
- Upstream shortlist
- Wiki maintenance
- Research / retired work
- Optimization catalog
- Hot-path shortcuts
- Researched experiments
- Unproven proposal directory
- PR lessons
- September26 snapshot
Repository · PRs · Issues