KhronosGroup/Vulkan-Loader

Environment variables prevent `vk_loader_settings.json` layers control

Closed this issue · 5 comments

The issue was experienced on Windows.

  • If I enabled the VK_LAYER_KHRONOS_validation and API DUMP in vk_loader_settings.json and VK_LAYER_KHRONOS_profiles with 'VK_INSTANCE_LAYERS' and VK_LAYER_KHRONOS_validation with VK_LOADER_LAYERS_ENABLE, then VK_LAYER_LUNARG_api_dump is not added when creating the VkInstance according to the log below.

  • Also, it would be very useful to get a Loader log information for each layers located and enabled by the Vulkan applications (or env variable) but already listed in vk_loader_settings.json so not placed at the application_enabled_layers or unordered_layer_location location.

INFO:              Using layer configurations found in loader settings from C:\Users\Piranha\AppData\Local\LunarG\vulkan\vk_loader_settings.json
DEBUG:             Layer Configurations count = 9
DEBUG:             ---- Layer Configuration [0] ----
DEBUG:             Name: VK_LAYER_KHRONOS_validation
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_validation.json
DEBUG:             Control: on
DEBUG:             ---- Layer Configuration [1] ----
DEBUG:             Name: VK_LAYER_KHRONOS_profiles
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_profiles.json
DEBUG:             Control: auto
DEBUG:             ---- Layer Configuration [2] ----
DEBUG:             Name: VK_LAYER_KHRONOS_shader_object
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_shader_object.json
DEBUG:             Control: auto
DEBUG:             ---- Layer Configuration [3] ----
DEBUG:             Name: VK_LAYER_KHRONOS_synchronization2
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_synchronization2.json
DEBUG:             Control: auto
DEBUG:             ---- Layer Configuration [4] ----
DEBUG:             Name: VK_LAYER_LUNARG_api_dump
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_api_dump.json
DEBUG:             Control: on
DEBUG:             ---- Layer Configuration [5] ----
DEBUG:             Name: VK_LAYER_LUNARG_crash_diagnostic
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_crash_diagnostic.json
DEBUG:             Control: auto
DEBUG:             ---- Layer Configuration [6] ----
DEBUG:             Name: VK_LAYER_LUNARG_gfxreconstruct
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_gfxreconstruct.json
DEBUG:             Control: auto
DEBUG:             ---- Layer Configuration [7] ----
DEBUG:             Name: VK_LAYER_LUNARG_monitor
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_monitor.json
DEBUG:             Control: auto
DEBUG:             ---- Layer Configuration [8] ----
DEBUG:             Name: VK_LAYER_LUNARG_screenshot
DEBUG:             Path: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_screenshot.json
DEBUG:             Control: auto
DEBUG:             ---------------------------------
INFO:              Portability enumeration bit was set, enumerating portability drivers.
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_validation.json (file version 1.2.0)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_profiles.json (file version 1.2.1)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_shader_object.json (file version 1.2.0)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_synchronization2.json (file version 1.2.0)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_api_dump.json (file version 1.2.0)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_crash_diagnostic.json (file version 1.2.0)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_gfxreconstruct.json (file version 1.2.0)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_monitor.json (file version 1.0.0)
INFO:              Found manifest file E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_screenshot.json (file version 1.2.0)
INFO:              windows_get_app_package_manifest_path: Failed to find mapping layers packages by family name
DRIVER:            Checking for Driver Manifest files in Registry at HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers
INFO:              windows_add_json_entry: Located json file "C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_0afec3f2050014a0\nv-vk64.json" from PnP registry: E
INFO:              windows_add_json_entry: Located json file "C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch_d.inf_amd64_dcdc48ad59d39fcd\igvk64.json" from PnP registry: E
DRIVER:            Found no registry files in HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers
DRIVER:            Found ICD manifest file C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_0afec3f2050014a0\nv-vk64.json, version 1.0.1
DEBUG | DRIVER:    Searching for ICD drivers named .\nvoglv64.dll
DRIVER:            Found ICD manifest file C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch_d.inf_amd64_dcdc48ad59d39fcd\igvk64.json, version 1.0.0
DEBUG | DRIVER:    Searching for ICD drivers named .\igvk64.dll
WARNING: [Loader Message] Code 0 : env var 'VK_INSTANCE_LAYERS' defined and adding layers: VK_LAYER_KHRONOS_profiles
WARNING | LAYER:   env var 'VK_INSTANCE_LAYERS' defined and adding layers: VK_LAYER_KHRONOS_profiles
WARNING: [Loader Message] Code 0 : env var 'VK_INSTANCE_LAYERS' defined and adding layers: VK_LAYER_KHRONOS_profiles
WARNING | LAYER:   env var 'VK_INSTANCE_LAYERS' defined and adding layers: VK_LAYER_KHRONOS_profiles
DEBUG | LAYER:     Loading layer library E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_profiles.dll
INFO | LAYER:      Insert instance layer "VK_LAYER_KHRONOS_profiles" (E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_profiles.dll)
DEBUG | LAYER:     Loading layer library E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll
INFO | LAYER:      Insert instance layer "VK_LAYER_KHRONOS_validation" (E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll)
LAYER:             vkCreateInstance layer callstack setup to:
LAYER:                <Application>
LAYER:                  ||
LAYER:                <Loader>
LAYER:                  ||
LAYER:                VK_LAYER_KHRONOS_validation
LAYER:                        Type: Explicit
LAYER:                        Manifest: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_validation.json
LAYER:                        Library:  E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll
LAYER:                  ||
LAYER:                VK_LAYER_KHRONOS_profiles
LAYER:                        Type: Explicit
LAYER:                        Manifest: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_profiles.json
LAYER:                        Library:  E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_profiles.dll
LAYER:                  ||
LAYER:                <Drivers>
INFO | LAYER:      Failed to find vkGetDeviceProcAddr in layer "E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_profiles.dll"
INFO | LAYER:      Inserted device layer "VK_LAYER_KHRONOS_validation" (E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll)
DRIVER | LAYER:    vkCreateDevice layer callstack setup to:
DRIVER | LAYER:       <Application>
DRIVER | LAYER:         ||
DRIVER | LAYER:       <Loader>
DRIVER | LAYER:         ||
LAYER:                VK_LAYER_KHRONOS_validation
LAYER:                        Type: Explicit
LAYER:                        Manifest: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_validation.json
LAYER:                        Library:  E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll
LAYER:                  ||
DRIVER | LAYER:       <Device>
DEBUG | DRIVER:    vkCreateDevice extension VK_KHR_portability_subset not available for devices associated with ICD C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_0afec3f2050014a0\.\nvoglv64.dll
DRIVER | LAYER:           Using "NVIDIA GeForce RTX 3080 Ti" with driver: "C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispig.inf_amd64_0afec3f2050014a0\.\nvoglv64.dll"
INFO | LAYER:      Failed to find vkGetDeviceProcAddr in layer "E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_profiles.dll"
INFO | LAYER:      Inserted device layer "VK_LAYER_KHRONOS_validation" (E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll)
DRIVER | LAYER:    vkCreateDevice layer callstack setup to:
DRIVER | LAYER:       <Application>
DRIVER | LAYER:         ||
DRIVER | LAYER:       <Loader>
DRIVER | LAYER:         ||
LAYER:                VK_LAYER_KHRONOS_validation
LAYER:                        Type: Explicit
LAYER:                        Manifest: E:\VulkanSDK\1.3.296.0-alpha1\Bin\VkLayer_khronos_validation.json
LAYER:                        Library:  E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll
LAYER:                  ||
DRIVER | LAYER:       <Device>
DEBUG | DRIVER:    vkCreateDevice extension VK_KHR_portability_subset not available for devices associated with ICD C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch_d.inf_amd64_dcdc48ad59d39fcd\.\igvk64.dll
DRIVER | LAYER:           Using "Intel(R) Arc(TM) A750 Graphics" with driver: "C:\WINDOWS\System32\DriverStore\FileRepository\iigd_dch_d.inf_amd64_dcdc48ad59d39fcd\.\igvk64.dll"
DEBUG | LAYER:     Unloading layer library E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_validation.dll
DEBUG | LAYER:     Unloading layer library E:\VulkanSDK\1.3.296.0-alpha1\Bin\.\VkLayer_khronos_profiles.dll

vk_loader_settings.json

@christophe-lunarg Can you give me the vk_loader_settings.json used? I tried to reproduce it but could not, possibly due to making some assumption about how the settings.json was created.

@charles-lunarg vk_loader_settings.json used is in a link at the end of my issue...

Ah I didn't see that. Thanks for pointing it out!

Good news is that I set up a test which mimics the vk_loader_settings.json & env-vars, and when run would produce incorrect output as well as trip up msvc runtime checks, indicating a big bug. A pr to fix it will be posted shortly.

I think we can consider this issue resolved \o/