Hyprland running on Nvidia GPU even in PRIME mode on a LAPTOP

Hi
I have a laptop with Nvidia RTX 3070 and Intel i7 11800H, I want to optimize for battery life so naturally I want to run Hyprland on the integrated GPU. In the Hyprland docs, it states that it will choose the integrated GPU by defaut, but this is not the case for me.
When I do nvidia-smi, I see Hyprland as a process.
Also when I disable the nvidia GPU completely (following Nvidia - NixOS Wiki)

This is my nix config.
Thanks in advance for any help :smiley:

The wiki is sometimes a bit dodgy with its info, so be careful when following it. The biggest flaw with Nix right now (especially NixOS) is the documentation is all over the shop, with some being really good and some stuff either not being documented at all hardly, or being documented in a really out of date blog post that contains wrong information.

Anyway, nvidia-smi will always wake up the Nvidia GPU. It’s useful for verifying that applications you try to offload to it are actually running on it, and that nothing else is. You shouldn’t be seeing very much GPU utilisation if you read the command’s output. You might need to blacklist kernel modules to get it to not turn on, at which point nvidia-smi should fail.

Do you have a hyprland.conf file? That is where you choose which GPU Hyprland will prioritise using. This is the line in my hyprland.conf file that is responsible for using the Intel iGPU instead of the Nvidia dGPU:

env = WLR_DRM_DEVICES,/dev/dri/card0

You will need to find out which card is correct (probably card0): to do this you need to run lspci | grep VGA to find the bus ID of your Intel iGPU. Then run ls -l /dev/dri/by-path/ to find out which card number corresponds to the bus ID we found out before. Use that card in your configuration rather than just assuming /dev/dri/card0 will work.

Hopefully this helps.

1 Like

Thanks a lot! I’ll try it