NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.99k stars 14.01k forks source link

After upgrading to 22.11 (nix flakes), nvidia in sync mode leads to notebook screen turned off #204969

Open moritzschaefer opened 1 year ago

moritzschaefer commented 1 year ago

Describe the bug

Previously, I was able to use both my laptop and an external screen using nvidia sync mode (hardware.nvidia.prime.sync.enable = lib.mkForce true;).

After upgrading to 22.11, when using sync-mode, my notebook screen turns off completely (black screen, no backlighting) during boot/X-Server startup, while the external monitor works fine. Consequently, xrandr does not list my notebook screen (usually eDP-1) in this setting.

I tried booting with the external screen plugged in and plugged off, but in neither case the notebook screen remains on.

Note: I have a muxless GPU, which complicates the whole process from the start (see this PR https://github.com/NixOS/nixpkgs/pull/165188)

Additional context

I have a muxless Nvidia GPU (Thinkpad X1 Extreme Gen. 4), which complicates the whole process from the start (see this PR https://github.com/NixOS/nixpkgs/pull/165188)

Notify maintainers

@GoogleBot42

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[I] moritz@mopad ~> nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.81, NixOS, 22.11 (Raccoon), 22.11.20221203.2d10e73`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.0`
 - channels(root): `"nixos-22.05"`
 - channels(moritz): `"nixos-22.05"`
 - nixpkgs: `/nix/store/ki9ncarill7zk1dcfxhmkzsgkc1vy425-source`
nixos-discourse commented 1 year ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/muxless-nvidia-in-sync-mode-leads-to-notebook-screen-turned-off-after-upgrade-to-22-11/23986/1

GoogleBot42 commented 1 year ago

Since you're not using reverse prime sync, afaik having a muxless GPU doesn't make a difference. You also might want to tag other people for visibility.

I am curious why you're using lib.mkForce true. Is something else setting it to false? It makes me wonder if maybe something isn't right with your configuration. What is your Xorg/NVIDIA related configuration?

Also Xorg logs would probably be helpful.

moritzschaefer commented 1 year ago

Hey @GoogleBot42 thanks for the feedback. I am not really aware of which people might know about this problem, so I'll tag some involved in #165188. @erplsf @thiagokokada @chekoopa Please, if you know more relevant users, could you add them?

I use nixos-harware which sets the default on 'offload', therefore I use the mkforce. Let me know if you see an issue in my logic (I am still not too familiar with nix...).

(import "${inputs.nixos-hardware}/common/gpu/nvidia/prime.nix") # default: offload