I have been trying to get a working config on my horrible nvidia laptop for the past 5 days. After spending 20+ hours and testing hundreds of configs, I just cant get it working. I wouldve given up except that I got it working a single time, then updated my flake to work with home-manager, then lost the working config along the way and couldnt revert
The setup I am trying to achieve is plasma 6 + nvidia 560. The driver builds correctly but both sddm x11/wayland and startplasma-wayland always ends up with one of the following:
- black screen
- blinking underscore
- flash from [ OK ] messages to black several times, then crash to tty
- sddm fails, I can launch plasma manually, but the cursor leaves a trail around the screen and the whole desktop is unusably laggy
- boot straight to tty
I know that the driver is doing something as I my other monitors turn on when it is loaded during boot.nvidia-smi
also always returns an output with the correct driver number.
Most of my testing has been with the LTS kernel but I frequently switched to latest too. I tried other driver versions with none working, as well as every 24.05 release from august
I tried launching hyprland a couple times with no success.
I am exhausted and have seen so many error messages that I donât even know what to include. If you donât immediately see an issue with my config, please give me a starting point and could we try debug from there.
Here is the config file with the butt load of different options I have been trying:
{ config, pkgs, upkgs, lib, ... }:
{
imports = [ ./boilerplate.nix ];
#system.nixos.label = "stable-KDE_unstable-kernel-lts-nvidia-latest";
services.xserver.videoDrivers = [ "nvidia" ];
#hardware.graphics.enable = true;
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
hardware.nvidia.modesetting.enable = true;
hardware.nvidia.powerManagement.enable = false;
hardware.nvidia.powerManagement.finegrained = false;
#hardware.nvidia.forceFullCompositionPipeline = true;
hardware.nvidia.open = false;
hardware.nvidia.nvidiaSettings = false;
#boot.kernelPackages = upkgs.linuxPackages_latest;
#hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.latest;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "560.35.03";
sha256_64bit = "sha256-8pMskvrdQ8WyNBvkU/xPc/CtcYXCa7ekP73oGuKfH+M=";
sha256_aarch64 = "sha256-s8ZAVKvRNXpjxRYqM3E5oss5FdqW+tv1qQC2pDjfG+s=";
openSha256 = "sha256-/32Zf0dKrofTmPZ3Ratw4vDM7B+OgpC4p7s+RHUjCrg=";
settingsSha256 = "sha256-kQsvDgnxis9ANFmwIwB7HX5MkIAcpEEAHc8IBOLdXvk=";
persistencedSha256 = "sha256-E2J2wYYyRu7Kc3MMZz/8ZIemcZg68rkzvqEwFAL3fFs=";
};
#boot.initrd.kernelModules = [ "nvidia"
# "nvidia_drm" "nvidia_uvm" "nvidia_modeset" "i2c-nvidia_gpu"
#];
#boot.extraModulePackages = [
# config.boot.kernelPackages.nvidia_x11
#];
#boot.kernelModules = [ "hp-wmi" ];
hardware.enableRedistributableFirmware = true;
#hardware.enableAllFirmware = true;
#services.thermald.enable = true;
environment.systemPackages = with pkgs; [
egl-wayland
nvidia-vaapi-driver
#vulkan-headers
];
boot.kernelParams = [
"nvidia-drm.fbdev=1"
"module_blacklist=i915"
];
boot = {
extraModprobeConfig =
"options nvidia "
+ lib.concatStringsSep " " [
# nvidia assume that by default your CPU does not support PAT,
# but this is effectively never the case in 2023
"NVreg_UsePageAttributeTable=1"
# This may be a noop, but it's somewhat uncertain
"NVreg_EnablePCIeGen3=1"
# This is sometimes needed for ddc/ci support, see
# https://www.ddcutil.com/nvidia/
#
# Current monitor does not support it, but this is useful for
# the future
"NVreg_RegistryDwords=RMUseSwI2c=0x01;RMI2cSpeed=100"
# When (if!) I get another nvidia GPU, check for resizeable bar
# settings
];
};
environment.variables = {
# these three are apparently required
WLR_NO_HARDWARE_CURSORS = "1";
GBM_BACKEND = "nvidia-drm";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
#LIBVA_DRIVER_NAME = "nvidia";
#XDG_SESSION_TYPE = "wayland";
#NVD_BACKEND = "direct";
# Electron apps fix
#NIXOS_OZONE_WL = "1";
# Firefox VA
#MOZ_DISABLE_RDD_SANDBOX = "1";
# QT X11 fallback if wayland has issues, idk if both are necessary
#QT_QPA_PLATFORM = "wayland";
#QT_QPA_PLATFORMTHEME = "qt6ct";
};
}