VK_LAYER_KHRONOS_validation
Vulkan is an Explicit API, enabling direct control over how GPUs
actually work. By design, minimal error checking is done inside a Vulkan
driver - applications have full control and responsibility for correct
operation. Any errors in Vulkan usage can result in unexpected behavior
or even a crash. The VK_LAYER_KHRONOS_validation layer can
be used to to assist developers in isolating incorrect usage, and in
verifying that applications correctly use the API.
It is important to acknowledge there are a few limitations for what the Validation Layers can do.
Configuring the Validation Layer
There are 4 ways to configure the settings:
- Vulkan Configurator tool found in the SDK (most recommended)
application defined(at instance creation time)vk_layer_settings.txtenvironment variables
These are all described in the layers configuration documentation and more details in the Configuring Vulkan Layers whitepaper.
Vulkan Configurator
We suggest people to use Vulkan Configurator.
The GUI comes with the SDK, and takes the
VkLayer_khronos_validation.json file and does
everything for you!
Application Defined
The application can now use the VK_EXT_layer_settings
extension to do everything at vkCreateInstance time. (Don't
worry, we implement the extension, so it will be supported 100% of the
time!).
// Example how to turn on verbose mode for DebugPrintf
const VkBool32 verbose_value = true;
const VkLayerSettingEXT layer_setting = {"VK_LAYER_KHRONOS_validation", "printf_verbose", VK_LAYER_SETTING_TYPE_BOOL32_EXT, 1, &verbose_value};
VkLayerSettingsCreateInfoEXT layer_settings_create_info = {VK_STRUCTURE_TYPE_LAYER_SETTINGS_CREATE_INFO_EXT, nullptr, 1, &layer_setting};
VkInstanceCreateInfo instance_ci = GetYourCreateInfo();
instance_ci.pNext = &layer_settings_create_info;vk_layer_settings.txt
There is info elsewhere
to describe this file, but the short answer is to set the
VK_LAYER_SETTINGS_PATH like the following:
# windows
set VK_LAYER_SETTINGS_PATH=C:\path\to\vk_layer_settings.txt
# linux
export VK_LAYER_SETTINGS_PATH=/path/to/vk_layer_settings.txtand it will set things for you in that file. We have a default example file you can start with.
Environment Variables
This is done for us via the vkuCreateLayerSettingSet
call in the Vulkan-Utility-Libraries.
As an example, in our VkLayer_khronos_validation.json
file you will find something like
"key": "message_id_filter",.
From here you just need to adjust it the naming and prefix depending on your platform:
# Windows
set VK_LAYER_MESSAGE_ID_FILTER=VUID-VkInstanceCreateInfo-pNext-pNext
# Linux
export VK_LAYER_MESSAGE_ID_FILTER=VUID-VkInstanceCreateInfo-pNext-pNext
# Android
adb shell setprop debug.vulkan.khronos_validation.message_id_filter=VUID-VkInstanceCreateInfo-pNext-pNextLayer Settings
We suggest using Vulkan Configurator to discover the layer settings, but the following is generated per SDK version
The settings for this layer are specified in
VkLayer_khronos_validation.json. The settings details are
in khronos_validation_layer.html.
Layer Properties
- API Version: 1.4.356
- Implementation Version: 1
- Layer Manifest:
VkLayer_khronos_validation.json- File Format: 1.2.0
- Layer Binary:
libVkLayer_khronos_validation.so
- Variables:
vk_layer_settings.txtnamespace:khronos_validation- Environment Variable prefix:
VK_KHRONOS_VALIDATION_ - Android system property prefix:
adb shell setprop debug.vulkan.khronos_validation.
- Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID - Number of Layer Settings: 76
- Number of Layer Presets: 7
Layer Settings Overview
| Label | Variables Key | Type | Default Value | Platforms |
|---|---|---|---|---|
| CPU Centric Validation | validation_control |
GROUP |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Core | validate_core |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Shader | check_shaders |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Caching | check_shaders_caching |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Synchronization | validate_sync |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Submit time validation | syncval_submit_time_validation |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Shader accesses heuristic | syncval_shader_accesses_heuristic |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Error messages | syncval_reporting |
GROUP |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Extra properties | syncval_message_extra_properties |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Stateless Parameter | stateless_param |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Object Lifetime | object_lifetime |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Thread Safety | thread_safety |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Handle Wrapping | unique_handles |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Legacy Detection | legacy_detection |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| When to give warning | legacy_detection_mode |
ENUM |
ALWAYS |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Best Practices | validate_best_practices |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| ARM-specific best practices | validate_best_practices_arm |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| AMD-specific best practices | validate_best_practices_amd |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| IMG-specific best practices | validate_best_practices_img |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| NVIDIA-specific best practices | validate_best_practices_nvidia |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, ANDROID |
| GPU Centric Validation | validation_control_gpu |
GROUP |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Safe Mode | gpuav_safe_mode |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Force on robustness features | gpuav_force_on_robustness |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Shader instrumentation | gpuav_shader_instrumentation |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Ray tracing buffers consistency | gpuav_ray_tracing_buffers_consistency |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Scoped GPU-AV | gpuav_scoped |
GROUP |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Selective Instrument Shaders | gpuav_select_instrumented_shaders |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Shader/pipeline name regexes | gpuav_shaders_to_instrument |
LIST |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| CDL dump file | gpuav_cdl_dump_path |
LOAD_FILE |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| GPU Dump | gpu_dump |
GROUP |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Dump Descriptor Heap/Buffer | gpu_dump_descriptors |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Dump VK_KHR_copy_memory_indirect | gpu_dump_copy_memory_indirect |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Dump VK_EXT_device_generated_commands | gpu_dump_device_generated_commands |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Redirect all GPU Dump to stdout | gpu_dump_to_stdout |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Descriptor Hashing | descriptor_hashing |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Total expected descriptors used | descriptor_hashing_total_descriptors |
INT |
65536 |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Debug Printf | printf_enable |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Redirect Printf messages to stdout | printf_to_stdout |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Printf verbose | printf_verbose |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Printf buffer size | printf_buffer_size |
INT |
1024 |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS |
| Debug Action | debug_action |
FLAGS |
VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Log Filename | log_filename |
SAVE_FILE |
stdout |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Message Severity | report_flags |
FLAGS |
error, warn |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Limit Duplicated Messages | enable_message_limit |
BOOL |
true |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Max Duplicated Messages | duplicate_message_limit |
INT |
10 |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Mute Message VUIDs | message_id_filter |
LIST |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Message Format | message_format |
GROUP |
`` | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| JSON | message_format_json |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Display Application Name | message_format_display_application_name |
BOOL |
false |
WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
Layer Settings Details
CPU Centric Validation
Control the Validation done only on the CPU.
Sub-settings: Core, Synchronization, Stateless Parameter, Object Lifetime, Thread Safety, Handle Wrapping, Legacy Detection, and Best Practices.
- Key:
validation_control - Type:
GROUP - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
Core
The main, heavy-duty validation checks. This may be valuable early in the development cycle to reduce validation output while correcting parameter/object usage errors.
Learn more about the Core setting.
Sub-setting: Shader,
- Key:
validate_core - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.validate_core = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_VALIDATE_CORE=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.validate_core true |
Shader
This will validate the contents of the SPIR-V which can be CPU intensive during application start up. This does internal checks as well as calling spirv-val. (Same effect using VK_VALIDATION_FEATURE_DISABLE_SHADERS_EXT).
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Core | validate_core |
BOOL | true |
Sub-settings: Caching, and Disable spirv-val.
- Key:
check_shaders - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.check_shaders = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_CHECK_SHADERS=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.check_shaders true |
Caching
Creates an internal instance of VK_EXT_validation_cache and upon vkDestroyInstance, will cache the shader validation so sequential usage of the validation layers will be skipped.
All the following condition must be fulfilled for the setting to be applied.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Core | validate_core |
BOOL | true |
| Shader | check_shaders |
BOOL | true |
- Key:
check_shaders_caching - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.check_shaders_caching = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_CHECK_SHADERS_CACHING=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.check_shaders_caching true |
Synchronization
Check for resource access conflicts caused by missing or incorrectly used synchronization operations.
Learn more about the Synchronization setting.
Sub-settings: Submit time validation, Shader accesses heuristic, and Error messages.
- Key:
validate_sync - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.validate_sync = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_VALIDATE_SYNC=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.validate_sync false |
Submit time validation
Enable synchronization validation on the boundary between submitted command buffers. This also validates accesses from presentation operations. This option can incur a significant performance cost.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Synchronization | validate_sync |
BOOL | true |
- Key:
syncval_submit_time_validation - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.syncval_submit_time_validation = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_SYNCVAL_SUBMIT_TIME_VALIDATION=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.syncval_submit_time_validation true |
Shader accesses heuristic
Take into account memory accesses performed by the shader based on SPIR-V static analysis. Warning: can produce false-positives, can ignore certain types of accesses, does not support VK_EXT_descriptor_buffer.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Synchronization | validate_sync |
BOOL | true |
- Key:
syncval_shader_accesses_heuristic - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.syncval_shader_accesses_heuristic = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_SYNCVAL_SHADER_ACCESSES_HEURISTIC=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.syncval_shader_accesses_heuristic false |
Error messages
Options to configure synchronization validation error reporting.
Sub-setting: Extra properties,
- Key:
syncval_reporting - Type:
GROUP - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
Extra properties
Append a section of key-value properties to the error message. Useful for filtering errors.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Synchronization | validate_sync |
BOOL | true |
- Key:
syncval_message_extra_properties - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.syncval_message_extra_properties = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_SYNCVAL_MESSAGE_EXTRA_PROPERTIES=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.syncval_message_extra_properties false |
Stateless Parameter
Stateless parameter checks. This may not always be necessary late in a development cycle.
Learn more about the Stateless Parameter setting.
- Key:
stateless_param - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.stateless_param = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_STATELESS_PARAM=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.stateless_param true |
Object Lifetime
Object tracking checks. This may not always be necessary late in a development cycle.
Learn more about the Object Lifetime setting.
- Key:
object_lifetime - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.object_lifetime = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_OBJECT_LIFETIME=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.object_lifetime true |
Thread Safety
Thread checks. In order to not degrade performance, it might be best to run your program with thread-checking disabled most of the time, enabling it occasionally for a quick sanity check or when debugging difficult application behaviors.
Learn more about the Thread Safety setting.
- Key:
thread_safety - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.thread_safety = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_THREAD_SAFETY=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.thread_safety true |
Handle Wrapping
Handle wrapping checks. Disable this feature if you are experiencing crashes when creating new extensions or developing new Vulkan objects/structures.
Learn more about the Handle Wrapping setting.
- Key:
unique_handles - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.unique_handles = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_UNIQUE_HANDLES=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.unique_handles true |
Legacy Detection
Give warnings when using legacy parts of the API.
Sub-setting: When to give warning,
- Key:
legacy_detection - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.legacy_detection = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_LEGACY_DETECTION=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.legacy_detection false |
When to give warning
Control when legacy detection warnings are emitted.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Legacy Detection | legacy_detection |
BOOL | true |
- Key:
legacy_detection_mode - Type:
ENUM - Default Value:
ALWAYS - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Enum Value | Label | Description | Platforms |
|---|---|---|---|
ALWAYS |
Always | Give warning any time using the superseded functionality. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
ONLY_SUPPORTED |
Only supported | Only give warning if the instance/device supports the superseded functionality. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
ONLY_ENABLED |
Only enabled | Only give warning if you enabled the superseded functionality extensions/version. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
const char* data[] = { "ALWAYS" }; |
vk_layer_settings.txt: |
khronos_validation.legacy_detection_mode = ALWAYS |
| Environment variables: | export VK_KHRONOS_VALIDATION_LEGACY_DETECTION_MODE=ALWAYS |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.legacy_detection_mode ALWAYS |
Best Practices
Outputs warnings related to common misuse of the API, but which are not explicitly prohibited by the specification.
Learn more about the Best Practices setting.
Sub-settings: ARM-specific best practices, AMD-specific best practices, IMG-specific best practices, and NVIDIA-specific best practices.
- Key:
validate_best_practices - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.validate_best_practices = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.validate_best_practices false |
ARM-specific best practices
Outputs warnings for spec-conforming but non-ideal code on ARM GPUs.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Best Practices | validate_best_practices |
BOOL | true |
- Key:
validate_best_practices_arm - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.validate_best_practices_arm = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_ARM=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.validate_best_practices_arm false |
AMD-specific best practices
Outputs warnings for spec-conforming but non-ideal code on AMD GPUs.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Best Practices | validate_best_practices |
BOOL | true |
- Key:
validate_best_practices_amd - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.validate_best_practices_amd = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_AMD=false |
IMG-specific best practices
Outputs warnings for spec-conforming but non-ideal code on Imagination GPUs.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Best Practices | validate_best_practices |
BOOL | true |
- Key:
validate_best_practices_img - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.validate_best_practices_img = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_IMG=false |
NVIDIA-specific best practices
Outputs warnings for spec-conforming but non-ideal code on NVIDIA GPUs.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Best Practices | validate_best_practices |
BOOL | true |
- Key:
validate_best_practices_nvidia - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.validate_best_practices_nvidia = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_NVIDIA=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.validate_best_practices_nvidia false |
GPU Centric Validation
Control the Validation for GPU centric API.
Sub-settings: GPU Assisted Validation (GPU-AV), GPU Dump, Descriptor Hashing, Debug Printf only preset, and Debug Printf.
- Key:
validation_control_gpu - Type:
GROUP - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
GPU Assisted Validation (GPU-AV)
Enable validation that cannot be done the CPU and needs hooks into the GPU execution.
Learn more about the GPU Assisted Validation (GPU-AV) setting.
Sub-settings: Safe Mode, Force on robustness features, Shader instrumentation, Buffer content validation, Ray tracing buffers consistency, Scoped GPU-AV, and Developer Debug Settings.
- Key:
gpuav_enable - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_enable = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_ENABLE=false |
Safe Mode
Will have GPU-AV try and prevent crashes, but will be much slower to validate. If using Safe Mode, consider using selective shader instrumentation, to only instrument the shaders/pipelines causing issues.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL | true |
- Key:
gpuav_safe_mode - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_safe_mode = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_SAFE_MODE=false |
Force on robustness features
This will enable all possible robustness features for the app at device creation time. This can be used to quickly detect if with robustness, your issue disappears. GPU-AV will also skip validating things already covered by robustness, so turning on should reduce GPU-AV performance overhead.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL | true |
- Key:
gpuav_force_on_robustness - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_force_on_robustness = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_FORCE_ON_ROBUSTNESS=false |
Shader instrumentation
Instrument shaders to validate descriptors, descriptor indexing, buffer device addresses and ray queries. Warning: will considerably slow down shader executions.
Learn more about the Shader instrumentation setting.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL | true |
Sub-settings: Descriptors indexing, Post process descriptor indexing, Out of bounds buffer device addresses, Mesh Shading SPIR-V instructions, TraceRay SPIR-V instructions, Out of bounds vertex attribute fetching, Shader Sanitizer, Shared Memory Data Race Detection, and Maximum Indices.
- Key:
gpuav_shader_instrumentation - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_shader_instrumentation = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_SHADER_INSTRUMENTATION=true |
Ray tracing buffers consistency
Validate that between a BLAS build and its update, triangle geometries using index buffer keep its content identical (VUID 03768), and that active/inactive primitives do not change this status (VUIDs 03663 and 03664). Warning: a record of vertex/index buffers will be maintained in device local memory, so validation can be GPU memory heavy.
All the following condition must be fulfilled for the setting to be applied.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL | true |
| Buffer content validation | gpuav_buffers_validation |
BOOL | true |
- Key:
gpuav_ray_tracing_buffers_consistency - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_ray_tracing_buffers_consistency = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_RAY_TRACING_BUFFERS_CONSISTENCY=false |
Scoped GPU-AV
Reduce the scope of GPU-AV allowing it to be must faster.
Sub-setting: Selective Instrument Shaders,
- Key:
gpuav_scoped - Type:
GROUP - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
Selective Instrument Shaders
When turned on, shaders are NOT instrumented unless selected. This can be done by:
- passing a VkValidationFeaturesEXT struct in the pNext of VkShaderModuleCreateInfo/VkPipelineShaderStageCreateInfo/vkCreateShadersEXT pNext
- using a regex matching a shader/pipeline debug name.
- Providing a CDL dump file to parse the debug names from it.
Learn more about the Selective Instrument Shaders setting.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL | true |
Sub-settings: Shader/pipeline name regexes, and CDL dump file.
- Key:
gpuav_select_instrumented_shaders - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_select_instrumented_shaders = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_SELECT_INSTRUMENTED_SHADERS=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.gpuav_select_instrumented_shaders false |
Shader/pipeline name regexes
Any shader or pipeline library debug name (set with vkSetDebugUtilsObjectNameEXT) fully matching any listed regular expression will be instrumented when creating pipelines with those shaders or libraries. Regex grammar: Modified ECMAScript. No support for shader objects yet. Warning: instrumentation being performed at final pipeline creation time, if shaders modules have already been destroyed at this step (possible when using pipeline libraries), they won't be found by this regex selection system. In this case, consider naming pipeline libraries instead.
This setting can list multiple values using the "," (comma) separator.
All the following condition must be fulfilled for the setting to be applied.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL | true |
| Selective Instrument Shaders | gpuav_select_instrumented_shaders |
BOOL | true |
- Key:
gpuav_shaders_to_instrument - Type:
LIST - Default Value:
- Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
const char* data[] = { "" }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_shaders_to_instrument = |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_SHADERS_TO_INSTRUMENT= |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.gpuav_shaders_to_instrument |
CDL dump file
Path to a Crash Diagnostic Layer (CDL) dump file. Pipeline names found in this file will be selected for instrumentation.
All the following condition must be fulfilled for the setting to be applied.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| GPU Assisted Validation (GPU-AV) | gpuav_enable |
BOOL | true |
| Selective Instrument Shaders | gpuav_select_instrumented_shaders |
BOOL | true |
- Key:
gpuav_cdl_dump_path - Type:
LOAD_FILE - Default Value:
- Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
const char* data[] = { "" }; |
vk_layer_settings.txt: |
khronos_validation.gpuav_cdl_dump_path = |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPUAV_CDL_DUMP_PATH= |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.gpuav_cdl_dump_path |
GPU Dump
Similar to API Dump, but using all the state tracking information, print out information for GPU centric extensions.
Sub-settings: Dump Descriptor Heap/Buffer, Dump VK_KHR_copy_memory_indirect, Dump VK_EXT_device_generated_commands, and Redirect all GPU Dump to stdout.
- Key:
gpu_dump - Type:
GROUP - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
Dump Descriptor Heap/Buffer
Dump all the information at every draw/dispatch when recording VK_EXT_descriptor_heap or VK_EXT_descriptor_buffer.
- Key:
gpu_dump_descriptors - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpu_dump_descriptors = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPU_DUMP_DESCRIPTORS=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.gpu_dump_descriptors false |
Dump VK_KHR_copy_memory_indirect
Dump information at each copy command when recording.
- Key:
gpu_dump_copy_memory_indirect - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpu_dump_copy_memory_indirect = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPU_DUMP_COPY_MEMORY_INDIRECT=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.gpu_dump_copy_memory_indirect false |
Dump VK_EXT_device_generated_commands
Dump information at each vkCmdExecuteGeneratedCommands when recording.
- Key:
gpu_dump_device_generated_commands - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpu_dump_device_generated_commands = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPU_DUMP_DEVICE_GENERATED_COMMANDS=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.gpu_dump_device_generated_commands false |
Redirect all GPU Dump to stdout
Instead of using the debug callback with information severity, redirect to stdout instead.
- Key:
gpu_dump_to_stdout - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.gpu_dump_to_stdout = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_GPU_DUMP_TO_STDOUT=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.gpu_dump_to_stdout false |
Descriptor Hashing
When enabled and using VK_EXT_descriptor_heap/VK_EXT_descriptor_buffer, this will attempt to track all descriptors seen such that GPU-AV and GPU Dump can detect more errors. This will increase the memory footprint.
Sub-setting: Total expected descriptors used,
- Key:
descriptor_hashing - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.descriptor_hashing = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_DESCRIPTOR_HASHING=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.descriptor_hashing false |
Total expected descriptors used
We create a static allocation to hold all potential descriptor hashes we see. The larger it is the more memory and time it may take. The true capacity is always this value rounded up to the next power of two.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Descriptor Hashing | descriptor_hashing |
BOOL | true |
- Key:
descriptor_hashing_total_descriptors - Type:
INT - Default Value:
65536 - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
int64_t data[] = { 65536 }; |
vk_layer_settings.txt: |
khronos_validation.descriptor_hashing_total_descriptors = 65536 |
| Environment variables: | export VK_KHRONOS_VALIDATION_DESCRIPTOR_HASHING_TOTAL_DESCRIPTORS=65536 |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.descriptor_hashing_total_descriptors 65536 |
Debug Printf
Enable DebugPrintf and will print anything use NonSemantic.DebugPrintf in their SPIR-V.
Learn more about the Debug Printf setting.
Sub-settings: Redirect Printf messages to stdout, Printf verbose, and Printf buffer size.
- Key:
printf_enable - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.printf_enable = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_PRINTF_ENABLE=false |
Redirect Printf messages to stdout
Enable redirection of Debug Printf messages from the debug callback to stdout.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Debug Printf | printf_enable |
BOOL | true |
- Key:
printf_to_stdout - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.printf_to_stdout = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_PRINTF_TO_STDOUT=true |
Printf verbose
Will print out handles, instruction location, position in command buffer, and more.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Debug Printf | printf_enable |
BOOL | true |
- Key:
printf_verbose - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.printf_verbose = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_PRINTF_VERBOSE=false |
Printf buffer size
Set the size in bytes of the buffer per VkCommandBuffer to hold the messages (Each message is about 50 bytes).
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Debug Printf | printf_enable |
BOOL | true |
- Key:
printf_buffer_size - Type:
INT - Default Value:
1024 - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
int64_t data[] = { 1024 }; |
vk_layer_settings.txt: |
khronos_validation.printf_buffer_size = 1024 |
| Environment variables: | export VK_KHRONOS_VALIDATION_PRINTF_BUFFER_SIZE=1024 |
Debug Action
Specifies what action is to be taken when a layer reports information.
This setting can list multiple values using the "," (comma) separator.
- Key:
debug_action - Type:
FLAGS - Default Value:
VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Flags | Label | Description | Platforms |
|---|---|---|---|
VK_DBG_LAYER_ACTION_LOG_MSG |
Log Message | Log a txt message to stdout or to a log filename. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
VK_DBG_LAYER_ACTION_DEBUG_OUTPUT |
Debug Output | Log a txt message using the Windows OutputDebugString function. | WINDOWS_X86, WINDOWS_ARM |
VK_DBG_LAYER_ACTION_BREAK |
Break | Trigger a breakpoint if a debugger is in use. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
VK_DBG_LAYER_ACTION_FAIL |
Fail | Fail the command with VK_ERROR_VALIDATION_FAILED_EXT (prevents invalid commands from reaching the ICD). | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
const char* data[] = { "VK_DBG_LAYER_ACTION_LOG_MSG,
VK_DBG_LAYER_ACTION_DEBUG_OUTPUT" }; |
vk_layer_settings.txt: |
khronos_validation.debug_action = VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT |
| Environment variables: | export VK_KHRONOS_VALIDATION_DEBUG_ACTION=VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.debug_action VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT |
Log Filename
Specifies the output filename.
- Key:
log_filename - Type:
SAVE_FILE - Default Value:
stdout - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
const char* data[] = { "stdout" }; |
vk_layer_settings.txt: |
khronos_validation.log_filename = stdout |
| Environment variables: | export VK_KHRONOS_VALIDATION_LOG_FILENAME=stdout |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.log_filename stdout |
Message Severity
Comma-delineated list of options specifying the types of messages to be reported.
This setting can list multiple values using the "," (comma) separator.
- Key:
report_flags - Type:
FLAGS - Default Value:
error, warn - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Flags | Label | Description | Platforms |
|---|---|---|---|
info |
Info | Report informational messages. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
warn |
Warning | Report warnings from using the API in a manner which may lead to undefined behavior or to warn the user of common trouble spots. A warning does NOT necessarily signify illegal application behavior. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
perf |
Performance | Report usage of the API that may cause suboptimal performance. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
error |
Error | Report errors in API usage. | WINDOWS_X86, WINDOWS_ARM,
LINUX, MACOS, ANDROID |
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
const char* data[] = { "error, warn" }; |
vk_layer_settings.txt: |
khronos_validation.report_flags = error, warn |
| Environment variables: | export VK_KHRONOS_VALIDATION_REPORT_FLAGS=error, warn |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.report_flags error, warn |
Limit Duplicated Messages
Enable limiting of duplicate messages.
Sub-setting: Max Duplicated Messages,
- Key:
enable_message_limit - Type:
BOOL - Default Value:
true - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_TRUE }; |
vk_layer_settings.txt: |
khronos_validation.enable_message_limit = true |
| Environment variables: | export VK_KHRONOS_VALIDATION_ENABLE_MESSAGE_LIMIT=true |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.enable_message_limit true |
Max Duplicated Messages
Maximum number of times any single validation message should be reported.
| Dependences | Variables Key | Type | Value |
|---|---|---|---|
| Limit Duplicated Messages | enable_message_limit |
BOOL | true |
- Key:
duplicate_message_limit - Type:
INT - Default Value:
10 - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
int64_t data[] = { 10 }; |
vk_layer_settings.txt: |
khronos_validation.duplicate_message_limit = 10 |
| Environment variables: | export VK_KHRONOS_VALIDATION_DUPLICATE_MESSAGE_LIMIT=10 |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.duplicate_message_limit 10 |
Mute Message VUIDs
List of VUIDs which are to be IGNORED by the validation layer. The list is comma separated and can be either the entire VUID string, the hashed value, or the last 5 digit number of a VUID.
This setting can list multiple values using the "," (comma) separator.
- Key:
message_id_filter - Type:
LIST - Default Value:
- Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
const char* data[] = { "" }; |
vk_layer_settings.txt: |
khronos_validation.message_id_filter = |
| Environment variables: | export VK_KHRONOS_VALIDATION_MESSAGE_ID_FILTER= |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.message_id_filter |
Message Format
Specifies how error messages are reported.
Sub-settings: JSON, and Display Application Name.
- Key:
message_format - Type:
GROUP - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
JSON
Display Validation as JSON (VkDebugUtilsMessengerCallbackDataEXT::pMessage will contain JSON).
- Key:
message_format_json - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.message_format_json = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_MESSAGE_FORMAT_JSON=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.message_format_json false |
Display Application Name
Useful when running multiple instances to know which instance the message is from.
- Key:
message_format_display_application_name - Type:
BOOL - Default Value:
false - Platforms:
WINDOWS_X86,WINDOWS_ARM,LINUX,MACOS,ANDROID
| Methods: | |
|---|---|
VK_EXT_layer_settings: |
VkBool32 data[] = { VK_FALSE }; |
vk_layer_settings.txt: |
khronos_validation.message_format_display_application_name = false |
| Environment variables: | export VK_KHRONOS_VALIDATION_MESSAGE_FORMAT_DISPLAY_APPLICATION_NAME=false |
| Android system properties: | adb shell setprop debug.vulkan.khronos_validation.message_format_display_application_name false |
Layer Presets
Default
Preset Setting Values:
- CPU Centric Validation:
- Core: true
- Shader: true
- Caching: true
- Disable spirv-val: false
- Synchronization: false
- Submit time validation: true
- Shader accesses heuristic: false
- Error messages:
- Extra properties: false
- Stateless Parameter: true
- Object Lifetime: true
- Thread Safety: true
- Handle Wrapping: true
- Legacy Detection: false
- When to give warning: ALWAYS
- Best Practices: false
- ARM-specific best practices: false
- AMD-specific best practices: false
- IMG-specific best practices: false
- NVIDIA-specific best practices: false
- GPU Centric Validation:
- GPU Assisted Validation (GPU-AV): false
- Safe Mode: false
- Force on robustness features: false
- Shader instrumentation: true
- Descriptors indexing: true
- Post process descriptor indexing: true
- Out of bounds buffer device addresses: true
- Mesh Shading SPIR-V instructions: true
- TraceRay SPIR-V instructions: true
- Out of bounds vertex attribute fetching: true
- Shader Sanitizer: true
- Shared Memory Data Race Detection: true
- Maximum Indices: 8192
- Buffer content validation: true
- Indirect draws parameters: true
- Indirect dispatches parameters: true
- Indirect trace rays parameters: true
- Buffer copies: true
- VK_KHR_copy_memory_indirect: true
- Index buffers: true
- Acceleration structures builds: true
- Ray tracing buffers consistency: false
- Scoped GPU-AV:
- Selective Instrument Shaders: false
- Shader/pipeline name regexes:
- CDL dump file:
- Developer Debug Settings:
- Disable all of GPU-AV: false
- Validate instrumented shaders: false
- Dump instrumented shaders: false
- Limit how many time a pass can instrument the SPIR-V: 0
- Print SPIR-V instrumentation info: false
- Disable DontInline performance boost: false
- GPU Dump:
- Dump Descriptor Heap/Buffer: false
- Dump VK_KHR_copy_memory_indirect: false
- Dump VK_EXT_device_generated_commands: false
- Redirect all GPU Dump to stdout: false
- Descriptor Hashing: false
- Total expected descriptors used: 65536
- Debug Printf only preset: false
- Debug Printf: false
- Redirect Printf messages to stdout: true
- Printf verbose: false
- Printf buffer size: 1024
- Debug Action: VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
- Message Severity: error, warn
- Limit Duplicated Messages: true
- Max Duplicated Messages: 10
- Mute Message VUIDs:
- Message Format:
- JSON: false
- Display Application Name: false
Synchronization Only
Identify resource access conflicts due to missing or incorrect synchronization operations between actions reading or writing the same regions of memory.
Preset Setting Values:
- Core: false
- Synchronization: true
- Submit time validation: true
- Shader accesses heuristic: false
- Extra properties: false
- Stateless Parameter: false
- Object Lifetime: false
- Thread Safety: true
- Handle Wrapping: true
- Legacy Detection: false
- Best Practices: false
- GPU Assisted Validation (GPU-AV): false
- Dump Descriptor Heap/Buffer: false
- Dump VK_KHR_copy_memory_indirect: false
- Dump VK_EXT_device_generated_commands: false
- Descriptor Hashing: false
- Debug Printf: false
- Debug Action: VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
- Message Severity: error, warn
- Limit Duplicated Messages: true
GPU-Assisted Validation (GPU-AV)
Check for API usage errors at shader execution time.
Preset Setting Values:
- Core: false
- Synchronization: false
- Stateless Parameter: false
- Object Lifetime: false
- Thread Safety: false
- Handle Wrapping: false
- Legacy Detection: false
- Best Practices: false
- GPU Assisted Validation (GPU-AV): true
- Safe Mode: false
- Force on robustness features: false
- Shader instrumentation: true
- Descriptors indexing: true
- Post process descriptor indexing: true
- Out of bounds buffer device addresses: true
- Mesh Shading SPIR-V instructions: true
- TraceRay SPIR-V instructions: true
- Out of bounds vertex attribute fetching: true
- Shader Sanitizer: true
- Shared Memory Data Race Detection: true
- Maximum Indices: 8192
- Buffer content validation: true
- Indirect draws parameters: true
- Indirect dispatches parameters: true
- Indirect trace rays parameters: true
- Buffer copies: true
- VK_KHR_copy_memory_indirect: true
- Index buffers: true
- Acceleration structures builds: true
- Ray tracing buffers consistency: false
- Selective Instrument Shaders: false
- Disable all of GPU-AV: false
- Validate instrumented shaders: false
- Dump instrumented shaders: false
- Limit how many time a pass can instrument the SPIR-V: 0
- Print SPIR-V instrumentation info: false
- Disable DontInline performance boost: false
- Dump Descriptor Heap/Buffer: false
- Dump VK_KHR_copy_memory_indirect: false
- Dump VK_EXT_device_generated_commands: false
- Descriptor Hashing: false
- Debug Printf: false
- Debug Action: VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
- Message Severity: error, warn
- Limit Duplicated Messages: true
Debug Printf Only
Debug shader code by "printing" any values of interest to the debug callback or stdout.
Preset Setting Values:
- Core: false
- Synchronization: false
- Stateless Parameter: false
- Object Lifetime: false
- Thread Safety: false
- Handle Wrapping: false
- Legacy Detection: false
- Best Practices: false
- GPU Assisted Validation (GPU-AV): false
- Dump Descriptor Heap/Buffer: false
- Dump VK_KHR_copy_memory_indirect: false
- Dump VK_EXT_device_generated_commands: false
- Descriptor Hashing: false
- Debug Printf: true
- Redirect Printf messages to stdout: true
- Printf verbose: false
- Printf buffer size: 1024
- Debug Action:
- Message Severity: error, warn, info
- Limit Duplicated Messages: false
GPU Dump Only
Turn on only GPU Dump and turn off everything else.
Preset Setting Values:
- Core: false
- Synchronization: false
- Stateless Parameter: false
- Object Lifetime: false
- Thread Safety: false
- Handle Wrapping: false
- Legacy Detection: false
- Best Practices: false
- GPU Assisted Validation (GPU-AV): false
- Dump Descriptor Heap/Buffer: true
- Dump VK_KHR_copy_memory_indirect: true
- Dump VK_EXT_device_generated_commands: true
- Descriptor Hashing: false
- Debug Printf: false
- Debug Action: VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
- Message Severity: warn
- Limit Duplicated Messages: false
Legacy Detection Only
Turn off everything but legacy detection.
Preset Setting Values:
- Core: false
- Synchronization: false
- Stateless Parameter: false
- Object Lifetime: false
- Thread Safety: false
- Handle Wrapping: false
- Legacy Detection: true
- When to give warning: ALWAYS
- Best Practices: false
- GPU Assisted Validation (GPU-AV): false
- Dump Descriptor Heap/Buffer: false
- Dump VK_KHR_copy_memory_indirect: false
- Dump VK_EXT_device_generated_commands: false
- Descriptor Hashing: false
- Debug Printf: false
- Debug Action: VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
- Message Severity: warn
- Limit Duplicated Messages: false
Best Practices Only
Provides warnings on valid API usage that is potential API misuse.
Preset Setting Values:
- Core: false
- Synchronization: false
- Stateless Parameter: false
- Object Lifetime: false
- Thread Safety: false
- Handle Wrapping: false
- Legacy Detection: false
- Best Practices: true
- ARM-specific best practices: false
- AMD-specific best practices: false
- IMG-specific best practices: false
- NVIDIA-specific best practices: false
- GPU Assisted Validation (GPU-AV): false
- Dump Descriptor Heap/Buffer: false
- Dump VK_KHR_copy_memory_indirect: false
- Dump VK_EXT_device_generated_commands: false
- Descriptor Hashing: false
- Debug Printf: false
- Debug Action: VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
- Message Severity: error, warn, perf
- Limit Duplicated Messages: true
