diff options
author | Ambroz Bizjak <abizjak.pro@gmail.com> | 2019-05-24 01:21:57 +0200 |
---|---|---|
committer | Ambroz Bizjak <abizjak.pro@gmail.com> | 2019-05-26 10:23:46 +0200 |
commit | 370d3af0c40c30f1dad763c35a2db637f70e6176 (patch) | |
tree | b9f947196411bf32335bb051f435aa2abf6bb669 /nixos/modules/virtualisation/parallels-guest.nix | |
parent | 2143f59191bc7c6c800d6caf3552180f44517dcd (diff) | |
download | nixlib-370d3af0c40c30f1dad763c35a2db637f70e6176.tar nixlib-370d3af0c40c30f1dad763c35a2db637f70e6176.tar.gz nixlib-370d3af0c40c30f1dad763c35a2db637f70e6176.tar.bz2 nixlib-370d3af0c40c30f1dad763c35a2db637f70e6176.tar.lz nixlib-370d3af0c40c30f1dad763c35a2db637f70e6176.tar.xz nixlib-370d3af0c40c30f1dad763c35a2db637f70e6176.tar.zst nixlib-370d3af0c40c30f1dad763c35a2db637f70e6176.zip |
nixos: Don't set LD_LIBRARY_PATH for graphics drivers that don't need 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 #11434 if only Mesa or NVidia graphics drivers are used.
Diffstat (limited to 'nixos/modules/virtualisation/parallels-guest.nix')
-rw-r--r-- | nixos/modules/virtualisation/parallels-guest.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/virtualisation/parallels-guest.nix b/nixos/modules/virtualisation/parallels-guest.nix index 4e0f2cae299e..828419fb4b9d 100644 --- a/nixos/modules/virtualisation/parallels-guest.nix +++ b/nixos/modules/virtualisation/parallels-guest.nix @@ -47,7 +47,7 @@ in config = mkIf config.hardware.parallels.enable { services.xserver = { drivers = singleton - { name = "prlvideo"; modules = [ prl-tools ]; libPath = [ prl-tools ]; }; + { name = "prlvideo"; modules = [ prl-tools ]; }; screenSection = '' Option "NoMTRR" @@ -65,6 +65,7 @@ in hardware.opengl.package = prl-tools; hardware.opengl.package32 = pkgs.pkgsi686Linux.linuxPackages.prl-tools.override { libsOnly = true; kernel = null; }; + hardware.opengl.setLdLibraryPath = true; services.udev.packages = [ prl-tools ]; |