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
drop LD_LIBRARY_PATH for opengl programs #11434
Comments
I'm not certain about all the consequences. It isn't just What might also be a problem: during chrooted builds we have no |
Will this affect people using Nixpkgs outside NixOS? |
@ttuegel it should be the same, need for creating The behavior should be the same as of now, except we don't need |
Closely related: there might be a change how libGL implementations are switched. https://github.com/NVIDIA/libglvnd So far only nvidia is known to use that interface, but it's well possible the other major players will jump in soon. |
(triage) any action items? |
No, just brainstorming here. |
(triage) I assume this hasn’t been implemented yet? |
There's #60985, which will set RUNPATH in various dispatch libraries to look in |
Once I remove We should remove this so it doesn't affect the session, and fix things as necessary by adding RUNPATH to programs that need it (X server, individual display managers, wayland stuff?). I will try with NVidia but cannot try other drivers. |
I see two drivers that still rely on
Because NixOS has patched glibc to give This is so ugly and prone to break things that I think we should consider dropping both drivers. If not then we should at least go forward with dropping |
… it. A new internal option `hardware.opengl.setLdLibraryPath` is added which controls if `LD_LIBRARY_PATH` should be set to `/run/opengl-driver(-32)/lib`. It is false by default and is meant to be set to true by any driver which requires it. If this option is false, then `opengl.nix` and `xserver.nix` will not set `LD_LIBRARY_PATH`. Currently Mesa and NVidia drivers don't set `setLdLibraryPath` because they work with libglvnd and do not override libraries, while `amdgpu-pro`, `ati` and `parallels-guest` set it to true (the former two really need it, the last one doesn't build so is presumed to). Additionally, the `libPath` attribute within entries of `services.xserver.drivers` is removed. This made `xserver.nix` add the driver path directly to the `LD_LIBRARY_PATH` for the display manager (including X server). Not only is it redundant when the driver is added to `hardware.opengl.package` (assuming that `hardware.opengl.enable` is true), in fact all current drivers except `ati` set it incorrectly to the package path instead of package/lib. This removal of `LD_LIBRARY_PATH` could break certain packages using CUDA, but only those that themselves load `libcuda` or other NVidia driver libraries using `dlopen` (not if they just use `cudatoolkit`). A few have already been fixed but it is practically impossible to test all because most packages using CUDA are libraries/frameworks without a simple way to test. Fixes NixOS#11434 if only Mesa or NVidia graphics drivers are used.
Proposal:
/run/opengl-driver
(or/run/opengl-driver-32
).LD_LIBRARY_PATH
.The text was updated successfully, but these errors were encountered: