NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.14k forks source link

hardware.nvidia.forceFullCompositionPipeline disables second monitor #261112

Open gepbird opened 1 year ago

gepbird commented 1 year ago

Describe the bug

By enabling hardware.nvidia.forceFullCompositionPipeline, it fixes the screen tearing as expected, but disables a 2nd monitor.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Copy the default nvidia settings from the wiki
  2. Change open to false and forceFullCompositionPipeline to true
  3. Rebuild and reboot
  4. Observe that only one screen is turned on and detected by nvidia

Expected behavior

Second monitor works as before.

Screenshots

Additional context

Both monitors work when hardware.nvidia.forceFullCompositionPipeline = false.

Notify maintainers

@schuelermine

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.55, NixOS, 23.11 (Tapir), 23.11.20231006.87828a0`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.0`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
gepbird commented 1 year ago

Nevermind, I can enable second monitor in nvidia settings. Still weird that forceFullCompositionPipeline disables it.

gepbird commented 1 year ago

Changing settings in the GUI doesn't preserve between reboots. Is there a nix option for controlling nvidia-settings?

gepbird commented 1 year ago

When exporting the xserver configuration from nvidia settings, both monitors are in screen section metamodes:

    Option         "metamodes" "HDMI-0: nvidia-auto-select +1920+0, DVI-D-0: nvidia-auto-select +0+0"

but with hardware.nvidia.forceFullCompositionPipeline = true, no monitors are specified, so I assume only the first monitor it founds will work:

  Option         "metamodes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
antoningfors commented 1 month ago

My current workaround is to configure FullCompositionPipeline using the services.xserver.screenSection option. For my two monitor setup I configure ForceFullCompositionPipeline individually on each monitor.

services.xserver.screenSection = ''Option "metamodes" "nvidia-auto-select {ForceFullCompositionPipeline=On}, nvidia-auto-select {ForceFullCompositionPipeline=On}"'';