Khronos Vulkan

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:

  1. Vulkan Configurator tool found in the SDK (most recommended)
  2. application defined (at instance creation time)
  3. vk_layer_settings.txt
  4. environment 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.txt

and 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-pNext

Layer 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

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.

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,

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "validate_core", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.validate_core = true
Environment variables:
export VK_KHRONOS_VALIDATION_VALIDATE_CORE=true
export VK_VALIDATION_VALIDATE_CORE=true
export VK_VALIDATE_CORE=true
Android system properties:
adb shell setprop debug.vulkan.khronos_validation.validate_core
true
adb shell setprop debug.vulkan.validation.validate_core true
adb shell setprop debug.vulkan.validate_core true
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "check_shaders", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.check_shaders = true
Environment variables:
export VK_KHRONOS_VALIDATION_CHECK_SHADERS=true
export VK_VALIDATION_CHECK_SHADERS=true
export VK_CHECK_SHADERS=true
Android system properties:
adb shell setprop debug.vulkan.khronos_validation.check_shaders
true
adb shell setprop debug.vulkan.validation.check_shaders true
adb shell setprop debug.vulkan.check_shaders true
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "check_shaders_caching", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.check_shaders_caching = true
Environment variables:
export
VK_KHRONOS_VALIDATION_CHECK_SHADERS_CACHING=true
export VK_VALIDATION_CHECK_SHADERS_CACHING=true
export VK_CHECK_SHADERS_CACHING=true
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.check_shaders_caching true
adb shell setprop debug.vulkan.validation.check_shaders_caching true
adb shell setprop debug.vulkan.check_shaders_caching true
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "validate_sync", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.validate_sync = false
Environment variables:
export VK_KHRONOS_VALIDATION_VALIDATE_SYNC=false
export VK_VALIDATION_VALIDATE_SYNC=false
export VK_VALIDATE_SYNC=false
Android system properties:
adb shell setprop debug.vulkan.khronos_validation.validate_sync
false
adb shell setprop debug.vulkan.validation.validate_sync false
adb shell setprop debug.vulkan.validate_sync false
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "syncval_submit_time_validation", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.syncval_submit_time_validation =
true
Environment variables:
export
VK_KHRONOS_VALIDATION_SYNCVAL_SUBMIT_TIME_VALIDATION=true
export VK_VALIDATION_SYNCVAL_SUBMIT_TIME_VALIDATION=true
export VK_SYNCVAL_SUBMIT_TIME_VALIDATION=true
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.syncval_submit_time_validation
true
adb shell setprop debug.vulkan.validation.syncval_submit_time_validation true
adb shell setprop debug.vulkan.syncval_submit_time_validation true
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "syncval_shader_accesses_heuristic", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.syncval_shader_accesses_heuristic =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_SYNCVAL_SHADER_ACCESSES_HEURISTIC=false
export VK_VALIDATION_SYNCVAL_SHADER_ACCESSES_HEURISTIC=false
export VK_SYNCVAL_SHADER_ACCESSES_HEURISTIC=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.syncval_shader_accesses_heuristic
false
adb shell setprop debug.vulkan.validation.syncval_shader_accesses_heuristic false
adb shell setprop debug.vulkan.syncval_shader_accesses_heuristic false
adb shell setprop debug.vvl.syncval_shader_accesses_heuristic false

Error messages

Options to configure synchronization validation error reporting.

Sub-setting: Extra properties,

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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "syncval_message_extra_properties", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.syncval_message_extra_properties =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_SYNCVAL_MESSAGE_EXTRA_PROPERTIES=false
export VK_VALIDATION_SYNCVAL_MESSAGE_EXTRA_PROPERTIES=false
export VK_SYNCVAL_MESSAGE_EXTRA_PROPERTIES=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.syncval_message_extra_properties
false
adb shell setprop debug.vulkan.validation.syncval_message_extra_properties false
adb shell setprop debug.vulkan.syncval_message_extra_properties false
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "stateless_param", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.stateless_param = true
Environment variables:
export VK_KHRONOS_VALIDATION_STATELESS_PARAM=true
export VK_VALIDATION_STATELESS_PARAM=true
export VK_STATELESS_PARAM=true
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.stateless_param true
adb shell setprop debug.vulkan.validation.stateless_param true
adb shell setprop debug.vulkan.stateless_param true
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "object_lifetime", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.object_lifetime = true
Environment variables:
export VK_KHRONOS_VALIDATION_OBJECT_LIFETIME=true
export VK_VALIDATION_OBJECT_LIFETIME=true
export VK_OBJECT_LIFETIME=true
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.object_lifetime true
adb shell setprop debug.vulkan.validation.object_lifetime true
adb shell setprop debug.vulkan.object_lifetime true
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "thread_safety", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.thread_safety = true
Environment variables:
export VK_KHRONOS_VALIDATION_THREAD_SAFETY=true
export VK_VALIDATION_THREAD_SAFETY=true
export VK_THREAD_SAFETY=true
Android system properties:
adb shell setprop debug.vulkan.khronos_validation.thread_safety
true
adb shell setprop debug.vulkan.validation.thread_safety true
adb shell setprop debug.vulkan.thread_safety true
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "unique_handles", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.unique_handles = true
Environment variables:
export VK_KHRONOS_VALIDATION_UNIQUE_HANDLES=true
export VK_VALIDATION_UNIQUE_HANDLES=true
export VK_UNIQUE_HANDLES=true
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.unique_handles true
adb shell setprop debug.vulkan.validation.unique_handles true
adb shell setprop debug.vulkan.unique_handles true
adb shell setprop debug.vvl.unique_handles true

Legacy Detection

Give warnings when using legacy parts of the API.

Sub-setting: When to give warning,

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "legacy_detection", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.legacy_detection = false
Environment variables:
export VK_KHRONOS_VALIDATION_LEGACY_DETECTION=false
export VK_VALIDATION_LEGACY_DETECTION=false
export VK_LEGACY_DETECTION=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.legacy_detection false
adb shell setprop debug.vulkan.validation.legacy_detection false
adb shell setprop debug.vulkan.legacy_detection false
adb shell setprop debug.vvl.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
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" };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "legacy_detection_mode", VK_LAYER_SETTING_TYPE_STRING_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.legacy_detection_mode = ALWAYS
Environment variables:
export
VK_KHRONOS_VALIDATION_LEGACY_DETECTION_MODE=ALWAYS
export VK_VALIDATION_LEGACY_DETECTION_MODE=ALWAYS
export VK_LEGACY_DETECTION_MODE=ALWAYS
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.legacy_detection_mode ALWAYS
adb shell setprop debug.vulkan.validation.legacy_detection_mode ALWAYS
adb shell setprop debug.vulkan.legacy_detection_mode ALWAYS
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "validate_best_practices", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.validate_best_practices = false
Environment variables:
export
VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES=false
export VK_VALIDATION_VALIDATE_BEST_PRACTICES=false
export VK_VALIDATE_BEST_PRACTICES=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.validate_best_practices false
adb shell setprop debug.vulkan.validation.validate_best_practices false
adb shell setprop debug.vulkan.validate_best_practices false
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "validate_best_practices_arm", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.validate_best_practices_arm =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_ARM=false
export VK_VALIDATION_VALIDATE_BEST_PRACTICES_ARM=false
export VK_VALIDATE_BEST_PRACTICES_ARM=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.validate_best_practices_arm false
adb shell setprop debug.vulkan.validation.validate_best_practices_arm false
adb shell setprop debug.vulkan.validate_best_practices_arm false
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "validate_best_practices_amd", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.validate_best_practices_amd =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_AMD=false
export VK_VALIDATION_VALIDATE_BEST_PRACTICES_AMD=false
export VK_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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "validate_best_practices_img", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.validate_best_practices_img =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_IMG=false
export VK_VALIDATION_VALIDATE_BEST_PRACTICES_IMG=false
export VK_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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "validate_best_practices_nvidia", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.validate_best_practices_nvidia =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_VALIDATE_BEST_PRACTICES_NVIDIA=false
export VK_VALIDATION_VALIDATE_BEST_PRACTICES_NVIDIA=false
export VK_VALIDATE_BEST_PRACTICES_NVIDIA=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.validate_best_practices_nvidia
false
adb shell setprop debug.vulkan.validation.validate_best_practices_nvidia false
adb shell setprop debug.vulkan.validate_best_practices_nvidia false
adb shell setprop debug.vvl.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.

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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_enable", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_enable = false
Environment variables:
export VK_KHRONOS_VALIDATION_GPUAV_ENABLE=false
export VK_VALIDATION_GPUAV_ENABLE=false
export VK_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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_safe_mode", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_safe_mode = false
Environment variables:
export VK_KHRONOS_VALIDATION_GPUAV_SAFE_MODE=false
export VK_VALIDATION_GPUAV_SAFE_MODE=false
export VK_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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_force_on_robustness", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_force_on_robustness = false
Environment variables:
export
VK_KHRONOS_VALIDATION_GPUAV_FORCE_ON_ROBUSTNESS=false
export VK_VALIDATION_GPUAV_FORCE_ON_ROBUSTNESS=false
export VK_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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_shader_instrumentation", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_shader_instrumentation =
true
Environment variables:
export
VK_KHRONOS_VALIDATION_GPUAV_SHADER_INSTRUMENTATION=true
export VK_VALIDATION_GPUAV_SHADER_INSTRUMENTATION=true
export VK_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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_ray_tracing_buffers_consistency", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_ray_tracing_buffers_consistency =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_GPUAV_RAY_TRACING_BUFFERS_CONSISTENCY=false
export VK_VALIDATION_GPUAV_RAY_TRACING_BUFFERS_CONSISTENCY=false
export VK_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,

Selective Instrument Shaders

When turned on, shaders are NOT instrumented unless selected. This can be done by:

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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_select_instrumented_shaders", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_select_instrumented_shaders =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_GPUAV_SELECT_INSTRUMENTED_SHADERS=false
export VK_VALIDATION_GPUAV_SELECT_INSTRUMENTED_SHADERS=false
export VK_GPUAV_SELECT_INSTRUMENTED_SHADERS=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.gpuav_select_instrumented_shaders
false
adb shell setprop debug.vulkan.validation.gpuav_select_instrumented_shaders false
adb shell setprop debug.vulkan.gpuav_select_instrumented_shaders false
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
const char* data[] = { "" };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_shaders_to_instrument", VK_LAYER_SETTING_TYPE_STRING_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_shaders_to_instrument = 
Environment variables:
export
VK_KHRONOS_VALIDATION_GPUAV_SHADERS_TO_INSTRUMENT=
export VK_VALIDATION_GPUAV_SHADERS_TO_INSTRUMENT=
export VK_GPUAV_SHADERS_TO_INSTRUMENT=
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.gpuav_shaders_to_instrument 
adb shell setprop debug.vulkan.validation.gpuav_shaders_to_instrument
adb shell setprop debug.vulkan.gpuav_shaders_to_instrument
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
const char* data[] = { "" };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpuav_cdl_dump_path", VK_LAYER_SETTING_TYPE_STRING_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpuav_cdl_dump_path = 
Environment variables:
export VK_KHRONOS_VALIDATION_GPUAV_CDL_DUMP_PATH=
export VK_VALIDATION_GPUAV_CDL_DUMP_PATH=
export VK_GPUAV_CDL_DUMP_PATH=
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.gpuav_cdl_dump_path 
adb shell setprop debug.vulkan.validation.gpuav_cdl_dump_path
adb shell setprop debug.vulkan.gpuav_cdl_dump_path
adb shell setprop debug.vvl.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.

Dump Descriptor Heap/Buffer

Dump all the information at every draw/dispatch when recording VK_EXT_descriptor_heap or VK_EXT_descriptor_buffer.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpu_dump_descriptors", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpu_dump_descriptors = false
Environment variables:
export
VK_KHRONOS_VALIDATION_GPU_DUMP_DESCRIPTORS=false
export VK_VALIDATION_GPU_DUMP_DESCRIPTORS=false
export VK_GPU_DUMP_DESCRIPTORS=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.gpu_dump_descriptors false
adb shell setprop debug.vulkan.validation.gpu_dump_descriptors false
adb shell setprop debug.vulkan.gpu_dump_descriptors false
adb shell setprop debug.vvl.gpu_dump_descriptors false

Dump VK_KHR_copy_memory_indirect

Dump information at each copy command when recording.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpu_dump_copy_memory_indirect", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpu_dump_copy_memory_indirect =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_GPU_DUMP_COPY_MEMORY_INDIRECT=false
export VK_VALIDATION_GPU_DUMP_COPY_MEMORY_INDIRECT=false
export VK_GPU_DUMP_COPY_MEMORY_INDIRECT=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.gpu_dump_copy_memory_indirect
false
adb shell setprop debug.vulkan.validation.gpu_dump_copy_memory_indirect false
adb shell setprop debug.vulkan.gpu_dump_copy_memory_indirect false
adb shell setprop debug.vvl.gpu_dump_copy_memory_indirect false

Dump VK_EXT_device_generated_commands

Dump information at each vkCmdExecuteGeneratedCommands when recording.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpu_dump_device_generated_commands", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpu_dump_device_generated_commands =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_GPU_DUMP_DEVICE_GENERATED_COMMANDS=false
export VK_VALIDATION_GPU_DUMP_DEVICE_GENERATED_COMMANDS=false
export VK_GPU_DUMP_DEVICE_GENERATED_COMMANDS=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.gpu_dump_device_generated_commands
false
adb shell setprop debug.vulkan.validation.gpu_dump_device_generated_commands false
adb shell setprop debug.vulkan.gpu_dump_device_generated_commands false
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "gpu_dump_to_stdout", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.gpu_dump_to_stdout = false
Environment variables:
export VK_KHRONOS_VALIDATION_GPU_DUMP_TO_STDOUT=false
export VK_VALIDATION_GPU_DUMP_TO_STDOUT=false
export VK_GPU_DUMP_TO_STDOUT=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.gpu_dump_to_stdout false
adb shell setprop debug.vulkan.validation.gpu_dump_to_stdout false
adb shell setprop debug.vulkan.gpu_dump_to_stdout false
adb shell setprop debug.vvl.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,

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "descriptor_hashing", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.descriptor_hashing = false
Environment variables:
export VK_KHRONOS_VALIDATION_DESCRIPTOR_HASHING=false
export VK_VALIDATION_DESCRIPTOR_HASHING=false
export VK_DESCRIPTOR_HASHING=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.descriptor_hashing false
adb shell setprop debug.vulkan.validation.descriptor_hashing false
adb shell setprop debug.vulkan.descriptor_hashing false
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
int64_t data[] = { 65536 };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "descriptor_hashing_total_descriptors", VK_LAYER_SETTING_TYPE_INT64_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.descriptor_hashing_total_descriptors =
65536
Environment variables:
export
VK_KHRONOS_VALIDATION_DESCRIPTOR_HASHING_TOTAL_DESCRIPTORS=65536
export VK_VALIDATION_DESCRIPTOR_HASHING_TOTAL_DESCRIPTORS=65536
export VK_DESCRIPTOR_HASHING_TOTAL_DESCRIPTORS=65536
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.descriptor_hashing_total_descriptors
65536
adb shell setprop debug.vulkan.validation.descriptor_hashing_total_descriptors 65536
adb shell setprop debug.vulkan.descriptor_hashing_total_descriptors 65536
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "printf_enable", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.printf_enable = false
Environment variables:
export VK_KHRONOS_VALIDATION_PRINTF_ENABLE=false
export VK_VALIDATION_PRINTF_ENABLE=false
export VK_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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "printf_to_stdout", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.printf_to_stdout = true
Environment variables:
export VK_KHRONOS_VALIDATION_PRINTF_TO_STDOUT=true
export VK_VALIDATION_PRINTF_TO_STDOUT=true
export VK_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
Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "printf_verbose", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.printf_verbose = false
Environment variables:
export VK_KHRONOS_VALIDATION_PRINTF_VERBOSE=false
export VK_VALIDATION_PRINTF_VERBOSE=false
export VK_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
Methods:
VK_EXT_layer_settings:
int64_t data[] = { 1024 };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "printf_buffer_size", VK_LAYER_SETTING_TYPE_INT64_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.printf_buffer_size = 1024
Environment variables:
export VK_KHRONOS_VALIDATION_PRINTF_BUFFER_SIZE=1024
export VK_VALIDATION_PRINTF_BUFFER_SIZE=1024
export VK_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.

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" };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "debug_action", VK_LAYER_SETTING_TYPE_STRING_EXT,
 static_cast<uint32_t>(std::size(data)), data };
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
export VK_VALIDATION_DEBUG_ACTION=VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
export VK_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
adb shell setprop debug.vulkan.validation.debug_action VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
adb shell setprop debug.vulkan.debug_action VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT
adb shell setprop debug.vvl.debug_action VK_DBG_LAYER_ACTION_LOG_MSG, VK_DBG_LAYER_ACTION_DEBUG_OUTPUT

Log Filename

Specifies the output filename.

Methods:
VK_EXT_layer_settings:
const char* data[] = { "stdout" };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "log_filename", VK_LAYER_SETTING_TYPE_STRING_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.log_filename = stdout
Environment variables:
export VK_KHRONOS_VALIDATION_LOG_FILENAME=stdout
export VK_VALIDATION_LOG_FILENAME=stdout
export VK_LOG_FILENAME=stdout
Android system properties:
adb shell setprop debug.vulkan.khronos_validation.log_filename
stdout
adb shell setprop debug.vulkan.validation.log_filename stdout
adb shell setprop debug.vulkan.log_filename stdout
adb shell setprop debug.vvl.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.

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" };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "report_flags", VK_LAYER_SETTING_TYPE_STRING_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.report_flags = error, warn
Environment variables:
export VK_KHRONOS_VALIDATION_REPORT_FLAGS=error, warn
export VK_VALIDATION_REPORT_FLAGS=error, warn
export VK_REPORT_FLAGS=error, warn
Android system properties:
adb shell setprop debug.vulkan.khronos_validation.report_flags
error, warn
adb shell setprop debug.vulkan.validation.report_flags error, warn
adb shell setprop debug.vulkan.report_flags error, warn
adb shell setprop debug.vvl.report_flags error, warn

Limit Duplicated Messages

Enable limiting of duplicate messages.

Sub-setting: Max Duplicated Messages,

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_TRUE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "enable_message_limit", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.enable_message_limit = true
Environment variables:
export
VK_KHRONOS_VALIDATION_ENABLE_MESSAGE_LIMIT=true
export VK_VALIDATION_ENABLE_MESSAGE_LIMIT=true
export VK_ENABLE_MESSAGE_LIMIT=true
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.enable_message_limit true
adb shell setprop debug.vulkan.validation.enable_message_limit true
adb shell setprop debug.vulkan.enable_message_limit true
adb shell setprop debug.vvl.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
Methods:
VK_EXT_layer_settings:
int64_t data[] = { 10 };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "duplicate_message_limit", VK_LAYER_SETTING_TYPE_INT64_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.duplicate_message_limit = 10
Environment variables:
export
VK_KHRONOS_VALIDATION_DUPLICATE_MESSAGE_LIMIT=10
export VK_VALIDATION_DUPLICATE_MESSAGE_LIMIT=10
export VK_DUPLICATE_MESSAGE_LIMIT=10
export VK_LAYER_DUPLICATE_MESSAGE_LIMIT=10
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.duplicate_message_limit 10
adb shell setprop debug.vulkan.validation.duplicate_message_limit 10
adb shell setprop debug.vulkan.duplicate_message_limit 10
adb shell setprop debug.vvl.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.

Methods:
VK_EXT_layer_settings:
const char* data[] = { "" };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "message_id_filter", VK_LAYER_SETTING_TYPE_STRING_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.message_id_filter = 
Environment variables:
export VK_KHRONOS_VALIDATION_MESSAGE_ID_FILTER=
export VK_VALIDATION_MESSAGE_ID_FILTER=
export VK_MESSAGE_ID_FILTER=
export VK_LAYER_MESSAGE_ID_FILTER=
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.message_id_filter 
adb shell setprop debug.vulkan.validation.message_id_filter
adb shell setprop debug.vulkan.message_id_filter
adb shell setprop debug.vvl.message_id_filter

Message Format

Specifies how error messages are reported.

Sub-settings: JSON, and Display Application Name.

JSON

Display Validation as JSON (VkDebugUtilsMessengerCallbackDataEXT::pMessage will contain JSON).

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "message_format_json", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.message_format_json = false
Environment variables:
export
VK_KHRONOS_VALIDATION_MESSAGE_FORMAT_JSON=false
export VK_VALIDATION_MESSAGE_FORMAT_JSON=false
export VK_MESSAGE_FORMAT_JSON=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.message_format_json false
adb shell setprop debug.vulkan.validation.message_format_json false
adb shell setprop debug.vulkan.message_format_json false
adb shell setprop debug.vvl.message_format_json false

Display Application Name

Useful when running multiple instances to know which instance the message is from.

Methods:
VK_EXT_layer_settings:
VkBool32 data[] = { VK_FALSE };
VkLayerSettingEXT setting {
 "VK_LAYER_KHRONOS_validation", "message_format_display_application_name", VK_LAYER_SETTING_TYPE_BOOL32_EXT,
 static_cast<uint32_t>(std::size(data)), data };
vk_layer_settings.txt:
khronos_validation.message_format_display_application_name =
false
Environment variables:
export
VK_KHRONOS_VALIDATION_MESSAGE_FORMAT_DISPLAY_APPLICATION_NAME=false
export VK_VALIDATION_MESSAGE_FORMAT_DISPLAY_APPLICATION_NAME=false
export VK_MESSAGE_FORMAT_DISPLAY_APPLICATION_NAME=false
Android system properties:
adb shell setprop
debug.vulkan.khronos_validation.message_format_display_application_name
false
adb shell setprop debug.vulkan.validation.message_format_display_application_name false
adb shell setprop debug.vulkan.message_format_display_application_name false
adb shell setprop debug.vvl.message_format_display_application_name false

Layer Presets

Default

Preset Setting Values:

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:

GPU-Assisted Validation (GPU-AV)

Check for API usage errors at shader execution time.

Preset Setting Values:

Debug Printf Only

Debug shader code by "printing" any values of interest to the debug callback or stdout.

Preset Setting Values:

GPU Dump Only

Turn on only GPU Dump and turn off everything else.

Preset Setting Values:

Legacy Detection Only

Turn off everything but legacy detection.

Preset Setting Values:

Best Practices Only

Provides warnings on valid API usage that is potential API misuse.

Preset Setting Values: