0

I'm having a problem where the vulkan loader appears to be ignoring some of the environment variables I have set. VK_LOADER_DEBUG=all works but VK_LAYER_PATH and VK_ADD_LAYER_PATH both seem to be ignored. Can anyone identify the reason for this?

% env | grep VK
VK_ADD_LAYER_PATH=/Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/explicit_layer.d
VK_ICD_FILENAMES=/Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
VK_DRIVER_FILES=/Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
VK_LOADER_DEBUG=all
VK_LAYER_PATH=/Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/explicit_layer.d

% ls -lash /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/explicit_layer.d
total 256
  0 drwxr-xr-x  6 david  staff   192B 15 Jan 20:48 .
  0 drwxr-xr-x  7 david  staff   224B 17 Jan 07:35 ..
 32 -rw-r--r--  1 david  staff    12K 13 Dec 11:06 VkLayer_api_dump.json
136 -rw-r--r--  1 david  staff    68K 13 Dec 11:06 VkLayer_khronos_profiles.json
  8 -rw-r--r--  1 david  staff   1.8K 13 Dec 11:06 VkLayer_khronos_synchronization2.json
 80 -rw-r--r--  1 david  staff    39K 13 Dec 11:06 VkLayer_khronos_validation.json


untitled(5882,0x7ff847adf8c0) malloc: nano zone abandoned due to inability to preallocate reserved vm space.
INFO:             Vulkan Loader Version 1.3.236
Mac OS | (64-bit) | cwd: "/Users/david/C/vkf"
Clang version 14.0.0 (clang-1400.0.29.202)
LAYER:            Searching for layer manifest files
LAYER:               In following folders:
LAYER:                  /Users/david/C/vkf/vulkan/implicit_layer.d
LAYER:                  /Users/david/.config/vulkan/implicit_layer.d
LAYER:                  /etc/xdg/vulkan/implicit_layer.d
LAYER:                  /Users/lunarg/Dev/macos-sdk-build/Vulkan-Loader/build/install/etc/vulkan/implicit_layer.d
LAYER:                  /etc/vulkan/implicit_layer.d
LAYER:                  /Users/david/.local/share/vulkan/implicit_layer.d
LAYER:                  /usr/local/share/vulkan/implicit_layer.d
LAYER:                  /usr/share/vulkan/implicit_layer.d
LAYER:               Found no files
DRIVER:           Searching for driver manifest files
DRIVER:              In following folders:
DRIVER:                 /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
DRIVER:              Found the following files:
DRIVER:                 /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
DRIVER:           Found ICD manifest file /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json, version "1.0.0"
DEBUG | DRIVER:   Searching for ICD drivers named ../../../lib/libMoltenVK.dylib
DRIVER:           Searching for driver manifest files
DRIVER:              In following folders:
DRIVER:                 /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
DRIVER:              Found the following files:
DRIVER:                 /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
DRIVER:           Found ICD manifest file /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json, version "1.0.0"
DEBUG | DRIVER:   Searching for ICD drivers named ../../../lib/libMoltenVK.dylib
LAYER:            Searching for layer manifest files
LAYER:               In following folders:
LAYER:                  /Users/david/C/vkf/vulkan/implicit_layer.d
LAYER:                  /Users/david/.config/vulkan/implicit_layer.d
LAYER:                  /etc/xdg/vulkan/implicit_layer.d
LAYER:                  /Users/lunarg/Dev/macos-sdk-build/Vulkan-Loader/build/install/etc/vulkan/implicit_layer.d
LAYER:                  /etc/vulkan/implicit_layer.d
LAYER:                  /Users/david/.local/share/vulkan/implicit_layer.d
LAYER:                  /usr/local/share/vulkan/implicit_layer.d
LAYER:                  /usr/share/vulkan/implicit_layer.d
LAYER:               Found no files
LAYER:            Searching for layer manifest files
LAYER:               In following folders:
LAYER:                  /Users/david/C/vkf/vulkan/implicit_layer.d
LAYER:                  /Users/david/.config/vulkan/implicit_layer.d
LAYER:                  /etc/xdg/vulkan/implicit_layer.d
LAYER:                  /Users/lunarg/Dev/macos-sdk-build/Vulkan-Loader/build/install/etc/vulkan/implicit_layer.d
LAYER:                  /etc/vulkan/implicit_layer.d
LAYER:                  /Users/david/.local/share/vulkan/implicit_layer.d
LAYER:                  /usr/local/share/vulkan/implicit_layer.d
LAYER:                  /usr/share/vulkan/implicit_layer.d
LAYER:               Found no files
DRIVER:           Searching for driver manifest files
DRIVER:              In following folders:
DRIVER:                 /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
DRIVER:              Found the following files:
DRIVER:                 /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json
DRIVER:           Found ICD manifest file /Users/david/VulkanSDK/1.3.236.0/macOS/share/vulkan/icd.d/MoltenVK_icd.json, version "1.0.0"
DEBUG | DRIVER:   Searching for ICD drivers named ../../../lib/libMoltenVK.dylib
LAYER:            Searching for layer manifest files
LAYER:               In following folders:
LAYER:                  /Users/david/C/vkf/vulkan/implicit_layer.d
LAYER:                  /Users/david/.config/vulkan/implicit_layer.d
LAYER:                  /etc/xdg/vulkan/implicit_layer.d
LAYER:                  /Users/lunarg/Dev/macos-sdk-build/Vulkan-Loader/build/install/etc/vulkan/implicit_layer.d
LAYER:                  /etc/vulkan/implicit_layer.d
LAYER:                  /Users/david/.local/share/vulkan/implicit_layer.d
LAYER:                  /usr/local/share/vulkan/implicit_layer.d
LAYER:                  /usr/share/vulkan/implicit_layer.d
LAYER:               Found no files
Glfw Required Extension: VK_KHR_surface
Glfw Required Extension: VK_EXT_metal_surface
Enabled Instance Extensions:
VK_KHR_surface
VK_EXT_debug_utils
VK_KHR_portability_enumeration
VK_KHR_get_physical_device_properties2
VK_EXT_metal_surface
Enabled Layers:
VK_LAYER_KHRONOS_validation
[mvk-error] VK_ERROR_LAYER_NOT_PRESENT: Vulkan layer VK_LAYER_KHRONOS_validation is not supported.
[mvk-error] VK_ERROR_EXTENSION_NOT_PRESENT: Vulkan extension VK_KHR_portability_enumeration is not supported.
David Carpenter
  • 1,389
  • 2
  • 16
  • 29

1 Answers1

1

Appears the issue was causes by linking MoltenVK before vulkan, switching them around fixed this issue.

David Carpenter
  • 1,389
  • 2
  • 16
  • 29
  • One should not be linking both the MoltenVK ICD and the Vulkan Loader; it is one or the other. If you don't need the services of the Vulkan Loader such as the layers, then you can link the MoltenVK driver directly. Otherwise, when you link the Vulkan Loader, the loader goes out and finds the MoltenVK ICD and then dynamically loads it. – Karl Schultz Jan 17 '23 at 17:19
  • I took MoltenVK out, thanks – David Carpenter Jan 17 '23 at 17:51
  • Can you please tell me how to take MoltenVK out and link against vulkan loader. I am facing the same issue with a cmake project. I have added all the necessary environment variables. – Aritra Dattagupta Jul 15 '23 at 13:38