Use 545 Nvidia drivers?

Is it possible?

Currently the latest version you can get is 535.113.01, using hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.production in the unstable channel.

But I want to use 545 version because it fixes an issue many Gnome-Wayland users have:

1 Like

The beta variant on unstable is on 545: linuxKernel.packages.linux_6_5.nvidia_x11_beta

1 Like

Thank you!
1 question tho

So I updated my kernel using:
boot.kernelPackages = pkgs.linuxPackages_6_5;

And I know have to add:
pkgs.linuxKernel.packages.linux_6_5.nvidia_x11_beta
as the value of hardware.nvidia.package right?

LIke this?:

Changing from this:
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.production
to
hardware.nvidia.package = pkgs.linuxKernel.packages.linux_6_5.nvidia_x11_beta;

Or do I add linuxKernel.packages.linux_6_5.nvidia_x11_beta somewhere else?

Reference I was following: Nvidia - NixOS Wiki

kernelPackages is a whole set of packages, including the Linux kernel and nvidia drivers. You should not mix them, hence you currently use boot.kernelPackages.

There’s some useful aliases for the nvidia driver variants in it, so you can use:

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta

You don’t actually have to change the linux kernel version either, the 6.5 kernel set will have this sub-package, but so will any other kernels, including the LTS release.

2 Likes

Oh didnt know that,

About those aliases, they seem to only go has high as 535.113, https://github.com/NixOS/nixpkgs/blob/fdd898f8f79e8d2f99ed2ab6b3751811ef683242/pkgs/os-specific/linux/nvidia-x11/default.nix

How can I use those 545.23. drivers that appears in the linuxKernel.packages.linux_6_5.nvidia_x11_beta

LIke :

hardware.nvidia.package = config.boot.kernelPackages_6_5.nvidiaPackages.beta; #(Be 545.23. please)

Don’t know what commit you dug up there, but it certainly wasn’t the latest unstable branch: https://github.com/NixOS/nixpkgs/blob/7c9cc5a6e5d38010801741ac830a3f8fd667a7a0/pkgs/os-specific/linux/nvidia-x11/default.nix#L56

I dont know whats going on then :melting_face:,

I have my nix-channel set to unstable

And my flake.nix is also in unstable:

I have my configuration with beta:

And I run:
sudo nix-channel --update
and
sudo nixos-rebuild switch --upgrade
and
reboot

But my
nvidia-smi and nvidia setting
stills gives me 535.

image

Any ideas? :face_with_diagonal_mouth:

Looks like you last updated your flake 3 weeks ago then. Flakes don’t touch channels.

You need to periodically run nix flake update in your flake directory, this will update all your flake inputs.

4 Likes

YESSSIR THANK YOU
IT WORKS!!

Yeah… I actually started using nixos 3 weeks ago :sweat_smile:

So just to know,
if I want to update my packges and I have a flake active

sudo nix-channel update
sudo nixos-rebuild switch --upgrade

will not work
Ill have to

sudo nix flake update
sudo nixos-rebuild switch

because the flake will be the one controlling the packages, right?

And btw have you encounter the error on top before?


if i restart i will gut stuck on
[OK]Reached target graphical interface
so ill have to poweroff and boot the previous generation

Im currently following the comment by @commzyh in cuda - Nvidia NVML Driver/library version mismatch - Stack Overflow

The sudo here is only necessary if the files in your flake are owned by root (specifically flake.lock), but yes, if you use the default /etc/nixos/ location that’s likely the case.

Yep, exactly :slight_smile: You can look in flake.lock to see exactly which commits of your inputs you are using.

This typically happens if you’ve not rebooted after updating nvidia drivers. There will be some library headers on your machine that end up getting very confused because they were written for a newer nvidia driver, but your running system hasn’t actually upgraded yet. To upgrade kernel/kernel modules, a restart is required.

That sucks after all this effort :expressionless: Not sure what would be the cause of that specifically, but the drivers are marked beta for a reason.

1 Like

Yeah I use the default dir lol

Oh I see, yeah it looks like a record of some sort, and theres this locked and original versions

Indeeeeed, so the gpu drivers are good, I think the error arises because of the

# Load nvidia driver for Xorg and 
services.xserver.videoDrivers = ["nvidia"]; #maybe are giving 535

those might not be updated yet to match the 545 of the gpu drivers set in
package = config.boot.kernelPackages.nvidiaPackages.beta;

I guess now is just waiting time, right? or is there something that could be done :melting_face:

You may have gotten confused by @TLATER’s comment here. kernelPackages_6_5 has nothing to do with nvidia and it’s a package while boot.kernelPackages is an option where a kernelPackages package such as kernelPackages_6_5 could be set. What you want is

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;

and then you must reboot (or manually switch out the kernel modules but that’s complicated).

Check the logs of that boot attempt. “[OK] Reached target graphical interface” just means it couldn’t actually start showing the graphical interface and got stuck on the frame before.

Make sure you’re not using 6.5 but rather some LTS kernel. Nvidia’s kernel modules often aren’t compatible with the newest kernel, sometimes in subtle ways.

This isn’t the issue. The driver package used by setting this is decided by hardware.nvidia.package.

2 Likes

There are currently some issues with the 545 driver and its udev rules, please take a look at nixos/nvidia: partially revert #181674 by Kiskae · Pull Request #262135 · NixOS/nixpkgs · GitHub before proceeding.

1 Like

And just asking, I do that by tty ctrl alt f3 and then journalctl right? or is there other command?

Yeah, I went back to the LTS that is 6.1 ,but this time it was worse I think, I just got a black screen with a tilting underscore in the top right of the screen.

If it has booted far enough that you can access other ttys, that’s a good start. You can limit the logs to just the current boot with journalctl --boot. If it does not boot far enough, you can try with journalctl --boot -1 to get the previous boot.

dmesg also gives different output focused on what the kernel is doing, which might be useful in this case.

Oh thank you!

That might be it, so the pr has been reviewed and passed all the checks it just now needs to be merged.

And indeed I remember yesterday I try killing all processes using nvidia, and then unmounting nvidia and then using sudo modprobe nvidia and sudo modprobe nvidia_drm, and still was getting the error