#we really need a VK_ERROR_LAYER_NOT_USEABLE

37 messages ยท Page 1 of 1 (latest)

hardy comet
#

context: #beginners message
tldr: long debug session to find out that layer is indeed found but not loadable due to missing lib
would be nice if instead of vkCreateInstance returning VK_ERROR_LAYER_NOT_PRESENT , it returns a new value to indicate found but not loadable

high junco
#

That sounds like a loader bugโ€ฆ.

hardy comet
#

๐Ÿ˜‚

high junco
#

If dlopen failed then that should be reported as layer failure. Can you create a github issue for this?

hardy comet
#

i mean the layer's lib is found but a dependency it needs it not found

high junco
#

Is that dependency not being satisfied during dlopen? Or later during the call down the chain?

hardy comet
#

i would expect during dlopen

#

ERROR: /nix/store/y3kdn61k93rq2jx1lj2x72lnsk0l92qh-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/0njhf38b3dqdlsv6pxpvc14acr5qgm4h-vulkan-validation-layers-1.3.296.0/lib/libVkLayer_khronos_validation.so)

high junco
#

Then def a loader bug

hardy comet
#

sooo what should be the title?

high junco
#

Good question. Loader should report failure to dlopen library as layer not found. Wait how is the layer being enabled? The error is only returned when enabling the layer through the instance create info struct

hardy comet
#

yeah it's during instance creation but enumerate returns the layer as found

#

soo vkEnumerateInstanceLayerProperties says "yes I have layer"

#

but vkCreateInstance says "no"

#

which is why the topic of this thread is "give us a new code to say found but can't dlopen" ๐Ÿ˜‚

high junco
#

OH

#

right

#

enumerate doesn't check that you can load the layer.

#

so there really isn't any way to know that the layer isn't possible to use

#

IDK how this could be implemented without loading all layers found during vkEnumerate, which adds a non-trivial perf overhead :/

hardy comet
#

hence the "just tell me it can't dlopen" ๐Ÿ˜‚

high junco
#

but... how do I know it can't be dlopene'd without first dlopening it?

hardy comet
#

do it on vkCreateInstance

#

doesn't need to say which layer, tho that would be nice

#

maybe hook the why into debug utils messenger

#

but at least say "hey I tried to open but can't"

high junco
#

Ahhh okay hmmm so the things to check are that the error logging output of the loader clearly indicates "I TRIED TO LOAD THIS AND IT DIDN"T WORK". Adding a new error message is a LOT of work due to needing an extension. Or does it... but can I return an error code for an extension? Would that have to be enabled to get the error code?!? Frick instance creation nonsense

hardy comet
#

lol even if it's just "say something if there's a debug utils messenger" that would be great

hardy comet
#

oh just thought of a better extension, have a VK_EXT_WHY with a VkExplainStruct
you pass this struct to the pnext and then if the function fails it contains some message hinting why

high junco
#

Idle thought - do any of the current device fault extensions support this use case? "reporting more than just an error code?"

hardy comet
#

not aware of one ๐Ÿค”

#

unless you count debug utils messenger

high junco
#

I mean the loader will pass messages to that, but its a bit of a 'you have to set it up in the pNext chain of instance create info, and ignore the other warnings'

hardy comet
#

yeahh

meager rock
#

This is a good idea. There's no guarantee that whatever was discovered during vkEnumerate is still valid by the time the app calls vkCreateInstance anyway, right? The new extension thing sounds like the right approach to me: I would make it contain an array of VkResult, with 1 entry per layer requested. Throw in some new VkResult's if needed along with the new struct.

high junco
#

Is the underlying issue that "layer_not_present" isn't sufficient for the nature of how the Vulkan-Loader works?
Imho, it seems a bit nonsensical to develop a big extension when a simple "layer_present_but_failed_to_load" error code would be more sufficient? Sure, per-layer VkResults would be ideal, just thinking about cost of development vs benefit.

meager rock
#

I agree. But we also want to make sure we don't have to address this problem twice by not doing enough the first time. I guess it depends on how we would expect applications to react to this error in the best possible way.