Hello, I’m very new to both linux and nix (started 5 days ago), but I’d say I know my way around computers. Sorry if I do/did stupid stuff or take a long time.
Full story:
I’m on a laptop (ROG Zephyrus G14 GA401IV) and it seems I’ve committed the great sin of having a Nvidia dGPU (NVIDIA GeForce RTX 2060 with Max-Q). After some trouble I successfully installed NixOS (using “nomodeset” from the installer) and after a lot of additional fiddling around I managed to boot into Plasma6. “Everything is finally good!”, I thought naively. Blank screen after waking from sleep, no battery charge control and lots of other small things. Found out about nixos-hardware
, they have a ga401 config. “Surely this’ll fix everything!”, I prayed with great hope. The prayers were answered, mostly… the screen still didn’t wake from sleep and I had a very annoying issue nvidia-powerd.service just simply refused to work. I moved to the nix-unstable channel hoping everything be magically fixed. And for the most part it was, the screen wakes form sleep now, all the Asus specific things work, everything is good except the nvidia-powerd.service. After looking at Asus ga401 broken · Issue #689 · NixOS/nixos-hardware · GitHub and trying lots of different permutations of services.xserver.videoDrivers
and hardware.nvidia
arguments I got nowhere. The only way to get rid of the error is to do services.xserver.videoDrivers = lib.mkForce ["modesetting"]
, but this practically disables the dGPU as I understand (the nvidia-offload command becomes unrecognized). I sincerely can’t anymore with Nvidia and I’ve been using linux for less than a week hahahah. Also I think the nvidia-powerd.service isn’t necessary for the function of NixOS, but I’d like a longer lasting battery if that’s possible (supposedly this is what nvidia-powerd.service does) and it’s annoying to constantly see the same error every time I do nixos-rebuild switch
. Also also IDK if this is usual, but whenever I boot into NixOS I’m in text mode, [ OK ]
lines whiz by. Then the KDE login screen, after I login text mode yet again, [ OK ]
lines whiz by some more, a couple [FAILED] Failed to start nvidia-powered service
lines and only then the Plasma 6.2 desktop after 7-8s of loading.
TL;DR
nvidia-powerd.service fails all the time, every time
systemctl status nvidia-powerd.service
output:
× nvidia-powerd.service - nvidia-powerd service
Loaded: loaded (/etc/systemd/system/nvidia-powerd.service; enabled; preset: ignored)
Active: failed (Result: exit-code) since Sun 2024-10-20 14:18:41 CEST; 3h 23min ago
Invocation: 014b9e9535ba4f2ea23ea34fc38d2039
Process: 21863 ExecStart=/nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd (code=exited, status=1/FAILURE)
Main PID: 21863 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
Mem peak: 1.8M
CPU: 15ms
lis 20 14:18:41 nixos /nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd[21863]: nvidia-powerd version:1.0(build 1)
lis 20 14:18:41 nixos /nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd[21863]: SBIOS support not found for NVPCF GET_SUPPORTED function
lis 20 14:18:41 nixos /nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd[21863]: No matching GPU found
lis 20 14:18:41 nixos /nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd[21863]: Failed to initialize Dynamic Boost
lis 20 14:18:41 nixos /nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd[21863]: Failed to detach GPU id 256
lis 20 14:18:41 nixos /nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd[21863]: Failed to initialize Dynamic Boost
lis 20 14:18:41 nixos /nix/store/rzk0k7mha4frgj82pihi83bh813kmmp4-nvidia-x11-560.35.03-6.6.57-bin/bin/nvidia-powerd[21863]: Failed to detach GPU id 256
lis 20 14:18:41 nixos systemd[1]: nvidia-powerd.service: Main process exited, code=exited, status=1/FAILURE
lis 20 14:18:41 nixos systemd[1]: nvidia-powerd.service: Failed with result 'exit-code'.
lis 20 14:18:41 nixos systemd[1]: Failed to start nvidia-powerd service.
For reference if needed:
In configuration.nix
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# Include all the Asus and Nvidia bs that I need
./zephyrus.nix
<nixos-hardware/asus/zephyrus/ga401>
./hardware-configuration.nix
];
...
# You can disable this if you're only using the Wayland session.
services.xserver.enable = false;
services.displayManager.sddm.wayland.enable = true;
In my own zephyrus.nix
{ config, pkgs, lib, ... }:
{
# services.xserver.videoDrivers = lib.mkForce ["modesetting"]; # Removes the nvidia boost (nvidia-powerd.service) error, but also the nvidia-offload command
# services.xserver.videoDrivers = lib.mkForce ["nvidia" "modesetting"];
#services = {
# supergfxd.enable = true;
# asusd = {
# enable = true;
# enableUserService = true;
# };
#};
hardware.graphics.enable = true;
boot.initrd.kernelModules = [ "amdgpu" ]; # "nvidia"
boot.kernelParams = [ "amdgpu" ]; # "nvidia"
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta;
nvidiaSettings = true;
powerManagement = {
enable = true;
finegrained = true;
};
prime = {
sync.enable = lib.mkForce false;
offload = {
enable = lib.mkForce true;
enableOffloadCmd = lib.mkForce true;
};
};
};
}