Graphics on my Lenovo W520, although basically working (I’m typing this on the W520), are unsatisfactory:
X is running at 16% to 98% of one core and the machine is slow and the fan runs continually.
One screen (DP, 4k) blinks every 10 seconds or so.
Here’s the relevant config.:
{ config, pkgs, lib, ... }:
{
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_390;
# For nvidia
nixpkgs.config.allowUnfree = true;
hardware.nvidia.prime = {
# offload.enable = true;
sync.enable = true;
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
nvidiaBusId = "PCI:1:0:0";
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
intelBusId = "PCI:0:2:0";
};
}
You have to wrap the Parameters into a executable like in this tutorial. Im using a lenovo to and only worked after I did that. Nvidia - NixOS Wiki
After that every app you need to use the GPU you have to add the prefix nvidia-offload
Sorry but I don’t understand. I’ve read that NVidia page but it covers many circumstances and configurations. What Parameters? and you have to prefix every app. with nvidia-offload? That’s unworkable surely as it means the GUI menu is useless and you have to run everything from a command window.
OK, I’ve updated my configuration but I still think it’s not right. The laptop is still rather sluggish and the fans run most of the time while it’s idling. However, there’s no heavy usage visible in top, which makes me think drivers are responsible for hammering the CPU.
Is there anything still obviously wrong in my configuration?
Is it possible to add the export declarations to the display-manager.service file so that they are available to any application launched from the desktop?
sync - Uses only the NVIDIA GPU for rendering. This means rendering can only happen on screens which the NVIDIA GPU has access to. Since only the NVIDIA GPU is used, the nvidia-offload script is not needed.
offload - Uses the non-NVIDIA GPU for rendering by default and only uses the NVIDIA GPU when instructed. The environment variables set by the nvidia-offload script is what instructs the rendering to be done by the NVIDIA GPU, which will do it’s thing and hands off the final rendering to the primary GPU for rendering to the screen. In this mode, only one screen can be used.
reverse prime (not available on 22.11) - The primary GPU is used for rendering and supports multiple screens by allowing access to screens only connected to the NVIDIA GPU. It’s my understanding that only content rendered on the screen connected to the NVIDIA GPU can be rendered with the NVIDIA GPU.
Hmm, so it might be end-of-the-road for NixOS on this laptop. I wonder if it’s possible to have the 435 decision reviewed. I suppose I should raise a PR about it.