Vulkan-Loader
Vulkan-Loader copied to clipboard
VK_LOADER_DEBUG should report actual library loaded, not library attempted
We found a case on macOS where the loader reported, via VK_LOADER_DEBUG=all
, that the repository build of libVkLayer_khronos_validation.dylib
was loaded for a particular test run:
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: /Users/lunarg/.jenkins/mz3/Vulkan-ValidationLayers/build/layers/VkLayer_khronos_validation.json
LAYER: Library: /Users/lunarg/.jenkins/mz3/Vulkan-ValidationLayers/build/layers/./libVkLayer_khronos_validation.dylib
LAYER: ||
DRIVER | LAYER: <Device>
when the actual library loaded, according to DYLD_PRINT_LIBRARIES=1
, was from /usr/local/lib
:
dyld[71457]: <AFEA288A-BA17-36E2-BA23-60CDE2A98664> /usr/local/lib/libVkLayer_khronos_validation.dylib
This inconsistency is misleading and made it difficult to debug.
The library reported by the Vulkan loader should be the actual library loaded, not the library attempted.
See https://stackoverflow.com/questions/20481058/find-pathname-from-dlopen-handle-on-osx for information on the (sadly, quite complicated) process required to reliably get this information on a Mac.