mirror of
https://github.com/zephrynis/nix-flake.git
synced 2026-02-18 20:21:53 +00:00
1.4 KiB
1.4 KiB
NVIDIA Setup Notes
Laptop Bus ID Configuration Required
File to edit: /home/zeph/nix-flake/system/nvidia-laptop.nix
Steps:
-
Run this command on your laptop:
sudo lshw -c display -
Look for the
bus infolines in the output:- Intel GPU:
bus info: pci@0000:00:02.0 - NVIDIA GPU:
bus info: pci@0000:01:00.0
- Intel GPU:
-
Convert the PCI addresses to NixOS format:
pci@0000:00:02.0→PCI:0:2:0(Intel)pci@0000:01:00.0→PCI:1:0:0(NVIDIA)
-
Update the values in
nvidia-laptop.nix:intelBusId = "PCI:0:2:0"; # Replace with your Intel bus ID nvidiaBusId = "PCI:1:0:0"; # Replace with your NVIDIA bus ID -
Rebuild after updating:
sudo nixos-rebuild switch --flake /home/zeph/nix-flake#laptop
Format Conversion Example:
pci@0000:XX:YY.Z → PCI:XX:YY:Z
Remove the 0000: prefix and convert the . to :
Testing NVIDIA Setup
Desktop (RTX 3080):
nvidia-smi- Check if driver is loadednvtop- Monitor GPU usageglxinfo | grep NVIDIA- Verify OpenGL
Laptop (GTX 1050):
nvidia-smi- Check if driver is loadednvidia-offload glxgears- Test offload modenvtop- Monitor both Intel and NVIDIA GPUs
Using NVIDIA on Laptop:
- Normal apps use Intel iGPU (better battery)
- Prefix GPU-intensive apps with
nvidia-offload:nvidia-offload <program>