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 23.11 manual | Nix & NixOS

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): FeatureMatrix · freedesktop.org. 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

If you find a solution, can you post your configuration.nix settings here ?

I think I was also able to activate my old 4200M GPU, but the mouse is very slow… and nvidia-settings can’t detect any display…

Sorry to disappoint but I managed to get Nouveau working adequately. As I see it, the Nouveau driver chain is only going to improve and the official Nvidia drivers are going to be harder and harder to deploy. My configuration is here – I hope it helps you.
Nouveau is by no means perfect for me and one particular defect is that if I undock my laptop and take it to another docking station with a different screen setup, it won’t adapt to the new layout, frequently leaving one screen showing ‘noise’. I have to log out and in again to fix that.

Thanks for your repply, nouveau work also for me, but my problem is with the HDMI sound output. I got no sound with it and got sound with nvidia legacy.
Maybe I can fix the sound problem with nouveau (if I look at the feature matrix for NVC0, which is my chipset, it should be ok) ?

I really couldn’t say. I know that sound does work for me with the Nouveau drivers, so there’s no definition correlation of Nouveau with no-sound.