[Mesa-dev] radv vs vulkan loader

Gustaw Smolarczyk wielkiegie at gmail.com
Wed Oct 5 20:45:18 UTC 2016


I have encountered a following problem while trying to use radv
through LunarG's vulkan loader.

It seems that the loader dlopens() the ICD library twice. First, it
looks up "vk_icdNegotiateLoaderICDInterfaceVersion" symbol, which
seems to be the new mechanism used to determine the version of ICD
interface. Since radv doesn't provide it, it fall backs to the older
scheme. Unfortunately, it seems that the loader first unloads the ICD
and then loads it again. That causes issues in LLVM libraries' command
line registration which happens while initializing global objects with
constructors. To be more specific, "asan-instrument-assembly"
registered in libLLVMX86AsmPrinter.so registers for the second time
and causes the following message:

$ vulkaninfo

Vulkan API Version: 1.0.26

: CommandLine Error: Option 'asan-instrument-assembly' registered more
than once!
LLVM ERROR: inconsistency in registered CommandLine options

I have "fixed" the problem by manually removing
libLLVMX86AsmPrinter.so from the list of llvm dependencies to radv. It
seems that it was the only library registering any command line

I am not sure who is to blame for this situation. It's possible that
advertising the new ICD entry point would fix it. LLVM is really
fragile about its command line registration framework. Last, the
vulkan loader could try not to unnecessarily dlclose and dlopen the
ICD library.


More information about the mesa-dev mailing list