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
vulkan-loader: Always include /run/opengl-driver(-32)/share in search path. #62869
Conversation
… path. Even though FALLBACK_DATA_DIRS is set to include this, it only applies when XDG_DATA_DIRS is not defined, so the NixOS opengl.nix module still had to include these in the search path. Use a simple patch to force a default search path, consulted after all other search paths. Note that FALLBACK_DATA_DIRS is no longer set, and the default (/usr/local/share:/usr/share) applies.
Thanks. Anyway it looks like a slightly different change to vulkan-loader will be merged - we'll need to set |
This was added in NixOS#19936 so that vulkan-loader finds the ICD config files. It is not needed any more after NixOS#62869 where it was ensured that the loader looks in /run/opengl-driver(-32)/share.
As the maintainer, I'd have appreciated being pinged regarding the significant change in approach here. |
@Ralith sorry about that! Ofborg usually pings maintainers but it looks like it didn’t in this case… Feel free to state any issues with the pr. |
I'm not sure I have full context, but it looks like this is part of a larger effort to allow things linked against vulkan-loader to Just Work without depending on the environment? That seems reasonable and I don't see any issues (and I'm glad to see upstreaming in progress!), it was just a surprise. |
We don't really have a way to make things Just Work on non-NixOS, this was mostly to simplifying the configuration and bring it in line with how it works for other GPU-based APIs (OpenGL, opencl, vdpau) - to always look in |
Yeah, I wrote that code. The idea was that Per the upstream PR, searching |
Looking in |
Also I think that if we someday find a solution for loading host libraries (I think we might, with modifications of the dynamic linker), it will almost certainly involve patching of dispatch libraries like vulkan-loader and libglvnd to put the dynamic linker into a mode where it will only look in the host filesystem and isolate the NixOS and host world. But -trying to make the search path include the host world now will just lead to more failures before we support that. |
Makes sense. |
Even though FALLBACK_DATA_DIRS is set to include this, it only applies when XDG_DATA_DIRS is not defined, so the NixOS opengl.nix module still had to include these in the search path. Use a simple patch to force a default search path, consulted after all other search paths.
Note that FALLBACK_DATA_DIRS is no longer set, and the default (/usr/local/share:/usr/share) applies.
Motivation for this change
Allow getting rid of adding these driver paths to
XDG_DATA_DIRS
. That will be a separate PR. Adding these paths toXDG_DATA_DIRS
may be hurting application startup time due to every application checking them.Things done
Tested that
vulkaninfo
andvkcube
work without/run/opengl-driver(-32)/share
inXDG_DATA_DIRS
(did not work before, unlessXDG_DATA_DIRS
was not set at all), also 32-bit binary on 64-bit system.sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)