i have an rtx 2060 and i have tried all of the driver versions listed in the wiki aswell as a few forum posts a saw after doing anything may things happen like my performance tanks discord dosent launch minecraft flashes rapidly with a red screen and more
these are the config settings im trying to use
# nixpkgs.config.nvidia.acceptLicense = true;
# hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; #dosent work
# hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta; #dosent work
# hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.production; #dosent work
# hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta; #dosent work
# DO NOT USE # hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470; # DOES NOT WORK KILLS PC PERFORAMNCE
# services.xserver.videoDrivers = [ "nvidia" ]; #even using this by itself or along side open gl it dosent work as intended
# hardware.opengl.enable = true;
# hardware.opengl.driSupport32Bit = true; #seemingly does nothing
# hardware.nvidia.modesetting.enable = true;
# hardware.nvidia.powerManagement.enable = true;
# hardware.nvidia.open = false; #changes nothing weither open source or not when rebuilding and then rebooting
# hardware.nvidia.nvidiaSettings = true;
each time i changed a value i use nixos-reboot switch and then also rebooted my pc
if you require any more information let me know i would really like to get this fixed
UPDATE
i tried the fix for the 4070 super Nvidia - NixOS Wiki and it has fixed minecraft not loading 1/2 issues that im having now my discord opens atleast i just need to stop it from being a black screen
Yeah, that’s just wayland problems currently, sadly, at least without explicit sync, which KDE has AIUI, but only with the very latest nvidia driver.
You’ll have to be a bit more clear about what other problems you’re encountering. The most recent nvidia driver helps even without explicit sync on sway in my case (2070) - are your channels up to date? What nvidia driver is actually installed? Check nvidia-settings for that.
im on KDE.
i have fixed the minecraft issue via the 4070 fix. now the only issue that i am running into is discord opens but is just black there is no ui it seems to be a driver issue as it wasnt present before i tried installing drivers
the driver that is installed now is 535.154.05. im not sure what the NVML Version means but if its importat its 12.535.154.05
Phoronix’ nvidia section is a good RSS feed to follow if you want to know when there are new driver versions.
Don’t use https://nixos.wiki, it’s outdated, poorly maintained and often wrong to begin with - we have an official wiki nowadays: NixOS Wiki - NixOS Wiki. The configuration you copied likely just incidentally also switched to a driver unaffected by whatever bug causes this rather than being a real “fix”.
Give this config a shot:
hardware.nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
# This is the latest driver with the CVE patches + explicit sync
version = "555.52.04";
sha256_64bit = "sha256-nVOubb7zKulXhux9AruUTVBQwccFFuYGWrU1ZiakRAI=";
sha256_aarch64 = "sha256-Kt60kTTO3mli66De2d1CAoE3wr0yUbBe7eqCIrYHcWk=";
openSha256 = "sha256-wDimW8/rJlmwr1zQz8+b1uvxxxbOf3Bpk060lfLKuy0=";
settingsSha256 = "sha256-PMh5efbSEq7iqEMBr2+VGQYkBG73TGUh6FuDHZhmwHk=";
persistencedSha256 = "sha256-KAYIvPjUVilQQcD04h163MHmKcQrn2a8oaXujL2Bxro=";
};
# Modesetting is required for various things, you should almost never
# run non-modesetting drivers these days
modesetting.enable = true;
# Power management is required to get nvidia GPUs to behave on
# suspend, due to firmware bugs. Aren't nvidia great?
powerManagement.enable = true;
# powerManagement.finegrained only makes sense if you have a multi-gpu setup
# nvidiaSettings is enabled by default anyway
# The open driver is recommended even by nvidia these days
open = true;
};
# Without this you won't be using nvidia's semi-proprietary driver,
# but the very slow nouveau
services.xserver.videoDrivers = ["nvidia"];
Can you also run sudo nix-channel --update as well as give us the output of sudo nix-channel --list? If your nixpkgs is outdated, that will explain a lot of these issues.
im trying out the config right now just running rebuild (ill let you know how that goes :D) but this was the output of --list.
nixos nixos-24.05 release nixos-24.05.1695.dd457de7e08c
i hope its up to date i just installed the os today
Minecraft working nice! discord now just crashing when i run it this is what i get as the output Paste.ee - discord crash i will most likely just have to try out jims fix as the --use-gl=desktop seemed to work
oooo yea i completly forgot about doing that…! ill stick to that then
thank you so much for your help!
one last noobie question if you dont mind do packages listed in the config file auto update or is there a command i need to run to update everything?
Whenever there is a new NixOS release (the next one will be in November/December) you’ll have to do some extra stuff too, check back then.
Again, your nvidia driver will not automatically update since you define the package manually. This is fine, I do that too because the NixOS package is anyway outdated most of the time. But that does mean that you’ll need to keep track of nvidia driver releases manually.
Note the sudo on sudo nix-channel --update is important - your user has a separate set of channels that are not used for system updates, so it’s easy to accidentally update your user channels and forget about the root channels.
Note that some apps may not work on wayland or not work as expected and depending on support, there may not always be some workaround - specially with nvidia drivers.
I’m currently switching between x11 and wayland for different use cases.
If you keep the strings empty nix will tell you the correct hashes and you can then plug those in.
Alternatively, download the files yourself, ensure they aren’t corrupt somehow, and calculate them with sha256sum. I’m too lazy to do that. Sadly nvidia don’t provide checksums.
They always include a link. I’m sure there’s some nvidia RSS feed for the beta drivers or something, but I’ve never found it.
I’ve been sticking to beta since switching to wayland because the stable driver has been very broken 99% of the time anyway, so there’s not much benefit to using it.
# Currently alpha-quality/buggy, so false is currently the recommended setting. open = false;
Not sure if my settings got wrong or some programs conflicted with that but it seems that’s it’s required when installing either unstable branch drivers or manually declare them (as shown in your solution), otherwise kernel will fail to build when running nixos-rebuild.
I’ve tried different kernels from 6.6 (stable from 24.05) to 6.9.6 (latest), all failed to build.
The official wiki lists it as “beta”, which is Nvidia’s current statement. Still, even with the official wiki updatedness will drift, there’s just not enough people keeping stuff up-to-date, so it’s best to go straight to the source (this comment, too, will be outdated in a few weeks/months)…
The tl;dr is, if you’re not using gsync or older GPUs (older than Turing) it should be pretty much the same, in fact the open module now supports several features the closed module doesn’t.