Good morning/evening/{time-of-day}!
I recently started to try to switch over to flakes, and in the process noted that my system was switched over to unstable. While most of the system is actually working somewhat better (as a consequence of more up to date software I’d assume), I’ve encountered a problem with games and my Nvidia GPU utilization. As nothing changed about my packages aside from the channel they’re being pulled from (and the hyprland flake I’m using seems to be the same as Unstable) I’m fairly sure there’s some kind of bug going on, but I’m not really sure how to track it down to report to the right people.
To that end, I’m looking for advice and/or directions on how I can track down (or learn on my own to track down) the issue so I can report it to either the NixOS bug tracker or another relevant tracker.
Some basic information to start:
lspci | grep VGA >>
0000:00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P Integrated Graphics Controller (rev 0c)
0000:01:00.0 VGA compatible controller: NVIDIA Corporation GA104M [Geforce RTX 3070 Ti Laptop GPU] (rev a1)
The problem: having moved to unstable in moving to flakes, my performance in games and video accelerated applications has taken a serious nosedive. I normally get ~70-80 FPS on Ultra settings with Raytracing in games (Control, Valheim, Satisfactory, etc etc etc). After updating into unstable I average 15-20 FPS at the same settings. At the same time GPU utilization reports via nvidia-smi
and nvidia-settings
both as 100% at ALL times. As said, no changes were made to my configuration other than setting up flakes with unstable. The entirety of my current /etc/nixos/flake.nix:
{
description = “Zeta’s base NixOS Flake”;inputs = {
# Official NixOS package source, using nixos-unstable branch here
nixpkgs.url = “github:NixOS/nixpkgs/nixos-unstable”;
#nixpkgs.url = “github:NixOS/nixpkgs/nixos-23.05”;# home-manager, used for managing user configuration #home-manager = { #url = "github:nix-community/home-manager/release-23.05"; # The `follows` keyword in inputs is used for inheritance. # Here, `inputs.nixpkgs` of home-manager is kept consistent with # the `inputs.nixpkgs` of the current flake, # to avoid problems caused by different versions of nixpkgs. #inputs.nixpkgs.follows = "nixpkgs"; #}; hyprland.url = "github:hyprwm/Hyprland"; xdg-desktop-portal-hyprland.url = "github:hyprwm/xdg-desktop-portal-hyprland";
};
outputs = { self, nixpkgs, hyprland, … }@inputs: {
nixosConfigurations = {
“nixos” = nixpkgs.lib.nixosSystem {
system = “x86_64-linux”;specialArgs = inputs; modules = [ # Import the configuration.nix here, so that the # old configuration file can still take effect. # Note: configuration.nix itself is also a Nix Module, ./configuration.nix hyprland.nixosModules.default {programs.hyprland.enable = true;} ]; }; };
};
}
I don’t even have home-manager yet, since I’ve been trying to go slowly learning NixOS. All other settings have been kept the same.
From /etc/nixos/configuration.nix:
OpenGL settings
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiIntel
nvidia-vaapi-driver
vaapiVdpau
libvdpau-va-gl
intel-media-driver
];
};Nvidia settings
services.xserver.videoDrivers = [ “nvidia” ];
hardware.nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.vulkan_beta;
};boot.kernelParams = [ “module_blacklist=i915” ]; #blacklist integrated GPU
boot.blacklistedKernelModules = [ “nouveau” ];
boot.extraModprobeConfig = “options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3;"\n”;
I can confirm that changing most of these settings does not solve the problem. Open vs Non-Open drivers, package set to stable vs vulkan_beta, modesetting, etc, have all been tested.
The extraModprobeConfig options are used for making sure Hyprland doesn’t have ugly black artifacting; removing those options doesn’t appear to make a difference. Additionally I tried a workaround for passing Vulkan variables into Steam that I found on the Discourse from a while back but that also doesn’t seem to have made a difference.
Having taken a look at journalctl --boot, the only things I can find that seems to be related to Nvidia having an error are:
Aug 28 18:06:57 nixos (udev-worker)[764]: nvidia: Process ‘/nix/store/r4vxljid3iq94jp7qvd639sps0fscwy3-bash-5.2-p15/bin/bash -c ‘mknod -m 666 /dev/nvidiactl c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) 255’’ failed with exit code 1.
Aug 28 18:06:58 nixos (udev-worker)[764]: nvidia: Process ‘/nix/store/r4vxljid3iq94jp7qvd639sps0fscwy3-bash-5.2-p15/bin/bash -c ‘for i in $(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \ -f 4); do mknod -m 666 /dev/nvidia${i} c $(grep nvidia-frontend /proc/devices | cut -d \ -f 1) ${i}; done’’ failed with exit code 1.
Finally I did notice that nvidia-settings, in the new version, does give me more information than it used to. Specifically it lists in “Graphics Information” the subheading “EGL”, with information that looks like it’s related to Mesa. (I find this odd given that Mesa is Intel? Stable channel 23.05 nvidia-settings lists nothing in this tab at all, though I suppose that’s not unexpected given it’s Wayland.)
I’m not really looking for anybody to do the work for me, but I’d appreciate some pointers to figure out why it’s happening. At very least I’d like to be able to report the issue before I have to figure out how to get my system to move back to a mix of Stable and Unstable, even if I can’t fix it directly.
Please and thank you in advance?