I’m encountering an issue where the nvidia-powerd.service
fails to start, and I am unsure whether my Optimus PRIME offloading configuration is working properly on NixOS. I have an Intel and Nvidia GPU setup (Intel UHD 630 and Nvidia GTX 1050 Ti), and I want to enable GPU offloading for performance tasks while using the Intel GPU for less demanding tasks.
System Information:
- Nvidia GPU: GTX 1050 Ti Mobile (PCI:1:0:0)
- Intel GPU: UHD Graphics 630 (PCI:0:2:0)
- Kernel Version: 6.10.9-zen1
- NixOS Version: 24.11.20240926.1925c60 (Vicuna)
Steps Taken:
-
I configured my
nvidia.nix
file to enable Nvidia offloading through Optimus PRIME, using the following setup:services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia-container-toolkit.enable = true; hardware.nvidia = { modesetting.enable = true; powerManagement.enable = true; powerManagement.finegrained = true; dynamicBoost.enable = lib.mkForce true; nvidiaSettings = true; package = config.boot.kernelPackages.nvidiaPackages.production; prime = { offload = { enable = true; enableOffloadCmd = true; }; nvidiaBusId = "PCI:1:0:0"; intelBusId = "PCI:0:2:0"; }; };
-
I successfully rebuilt my system with
sudo nixos-rebuild switch
. -
After rebooting, I noticed that the
nvidia-powerd.service
fails to start with the following error in the logs:nvidia-powerd.service - nvidia-powerd service Loaded: loaded (/etc/systemd/system/nvidia-powerd.service; enabled; preset: enabled) Active: failed (Result: exit-code) since Mon 2024-12-02 18:57:41 EET; 268ms ago Invocation: 3407735c2e43471e9a1c29c4209082a6 Process: 149160 ExecStart=/nix/store/xdxyd05p3brlj7s1nsij58kivf7q9lc1-nvidia-x11-550.120-6.10.9-bin/bin/nvidia-powerd (code=exited, status=1/FAILURE)
The logs show:
Dec 02 18:57:41 nixos /nix/store/xdxyd05p3brlj7s1nsij58kivf7q9lc1-nvidia-x11-550.120-6.10.9-bin/bin/nvidia-powerd[149160]: No matching GPU found Dec 02 18:57:41 nixos /nix/store/xdxyd05p3brlj7s1nsij58kivf7q9lc1-nvidia-x11-550.120-6.10.9-bin/bin/nvidia-powerd[149160]: Failed to initialize Dynamic Boost Dec 02 18:57:41 nixos systemd[1]: nvidia-powerd.service: Main process exited, code=exited, status=1/FAILURE
-
I have verified the bus IDs for both the Intel and Nvidia GPUs using
lspci
:00:02.0 VGA compatible controller: Intel Corporation CoffeeLake-H GT2 [UHD Graphics 630] 01:00.0 VGA compatible controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Ti Mobile]
The correct bus IDs are:
- Intel GPU: PCI:0:2:0
- Nvidia GPU: PCI:1:0:0
Expected Behavior:
- The
nvidia-powerd.service
should start successfully and manage GPU power states without errors. - Optimus PRIME offloading should allow me to offload rendering tasks to the Nvidia GPU as needed, while the Intel GPU is used for less demanding tasks.
Actual Behavior:
- The
nvidia-powerd.service
fails to start with an error:No matching GPU found
. - The Optimus PRIME offloading might not be functioning as expected, as I am unsure if the Nvidia GPU is being used for rendering tasks.
What I Have Tried:
- Disabled
nvidia-powerd
by settingsystemd.services.nvidia-powerd.enable = false;
in the configuration, but the issue persists. - Verified the correctness of the Bus IDs using
lspci
, and the configuration matches the actual system. - Attempted to test Optimus offloading using
prime-run
, but I am unsure if it is working as expected.
Logs:
Here are the relevant logs from journalctl
:
Dec 02 18:57:41 nixos /nix/store/xdxyd05p3brlj7s1nsij58kivf7q9lc1-nvidia-x11-550.120-6.10.9-bin/bin/nvidia-powerd[149160]: No matching GPU found
Dec 02 18:57:41 nixos systemd[1]: nvidia-powerd.service: Main process exited, code=exited, status=1/FAILURE
Questions:
- Has anyone encountered a similar issue with
nvidia-powerd.service
failing to start? - Does my Optimus PRIME offloading configuration look correct, and how can I test it effectively?
- Are there any additional steps I should take to resolve the issue, especially with Nvidia power management?
Any help or insights would be greatly appreciated!