I have a Nvidia 1060 GTX in my computer but Nvidia drivers don’t work well with Wayland. Therefore, I would like to use the Intel HD GPU because it mostly “just works”. I don’t need 3D acceleration. The only reason to keep Nvidia drivers is to silence the 1060’s fans which otherwise run at 100%.
How can I have the Nvidia drivers installed and have them silence the GPU’s fans but use Intel HD otherwise?
This is my Nvidia related config (taken from the wiki):
# NVIDIA
# Source: https://nixos.wiki/wiki/Nvidia#Modifying_NixOS_Configuration
# Enable OpenGL
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Do not disable this unless your GPU is unsupported or if you have a good reason to.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
Your current config sets up your nvidia GPU as the only one to be used, I believe.
Set up offload mode as suggested a bit lower on the same page. This will make everything use your intel GPU by default, and then you can switch on the nvidia one for specific applications when it turns out you need acceleration for something after all.
I am not. I have almost an identical configuration (KDE+Wayland) deployed on a laptop and on a desktop. The laptop only has an integrated GPU and works without issue. On the Desktop with the Nvidia GPU, Firefox is missing maximize/minimize buttons. Obsidian shows a black screen. Cursor themes are not applied. When I switch to X11 on the Desktop these problems disappear. This is why I assumed that its a Nvidia+Wayland issue.
I was not aware of GBM and can’t find anything in the docs or wiki. Do I have to actiavte it somehow? Is it even available for older GPUs such as the 1060?
I will try the suggested GPU deactivation techniques.
no, sorry, GBM is not user facing. It’s the underlying buffer API that all the other open linux graphics drivers use underneath Wayland. In the early days of Wayland support on Nvidia, they insisted on using a different eglstreams API, which made compatibility with most wayland desktops a big issue.
They since caved and decided to support GBM like everybody else, so its been a lot better for me since then, but I don’t use KDE, so I can’t comment there.
Thanks for the suggestions. I started setting up this Nvidia Prime thing but I am not sure it even applies to my use case. Does the guide work for desktop computers with an Intel iGPU in the CPU and a dedicated PCIE Nvidia GPU? I don’t have a laptop. And the “Offload” options only works with a Turing generation GPU, which I don’t have.
(or use envycontrol, though it’s less useful if you want to switch between integrated-only and discrete-only modes, because that will always require reloading some drivers and your whole desktop env)
Its just that the Wiki talks about “Optimus” in combination with Laptops so I suspect(ed) that it requires some kind of special hardware or things that only mobile GPUs support.
Yep, fair enough, but no it does not to my knowledge. At least I’m aware of other people that have run this with desktop PCs.
I think the wiki (and other similar resources) talk about laptops because 99% of these use cases are laptops, and people haven’t really woken up to desktop PCs even having iGPUs, let alone having a use case for using them in tandem with a dGPU instead of just the dGPU.
The term “laptop” is very vague, but more clear and accurate enough (you’d hope) to people who just install the OS on some hardware they don’t understand. And probably the most common type of hardware anyway.
I gained some new insight. The main problems (missing window decorations and cursor theme) were solved by adding programs.dconf.enable = true;. I now understand that the issue was simply a GTK theme not being overridden by KDE and not a Wayland issue. Strangely this expression was not needed on the Laptop or I forgot that I had set it imperatively. I had assumed that it must be Nvidia, since the configs are otherwise almost identical. I think, I had expected the degree of reproducibility in NixOS to be higher .
Anyway, my need to disable the Nvidia drivers has disappeared and I will not proceed further. Thank you for your help.
Thanks for posting the config. Although my problem was resolved by other means, I took some inspiration from it and e.g. installed OpenRGB to turn of my GPU’s lights. I also have some questions:
Why the package amdvlk? Isn’t it for AMD?
Why the packages vulkan-validation-layers, vulkan-tools, vulkan-loader etc.? Do you actually need them for something or did you just add them because they are related to Nvidia and you just added all of them “just in case”?
Same with environment variables: Was there a specific need for them or “just in case”?
Majority of it is for nvidia and opencl / opengl utilities. A number of utilities didnt function properly without these. After adding these in as per in the snippet my overall experience with nvidia on nixos, on this desktop, has been flawless both in performance and power management. My system goes into sleep mode alot. I do my tasks and walk away and then happily goes to sleep for days on end and never failed to wake to resume on what i leave open