-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Suspend to RAM doesn't work with NVidia Prime / Thinkpad P1 Gen2 #73494
Comments
Personally for me, suspend for RAM on NVIDIA has always been "glitchy". I suppose that this issue will remain as long as we use the default power management instead of systemd-based one NVIDIA recommends. |
Can you expand on this, what power management does NixOS use? Is it possible for NixOS to use the systemd based power management currently? Ah I suppose you mean https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/powermanagement.html, will update the issue with this as a reference |
Maybe it makes sense to add an Sounds like a big feature though, should another ticket be made specifically for |
I don't know of any other drivers that use systemd-based power management, so if it is just a nvidia thing, keeping it under Also on the expansion of the "glitchy" behavior, I don't usually have problems resuming within a short time (<1 min) of suspending with NVIDIA online, but when I leave it in suspend for long periods of time, I experience the same problem. Before this use to also effect it when the monitor brightness was 0 but this was fixed by |
Agreed
I also tried looking at dmesg/journalctl and I couldn't actually find any errors when trying to resume from hibernate, so the screen just being "off" could be the issue. Also judging from what NVidia is saying about this, i.e.
Another theoretical reason why the default power management doesn't work is due to limitations of memory in the kernel memory and the memory of the graphics card that I have is quite high (4 GB of VRAM). It would be good to figure out if Archlinux is using the systemd style of power management.
Is HardDPMS on by default now? Also fwiw, hibernate works flawlessly, its only suspend thats the issue. |
The limitation of memory is the most likely cause, on the Arch Linux front, seems like they use it [1], though not sure whether or not it's enabled by default. As for Actually, judging from how Arch Linux installations work, the service are installed so they are used. [1] https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/nvidia-utils#n166 |
Okay so it seems like this is a first good step, is this something you would be willing to look at or should I do an attempt? Note that I am very new to I don't think it should be that difficult since we already have a reference to work on (i.e. arch). Would be great if we could it in by the next stable (20.03) |
I'll see how much time I can pull, though yeah by the next stable the implementation should be ready if nobody else picks it up, (since at least I'll work on it over winter break). |
So update on this, I am no longer getting this issue from a couple of months ago although I am not sure if this is due to an update in NVIDIA/Kernel or the mix module itself |
I have this problem with my ThinkPad T25 since I upgraded from NixOS 19.09 to 20.03. |
What is your config (i.e. NVidia/XServer hardware conf?) |
|
This still does not work for me, even with these patches applied on top of 20.03 in order:
In both the new offload mode, and before in sync mode, do I get a black screen in Xorg when resuming from standby. I'm pretty sure the screen is fully off, that is no backlight is on (it it turns on when resuming, showing a white caret on black in the top left for 1 second, then turns fully black; it turns on when switching to the a virtual terminal, and back of when switching back to Ctrl+Alt+F7). I then have to switch to the virtual terminal with Ctrl+Alt+F1, and restart Xorg with I also tried with adding I'm using @eadwu is this working for you? (I also want to point out the "no longer works" from the issue description; this worked for me before, but broke recently, perhaps with the upgrade to 20.03.) |
I found that this helps: https://askubuntu.com/questions/512192/turn-monitor-back-on-after-xrandr/553944#553944 From the VT, run: sudo chvt 7; sleep 3; xrandr --display :0.0 --auto That turns the screen back on. Isn't that what I see nixpkgs/nixos/modules/hardware/video/nvidia.nix Lines 220 to 224 in 9d0c3ff
Should something like that also be run upon resume? |
I found an ugly workaround that makes it work on my laptop: {
# Workaround to make standby resume work with nvidia without getting a black screen because the display is off.
# See https://github.com/NixOS/nixpkgs/issues/73494
systemd.services.nvidia-resume.serviceConfig = {
# Requires `xhost +local:` in `sessionCommands` so that root can run X commands.
ExecStartPost = "${pkgs.xorg.xrandr}/bin/xrandr --display :0.0 --auto";
};
services.xserver.displayManager.sessionCommands = ''
# Needed to fix resume on nvidia, see `nvidia-resume` section.
# TODO: This is suboptimal but I haven't figured out yet how to make root-commands work with XAUTHORITY
${pkgs.xlibs.xhost}/bin/xhost +local:
'';
} |
I'm not entirely sure how the suspending works since I rarely suspend my laptop anyway since there seems to be bugs with waking up from suspend (hardware and/or software?). The few times I did test it, I never had any problems, though it might be dependent on the situation (nearly all of those times the video card wasn't really being used). |
See NixOS/nixpkgs#73494 (comment) and following comments.
I marked this as stale due to inactivity. → More info |
This seems to be fixed for me with 21.05, can anyone confirm? |
Describe the bug
On the new Lenovo Thinkpad P1 Gen 2 series (suspect its the same as X1 Extreme), when using NVidia Prime suspend to RAM no longer works. If you disable hybrid graphics in the BIOS and just use the NVidia graphics card then suspend to RAM works fine (albeit it completely kills your battery and makes the fans on your laptop go crazy).
When you do suspend to RAM in this configuration and then resume, the screen just stays black (the laptop does properly power up and the keyboard lights up). Unlike other suspend to RAM black screen problems, the only way to get out of this black screen is to physically restart the laptop with the power button, manually switching to TTY with Ctrl+Alt+F1 and doing
systemctl restart display-manager
does not work.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Resuming from suspend to RAM works (i.e. it opens your login manager)
Additional context
The relevant nixos configuration is here
Archlinux has a good resource https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_X1_Extreme_(Gen_2) . According to their documentation the latest nvidia beta drivers should just work fine (Prime Offloading should also work although that is covered by this PR #66601 )
@eadwu Noted that the most likely reason behind this is that Nixos uses default power management rather than one based on systemd. For nvidia its recommended to use the systemd power management (more info here https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/powermanagement.html)
Metadata
Maintainer information:
The text was updated successfully, but these errors were encountered: