whatever, still sorta works

This commit is contained in:
Andreas Schaafsma 2024-12-09 23:35:27 +01:00
parent f7823d9ad3
commit 4454eb84fb

View File

@ -18,9 +18,13 @@ in
# Enable NVIDIA driver for X11 and Wayland # Enable NVIDIA driver for X11 and Wayland
# without modesetting, x server will be run by nvidia # without modesetting, x server will be run by nvidia
services.xserver.videoDrivers = [ services.xserver.videoDrivers = [
"amdgpu"
#"modesetting"
"nvidia" "nvidia"
# "nvidia-drm"
# "nvidia-uvm"
# "nvidia-modeset"
# "nvidiafb"
"amdgpu"
# "modesetting"
]; ];
# Enable OpenGL # Enable OpenGL
@ -43,13 +47,13 @@ in
# Enable required Kernel Modules # Enable required Kernel Modules
boot.initrd.kernelModules = [ boot.initrd.kernelModules = [
"amdgpu"
"nvidia" "nvidia"
# # "nvidia-drm" "nvidia-drm"
# # "nvidiafb" "nvidia-uvm"
# # # "nvidia-uvm" "nvidia-modeset"
# # "nvidia-modeset" "nvidiafb"
# # "i2c-nvidia_gpu" "amdgpu"
# # "i2c-nvidia_gpu"
]; ];
@ -83,59 +87,90 @@ in
# options nouveau modeset=0 # options nouveau modeset=0
# ''; # '';
# services.xserver.config = lib.mkForce ''
# Section "ServerLayout"
# Identifier "layout"
# Screen 0 "amdgpu"
# Inactive "nvidia"
# Option "AllowNVIDIAGPUScreens"
# EndSection
# Section "Device"
# Identifier "nvidia"
# Driver "nvidia"
# BusID "PCI:01:0:0"
# EndSection
# Section "Screen"
# Identifier "nvidia"
# Device "nvidia"
# EndSection
# Section "Device"
# Identifier "amdgpu"
# Driver "amdgpu"
# BusID "PCI:50:0:0"
# EndSection
# Section "Screen"
# Identifier "amdgpu"
# Device "amdgpu"
# EndSection
# '';
# Configure NVIDIA driver # Configure NVIDIA driver
hardware.nvidia = { hardware.nvidia = {
# Modesetting is required. # Modesetting is required.
modesetting.enable = true; modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail. # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking # Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials. # of just the bare essentials.
powerManagement.enable = true; powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use. # Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer). # Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false; powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the # Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver). # independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of # Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at: # supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+ # Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting. # Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false; open = false;
# Enable the Nvidia settings menu, # Enable the Nvidia settings menu,
# accessible via `nvidia-settings`. # accessible via `nvidia-settings`.
nvidiaSettings = true; nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU. # Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta; package = config.boot.kernelPackages.nvidiaPackages.beta;
# package = config.boot.kernelPackages.nvidiaPackages.none; # package = config.boot.kernelPackages.nvidiaPackages.none;
# package = config.boot.kernelPackages.nvidiaPackages.production; # package = config.boot.kernelPackages.nvidiaPackages.production;
nvidiaPersistenced = true; nvidiaPersistenced = true;
forceFullCompositionPipeline = false; forceFullCompositionPipeline = true;
prime = { prime = {
offload = { offload = {
enable = true; enable = true;
enableOffloadCmd = true; enableOffloadCmd = true;
};
# sync.enable=true;
# reverseSync.enable = false;
# Make sure to use the correct Bus ID values for your system!
# intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
}; };
# sync.enable=true;
}; # reverseSync.enable = false;
# Add user to extra groups # Make sure to use the correct Bus ID values for your system!
users.users.andreas = { # intelBusId = "PCI:0:2:0";
extraGroups = [ "video" "render" ]; nvidiaBusId = "PCI:1:0:0";
amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
}; };
}; };
# Add user to extra groups
users.users.andreas = {
extraGroups = [ "video" "render" ];
};
};
} }