I’m having a bit of trouble updating a Thinkpad P51 to 23.05. When I move it to 23.05, X won’t start. I’ve reviewed the log messages, and I believe it’s likely due to some incompatibility between the specific graphics adapter in this P51 (a Quadro M1200) and the latest NVIDIA 530 drivers (because 22.11 works fine on the system with the 520 drivers, and 23.05 works fine on a Thinkpad P50 system with a slightly older Quadro card).
Here’s what I’ve tried in a flakes-based config to pin the NVIDIA driver (and the kernel) to 22.11’s driver and kernel:
oldnvidia.nix
{ config, pkgs, nixpkgs, nixpkgs-2211, ...}:
let
# We'll use this twice
pinnedKernelPackages = nixpkgs-2211.linuxPackages_latest;
in
{
# allow nvidia drivers to be loaded
nixpkgs.config.allowUnfree = true;
nixpkgs.config.packageOverrides = pkgs: {
# swap out all of the linux packages
linuxPackages_latest = pinnedKernelPackages;
# make sure x11 will use the correct package as well
nvidia_x11 = nixpkgs-2211.nvidia_x11;
};
# line up your kernel packages at boot
boot.kernelPackages = pinnedKernelPackages;
}
… and imported oldnvidia.nix in a file included ih the modules list of the system I’m trying to configure.
When I try to validate this configuration, this is what happens:
/etc/nixos 23.05 *4 +1 !4 ?1 nixos-rebuild test 1 ✘ 6s
warning: Git tree '/etc/nixos' is dirty
building the system configuration...
warning: Git tree '/etc/nixos' is dirty
error: attribute 'nixpkgs-2211' missing
at /nix/store/9c6ikvw6cmd24gw39l881sjvaq09yrkp-source/lib/modules.nix:512:28:
511| builtins.addErrorContext (context name)
512| (args.${name} or config._module.args.${name})
| ^
513| ) (lib.functionArgs f);
(use '--show-trace' to show detailed location information)
Apologies if this is something dumb, but I could use some help.
For anyone else experiencing this, I have discovered that this issue is only when the system is set to “Discrete” mode for display in the BIOS. When set to “Hybrid”, X comes up.
I’m still pretty clueless about how to use an older nvidia driver revision, so please don’t consider this comment “it’s solved”, I just wanted to provide some context for people in maybe the same boat.
I really should write that blog post on how to use inputs in flakes used for NixOS systems. This question comes up so often.
On that note, though, I’m not convinced this is the best way of doing this. Using an old kernel strikes me as quite drastic. It also doesn’t look like the build process for the nvidia package has changed much recently, so this is probably a case where just overriding the source is a better call?
It turns out that the “production” NVIDIA driver works, so “hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.production;” is all that was necessary (it installs the 525 driver).
I’d still like to know how to pin a specific driver version and not one named symbolically but I was unable to get there, and likely won’t while the above works.
i had issues where my laptop’s gpu (rtx 3070ti) would never be put to sleep in offload mode, spent quite a lot of time troubleshooting until i realised it may be a driver issue, @marci 's solution fixed it, only thing i changed is that there is a slightly more recent 525 driver (525.147.05).
thank you @marci, this one was quite the headscratcher.