I have a major suspend issue on my Lenovo Legion 11AHP15 RTX 5070 on Linux. Usually, I would be able to close the lid of my laptop, suspend and and open the lid straight to Niri. When I do actually close the lid of my laptop and wake it from suspend, I would be met with a black screen and a blinking cursor. When I switched VT, it would totally hang the entire system.
I have tried tweaking my Nvidia configs but no boot parameters work. It feels like I have hit a brick wall. This issue has followed me from Arch Linux all the way to NixOS. I thought it could be a BIOS issue so I updated it. It’s still the same. I am on nvidia-open.
This is my gpu-nvidia.nix:
{ config, lib, pkgs, ... }:
{
hardware.nvidia = {
modesetting.enable = true;
open = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
nvidiaSettings = true;
powerManagement.enable = true;
powerManagement.finegrained = true;
powerManagement.kernelSuspendNotifier = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:196:0:0";
nvidiaBusId = "PCI:1:0:0";
};
};
boot.kernelParams = [
"nvidia.NVreg_EnableS0ixPowerManagement=1"
"nvidia_drm.fbdev=1"
"nvidia.NVreg_TemporaryFilePath=/var/tmp"
];
# Prevent systemd 256+ from freezing user sessions and deadlocking the Nvidia driver
systemd.services.systemd-suspend.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false";
services.xserver.videoDrivers = [ "nvidia" ];
boot.blacklistedKernelModules = [ "nouveau" ];
hardware.graphics = {
enable = true;
enable32Bit = true;
};
}