NixOS 22.05 with Nvidia 1000M

Hello, I have a Lenovo W520 laptop with the Nvidia 1000M chipset. It works fine with NixOS 21.11 but I can’t make it work with 22.05. Apparently it needs the legacy 390 drivers. I tried copying my working configuration from the 21.11 installation but it shows a message at boot about needing the legacy drivers, and it drives just the laptop display, not the displays plugged into the docking station.

What next please?

Firstly, both 21.11 and 22.05 are past EOL at this point. If you’re upgrading, go for 22.11.

2 Likes

The manual explains how to use legacy drivers: NixOS 22.11 manual

You can also try the nouveau driver (default if you don’t set a driver), I believe its performance is much closer to proprietary for legacy cards, and it’s not like you’ll be playing graphically intensive games on a 12 year old mobile gpu.

Edit: Hrm, maybe still not, power management is the big bugbear that they still haven’t cracked (yours is NVC0): https://nouveau.freedesktop.org/FeatureMatrix.html. Oh well, hopefully with the new open source drivers.

1 Like

I am now thanks. My reply below is based on testing with 22.11.

The manual says to define services.xserver.videoDrivers but nixos-rebuild says that since 19.03, the correct name is hardware.nvidia.package.

With this configuration, when sddm starts, the two external screens do momentarily receive a signal, but nevertheless the login screen appears on the built-in laptop screen only.

{ config, pkgs, lib, ... }:

{
	hardware.nvidia.package = [ "nvidiaLegacy390" ];

	# 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";
	};
}

That hardware.nvidia.prime block is copied from my working 21.11 laptop (I have two W520s) and the momentary driving of the external displays occurs if it is removed. I also tried offload.enable = true; with the same results.

If you use hardware.nvidia.package you need to set an actual package, rather than a string:

{ 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";
	};
}

Nope, no change, regrettably. I tried offload.enable = true; as well, just in case, and although it’s not the NixOS way, I rebooted, to ensure that the selected kernel modules were loaded.

That you should absolutely do when prodding kernel things :wink: At least unless you know for certain you can hot reload without a hitch.

Have you tried lsmod to see if the correct kernel modules are loaded? Checked the nvidia settings menu to see connected displays? Played with xrandr?

I don’t know what’s changed, but it is working now, so thank you tlater and tejing for your help.

[later] Nope, I had to revert to my other laptop running 21.11.

  1. One screen briefly flashes every five seconds or so.
  2. The JRE is sucking about 30% CPU doing nothing, so the machine runs slowly and hot

NixOS may have the greatest software distribution system ever, but it’s still the same software behind it all.

1 Like