Repository navigation
Nvidia
Ota edited this page Oct 4, 2026
·
2 revisions
Alice has one generic Nvidia module. It has no preset yet.
| Item | Name | File |
|---|---|---|
| Module | self.custom.hardwareModules.hardwareNvidia |
modules/hardware/drivers/nvidia.nix |
The module declares options in hardware.alice.nvidia. No host imports it today. Tanuki does not use this module. It sets PRIME offload and Nvidia power management in asusSettings and gets its Nvidia profile from nixos-hardware.
| Option | Default | Effect |
|---|---|---|
enable |
false |
Turns on the Nvidia module. |
open |
true |
Uses the open kernel modules (Turing, RTX 20xx and newer). Set false for Maxwell, Pascal and Volta. |
driver |
"stable" |
Driver branch: stable, beta, production, legacy-470 or legacy-390. |
modesetting |
true |
Turns on kernel modesetting. Wayland needs it. |
forceFullCompositionPipeline |
false |
Fixes screen tearing. It costs some performance. |
powerManagement.enable |
false |
Turns on Nvidia runtime power management. |
powerManagement.finegrained |
false |
Lets the GPU power down when idle. Turing and newer only. Needs prime.mode = "offload". |
prime.enable |
false |
Turns on PRIME hybrid graphics. |
prime.mode |
"offload" |
offload, sync or reverse-sync. See below. |
prime.nvidiaBusId |
"" |
PCI bus ID of the Nvidia GPU. |
prime.intelBusId |
"" |
PCI bus ID of the Intel iGPU. Leave empty for an AMD iGPU. |
prime.amdBusId |
"" |
PCI bus ID of the AMD iGPU. Leave empty for an Intel iGPU. |
| Mode | Behavior |
|---|---|
offload |
The iGPU is the default. The Nvidia GPU runs a program on demand with nvidia-offload. |
sync |
The Nvidia GPU is always on. The iGPU output goes through the Nvidia GPU. |
reverse-sync |
The Nvidia GPU is always on. The iGPU drives the display. |
- Run
lspci | grep -E "VGA|3D". - Read the address of each GPU, for example
c1:00.0. - Convert each hexadecimal number to decimal:
c1:00.0becomesPCI:193:0:0.
-
nixpkgs.config.allowUnfreeistrue(as a default). See Troubleshooting if your host setsallowUnfreetofalse. -
services.xserver.videoDriversis["nvidia"]. -
hardware.graphicsis on, with 32-bit support. -
nvidia_uvmloads as a kernel module whenopenistrue. - These session variables are set:
LIBVA_DRIVER_NAME = "nvidia",__GLX_VENDOR_LIBRARY_NAME = "nvidia"andGBM_BACKEND = "nvidia-drm".
On a hybrid laptop in offload mode, a global GBM_BACKEND or __GLX_VENDOR_LIBRARY_NAME can send all programs to the Nvidia GPU. If you see this, override the variables in your host.
The build stops with a message when prime.enable is true and both prime.intelBusId and prime.amdBusId are empty.
The hardware.alice.vulkan module supports two Nvidia paths:
-
defaultDriver = "nvidia"uses the proprietary driver. This module places the driver files. -
nvidia.nvk = trueadds NVK from Mesa. Use it only without the proprietary driver.defaultDriver = "nvk"needs it.
{
imports = [self.custom.hardwareModules.hardwareNvidia];
hardware.alice.nvidia = {
enable = true;
powerManagement.enable = true;
prime = {
enable = true;
mode = "offload";
nvidiaBusId = "PCI:1:0:0";
amdBusId = "PCI:6:0:0";
};
};
}If more than one host needs the same values, make a preset in modules/hardware/settings/. See Design.