Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VK_LAYER_PATH equivalent for implicit layers #1394

Closed
baldurk opened this issue Nov 30, 2023 · 3 comments · Fixed by #1550
Closed

VK_LAYER_PATH equivalent for implicit layers #1394

baldurk opened this issue Nov 30, 2023 · 3 comments · Fixed by #1550
Labels
enhancement New feature or request

Comments

@baldurk
Copy link
Contributor

baldurk commented Nov 30, 2023

What enhancement are you suggesting for the Vulkan Loader? Please describe in detail.
I built a local copy of Fossilize and I wanted to point at it temporarily for an application run, but VK_LAYER_PATH and VK_ADD_LAYER_PATH didn't function as I expected. It took a while and digging through the source to realise that they only apply to explicit layers - though I went back to the docs and noticed that it does indeed say "when looking for explicit layer manifest files.".

I'm not sure the reasoning for this exactly, but not all layers are natively explicit layers so it would be nice to be able to extend the search paths similarly for implicit layers. I don't think this is a security consideration since I was able to just force the layer as if it were explicit via VK_INSTANCE_LAYERS once I twigged.

As a side note, it would be helpful to have some extra debug text in VK_LOADER_DEBUG=all to indicate which types of manifests (implicit layer/explicit layer/driver) were being searched and which env vars are being included or not in each one. I got myself confused while digging in because when enabling that I saw it was searching the path I wanted but there are multiple searches listed so crucially it wasn't searching some of the time.

Is this specific to a single platform?
I encountered this on linux but I think it probably applies everywhere.

@baldurk baldurk added the enhancement New feature or request label Nov 30, 2023
@charles-lunarg
Copy link
Collaborator

I am unsure of the historical decision as to why VK_LAYER_PATH only modifies explicit layer paths, but I am not keen to change it due to potential side effects across the ecosystem.

Still, a VK_IMPLICIT_LAYER_PATH and VK_ADD_IMPLICIT_LAYER_PATH would make sense and I do not think it is impossible to add. I'm no fan of adding more environment variables (there already are too many in my opinion) but they at least close an existing hole.

As a side note, it would be helpful to have some extra debug text in VK_LOADER_DEBUG=all to indicate which types of manifests

Looking at the log, we do print "looking for layer|driver manifests" but I always 'knew' what was being searched for because the paths involved said "explicit_layer.d/Vk_layer_foo.json". Still, that is a useful thing to print.

As for why it works the way it does, it may have to do with the loader's inability to distinguish implicit from explicit layers directly, instead expecting the different layer types to be in separate paths/registries. But I have no solid evidence of that fact.

@charles-lunarg
Copy link
Collaborator

charles-lunarg commented Dec 1, 2023

PR #1400 Is a quick addition to add "explicit" or "implicit" to the 'searching for layer manifests' log message.
I think it would be better to open a separate issue to track more detailed logging suggestions, in order to prevent this issue from getting cluttered up.

EDIT: I went ahead and did that - let me know if that summarizes the intent of your suggestion. Cause I believe the root problem was not knowing where the search paths came from, rather than only knowing if any given env-var was the source.

@linyaa-kiwi
Copy link

+1. I use multiple custom installation prefixes on Linux for development. Without something like VK_IMPLICIT_LAYER_PATH, it's impossible to add ${PREFIX}/share/vulkan/implciit_layer.d to the search path.

In some cases, this is critical for development. For example, when a gpu driver installs an implicit layer that requires version-lock with the driver version. Without VK_IMPLICIT_LAYER_PATH, the loader tries to use the system-installed layer instead, which may be incompatible with the driver version installed into the custom prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants