Switch desktop to Vega 8 iGPU, NVIDIA via PRIME offload

The Radeon Vega 8 iGPU now drives the desktop; the RTX 3060 Ti is used
through PRIME offload for games (everything launched by Steam) and for
LLMs (CUDA). Firefox video decoding moves to the iGPU's radeonsi VA-API,
so the nvidia-vaapi env vars are gone and Firefox's RDD sandbox is back on.
Requires the iGPU enabled as primary display in BIOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nexoniarz 2026-10-07 19:19:05 +02:00
commit 721f1d509c
2 changed files with 33 additions and 21 deletions

View file

@ -10,7 +10,7 @@ My personal NixOS system configuration.
- **Terminal:** Konsole - **Terminal:** Konsole
- **Shell:** Zsh - **Shell:** Zsh
- **Audio:** PipeWire - **Audio:** PipeWire
- **GPU:** NVIDIA (open kernel modules, primary) + Radeon Vega 8 iGPU (compute) - **GPU:** Radeon Vega 8 iGPU for the desktop, NVIDIA RTX 3060 Ti (open kernel modules) via PRIME offload for games and LLMs
## Layout ## Layout

View file

@ -6,35 +6,47 @@
enable32Bit = true; enable32Bit = true;
}; };
# NVIDIA stays primary (monitors are on it); the 5700G's Radeon Vega 8 iGPU # PRIME offload: the 5700G's Radeon Vega 8 iGPU runs the desktop (monitors
# is a second GPU for compute, e.g. LM Studio's Vulkan runtime. It must be # plugged into the motherboard), the RTX 3060 Ti only wakes up for games
# enabled in the BIOS (Integrated Graphics = Forced, primary = PEG/PCIe). # and LLMs. Needs in the BIOS: Integrated Graphics = Forced/Enabled and
# The amdgpu kernel module loads by itself, and hardware.graphics already # primary display = IGD/iGPU. KWin then picks the iGPU as the boot VGA.
# provides Mesa's RADV Vulkan driver for it. # amdgpu loads by itself; hardware.graphics provides Mesa (RADV, radeonsi).
services.xserver.videoDrivers = [ "nvidia" "amdgpu" ]; services.xserver.videoDrivers = [ "nvidia" ];
environment.systemPackages = with pkgs; [
vulkan-tools # vulkaninfo --summary: check both GPUs are visible
amdgpu_top # usage/VRAM monitor for the iGPU
];
hardware.nvidia = { hardware.nvidia = {
modesetting.enable = true; modesetting.enable = true;
open = true; open = true;
nvidiaSettings = true; nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable; package = config.boot.kernelPackages.nvidiaPackages.stable;
prime = {
offload.enable = true;
offload.enableOffloadCmd = true; # `nvidia-offload <app>` runs it on the RTX
amdgpuBusId = "PCI:7:0:0";
nvidiaBusId = "PCI:1:0:0";
};
}; };
# Hardware video decoding in Firefox via nvidia-vaapi-driver (installed by # Everything Steam launches (games, Proton/DXVK) renders on the RTX. Same
# hardware.nvidia.videoAcceleration). libva needs the driver named # variables nvidia-offload sets; CUDA apps (LM Studio) don't need them.
# explicitly; the "direct" backend is the working one on driver 525+. programs.steam.package = pkgs.steam.override {
# Firefox's decoder (RDD) sandbox blocks the driver, so it's disabled: extraEnv = {
# trade-off accepted for GPU decode. Prefs live in the profile's user.js. __NV_PRIME_RENDER_OFFLOAD = "1";
environment.sessionVariables = { __NV_PRIME_RENDER_OFFLOAD_PROVIDER = "NVIDIA-G0";
LIBVA_DRIVER_NAME = "nvidia"; __GLX_VENDOR_LIBRARY_NAME = "nvidia";
NVD_BACKEND = "direct"; __VK_LAYER_NV_optimus = "NVIDIA_only";
MOZ_DISABLE_RDD_SANDBOX = "1";
}; };
};
environment.systemPackages = with pkgs; [
vulkan-tools # vulkaninfo --summary: check both GPUs are visible
amdgpu_top # usage monitor for the iGPU
];
# Firefox video decoding runs on the iGPU through Mesa's radeonsi VA-API
# driver, which libva finds on its own: no env vars, and Firefox's decoder
# (RDD) sandbox stays on. Vega 8 decodes H.264, HEVC and VP9; AV1 falls
# back to the CPU.
hardware.opentabletdriver.enable = true; hardware.opentabletdriver.enable = true;
hardware.uinput.enable = true; hardware.uinput.enable = true;