Skip to content

VK_LOADER_DEBUG should report actual library loaded, not library attempted #1404

Description

@lunarpapillo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions