diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index e38050e637b1..94d6acbdefea 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -96,7 +96,11 @@ in Enabling this fixes screen tearing when using Optimus via PRIME (see {option}`hardware.nvidia.prime.sync.enable`. This is not enabled by default because it is not officially supported by NVIDIA and would not - work with SLI + work with SLI. + + Enabling this and using version 545 or newer of the proprietary NVIDIA + driver causes it to provide its own framebuffer device, which can cause + Wayland compositors to work when they otherwise wouldn't. ''; prime.nvidiaBusId = lib.mkOption { @@ -568,9 +572,10 @@ in "nvidia_drm" ]; - # If requested enable modesetting via kernel parameter. + # If requested enable modesetting via kernel parameters. kernelParams = lib.optional (offloadCfg.enable || cfg.modesetting.enable) "nvidia-drm.modeset=1" + ++ lib.optional ((offloadCfg.enable || cfg.modesetting.enable) && lib.versionAtLeast nvidia_x11.version "545") "nvidia-drm.fbdev=1" ++ lib.optional cfg.powerManagement.enable "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ++ lib.optional cfg.open "nvidia.NVreg_OpenRmEnableUnsupportedGpus=1" ++ lib.optional (config.boot.kernelPackages.kernel.kernelAtLeast "6.2" && !ibtSupport) "ibt=off";