nvidia_setup
"/home/yossef/notes/personal/linux/nvidia_setup.md"
path: personal/linux/nvidia_setup.md
- **fileName**: nvidia_setup
- **Created on**: 2025-10-18 01:37:53
This document details configurations for NVIDIA drivers
on an Arch Linux system, specifically covering a Pacman
Hook, a Boot Loader Entry, and the mkinitcpio
configuration.
1. Pacman Hook Configuration
Path: /etc/pacman.d/hooks/nvidia.hook
This hook ensures the initramfs is updated whenever the
nvidia
or linux
packages are installed, upgraded, or
removed, guaranteeing the NVIDIA kernel module is always
correctly included.
[Trigger]
Operation=Install
Operation=Upgrade
Operation=Remove
Type=Package
Target=nvidia
Target=linux
[Action]
Description=Updating NVIDIA module in initcpio
Depends=mkinitcpio
When=PostTransaction
NeedsTargets
Exec=/bin/sh -c 'while read -r trg; do \
case $trg in linux*) exit 0; esac; done; \
/usr/bin/mkinitcpio -P'
2. Boot Loader Entry
Path: /boot/loader/entries/arch.conf
This configuration focuses on NVIDIA driver performance
and stability by setting specific kernel parameters.
It is an example entry generated by archinstall
.
# Created by: archinstall
# Created on: 2025-08-09_00-39-14
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=PARTUUID=9e583bd9-bd32-4aef-9962-01ef36dc9cbd \
zswap.enabled=0 \
nvidia.NVreg_OpenRmEnable=1 \
nvidia_drm.modeset=1 \
nvidia_drm.fbdev=1 \
nvidia.NVreg_EnableGpuFirmware=0 \
nvidia.NVreg_PreserveVideoMemoryAllocations=1 \
rw rootfstype=btrfs \
intel_idle.max_cstate=4
Parameter | Description |
---|---|
nvidia.NVreg_OpenRmEnable=1 |
Allows user-space tools to access the driver. |
nvidia_drm.modeset=1 |
Enable Kernel Mode Setting (KMS), needed for Wayland/smooth boot. |
nvidia_drm.fbdev=1 |
Enables framebuffer console (TTY) for NVIDIA. |
nvidia.NVreg_EnableGpuFirmware=0 |
Disables GPU Firmware loading. |
nvidia.NVreg_PreserveVideoMemoryAllocations=1 |
Preserves VRAM across suspend/resume to prevent freezes. |
3. mkinitcpio Configuration
File: mkinitcpio.conf
This configuration includes essential NVIDIA kernel
modules in the initial RAM disk image to ensure they
are loaded early in the boot process.
Section | Change/Value |
---|---|
MODULES |
btrfs nvidia nvidia_modeset nvidia_uvm nvidia_drm |
HOOKS |
kms has been removed. |
# vim:set ft=sh
# MODULES
MODULES=(btrfs nvidia nvidia_modeset nvidia_uvm nvidia_drm)
# HOOKS - kms has been removed to avoid conflict
HOOKS=(base udev autodetect microcode modconf keyboard keymap \
consolefont block filesystems fsck)
continue:[[]]
before:./adding_services.md