Nvidia never suspends

You need to set up finegrained powermanagement for this to work. In addition to (pointlessly for modern drivers and cards) setting the nvidia driver setting for finegrained mode, this sets up a few udev rules to configure automatic powermanagement.

That doesn’t work IME though, I suspect that NixOS starts udev too late in the boot process. The udev rules are still necessary to make hings work if the driver is unloaded for whatever reason.

I’ve written this commit to make it work for me at the moment: WIP: fix(nvidia): Make runtime powermanagement actually work · TLATER/dotfiles@600ef27 · GitHub

The udev rules shouldn’t be much different from the upstream option (though they are installed more properly), but the powerUpCommands works. You’ll need to set powerManagement.enable for it to run.

I’m slowly generalizing my nvidia module, so there are some helpful comments and explanations in there, if it helps. I also intend to fix the boot upstream when I figure out how this is supposed to work.

This issue in my dotfiles also has some hints for debugging: Nvidia powermanagement not working on sway · Issue #383 · TLATER/dotfiles · GitHub

1 Like