Am I doing this right? On setting up and tweaking the NVIDIA driver

When I started using Linux I had no idea what I was doing (arguably I still don’t) and, obviously enough a lot of things broke on me, especially seeing how this was around early 2019 and the state of NVIDIA drivers was nowhere near as good as it is now.

Eventually, after a lot of work I got everything working pretty great. I learned how to set-up and use Linux by trial and error, by reading a lot of wiki articles and forum posts, by watching a lot of videos.

However, fast forward to 2025 and especially considering the impressive progress the NVIDIA drivers have seen since then, I am now under the strong impression that a lot of the tweaks I currently make are either 1. no longer necessary, 2. redundant, 3. counter productive or perhaps, maybe even all three.

With that out of the way I’d like to ask you to kindly have a look at the way I set up my system and correct anything that I might be doing wrong and/or add anything that I may be missing, because the following are just a mish-mash of commands I found worked at various stages in my Linux journey.

My machine:

System:
  Kernel: 6.13.3-arch1-1 arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
  Desktop: GNOME v: 47.4 Distro: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 82JM v: Legion 5 17ITH6H
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: NO DPK serial: <superuser required>
    UEFI: LENOVO v: H1CN58WW date: 04/11/2024
Battery:
  ID-1: BAT0 charge: 72.8 Wh (91.0%) condition: 80.0/80.0 Wh (100.0%)
    volts: 16.0 min: 15.4 model: Celxpert L20C4PC2 status: not charging
CPU:
  Info: 8-core model: 11th Gen Intel Core i7-11800H bits: 64 type: MT MCP
    arch: Tiger Lake rev: 1 cache: L1: 640 KiB L2: 10 MiB L3: 24 MiB
  Speed (MHz): avg: 800 min/max: 800/2300 cores: 1: 800 2: 800 3: 800 4: 800
    5: 800 6: 800 7: 800 8: 800 9: 800 10: 800 11: 800 12: 800 13: 800 14: 800
    15: 800 16: 800 bogomips: 73728
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel TigerLake-H GT1 [UHD Graphics] vendor: Lenovo driver: i915
    v: kernel arch: Xe bus-ID: 00:02.0
  Device-2: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] vendor: Lenovo
    driver: nvidia v: 570.86.16 arch: Ampere bus-ID: 01:00.0
  Device-3: Syntek Integrated Camera driver: uvcvideo type: USB
    bus-ID: 3-6:2
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.5
    compositor: gnome-shell driver: gpu: i915 resolution: 1920x1080~144Hz
  API: EGL v: 1.5 drivers: iris,nvidia platforms:
    active: gbm,wayland,x11,surfaceless,device inactive: N/A
  API: OpenGL v: 4.6.0 compat-v: 4.6 vendor: intel mesa v: 24.3.4-arch1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel UHD Graphics (TGL GT1)
  API: Vulkan v: 1.4.303 drivers: N/A surfaces: xcb,xlib,wayland devices: 1
  Info: Tools: api: eglinfo, glxinfo, vulkaninfo gpu: nvidia-smi
    x11: xprop,xrandr
Audio:
  Device-1: Intel Tiger Lake-H HD Audio vendor: Lenovo driver: snd_hda_intel
    v: kernel bus-ID: 00:1f.3
  Device-2: NVIDIA GA106 High Definition Audio driver: snd_hda_intel
    v: kernel bus-ID: 01:00.1
  Device-3: Texas Instruments PCM2900C Audio CODEC
    driver: hid-generic,snd-usb-audio,usbhid type: USB bus-ID: 3-11:5
  API: ALSA v: k6.13.3-arch1-1 status: kernel-api
  Server-1: PipeWire v: 1.2.7 status: active
Network:
  Device-1: Intel Tiger Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: Lenovo driver: r8169 v: kernel port: 3000 bus-ID: 58:00.0
  IF: enp88s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth driver: btusb v: 0.8 type: USB
    bus-ID: 3-14:6
  Report: rfkill ID: hci0 rfk-id: 0 state: down bt-service: disabled
    rfk-block: hardware: no software: yes address: see --recommends
Drives:
  Local Storage: total: 2.75 TiB used: 1.12 TiB (40.8%)
  ID-1: /dev/nvme0n1 vendor: SK Hynix model: HFS001TDE9X084N
    size: 953.87 GiB temp: 44.9 C
  ID-2: /dev/nvme1n1 vendor: Kingston model: SNV2S2000G size: 1.82 TiB
    temp: 33.9 C
Partition:
  ID-1: / size: 936.84 GiB used: 312.17 GiB (33.3%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-2: /boot size: 1022 MiB used: 524.7 MiB (51.3%) fs: vfat
    dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: zram size: 4 GiB used: 0 KiB (0.0%) dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 38.0 C mobo: N/A
  Fan Speeds (rpm): N/A
Info:
  Memory: total: 64 GiB note: est. available: 62.58 GiB used: 4.39 GiB (7.0%)
  Processes: 369 Uptime: 15m Init: systemd
  Packages: 1198 Compilers: clang: 19.1.7 gcc: 14.2.1 Shell: Bash v: 5.2.37
    inxi: 3.3.37

My tweaks:
I add nvidia_drm.modeset=1 nvidia-drm.fbdev=1 ibt=off to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub
Then I add nvidia nvidia_modeset nvidia_uvm nvidia_drm to modules in /etc/mkinitcpio.conf
Then I edit /etc/modprobe.d/nvidia.conf and add

options nvidia NVreg_UsePageAttributeTable=1 \
    NVreg_InitializeSystemMemoryAllocations=0 \
    NVreg_DynamicPowerManagement=0x02 \
    NVreg_EnableGpuFirmware=0 \
    NVreg_RegistryDwords=RMIntrLockingMode=1
options nvidia_drm modeset=1

Then I enable and activate nvidia-powerd with sudo systemctl enable nvidia-powerd.service && sudo systemctl start nvidia-powerd.service

And finally I do sudo systemctl enable nvidia-{suspend,resume,hibernate}.

While I haven’t seen any negatives, I do wonder if this is this good practice, if any of this is redundant, or worse still, if any of this is actually counterproductive.

Thank you for your patience and for any input on the matter.

You can skip adding nvidia_drm.modeset=1 nvidia-drm.fbdev=1 to the kernel cmdline and remove it from the nvidia.conf file (last line).

These are enabled by default now.

The rest is still fine / required as far as I know.

1 Like

Are you certain nvidia_drm.modeset=1 is no longer needed? On the CachyOS wiki they say it’s essential especially for Optimus laptops (which is my case) for PRIME Offload to work properly.

https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting

If you are using CachyOS / CachyOS packages it might be different, they have their own packages / make their own changes.

I assume they still include it in their config file for people using older versions of the driver.

1 Like

Fair enough. Thank you for the added clarification.

Also ibt=off should no more be needed.

The stuff in nvidia.conf I’m not sure, some of them might be needed in your system, or not.
And there’s one way to make sure what’s needed: remove settings one at a time and reboot and test.
If it still works as expected, remove another setting the same way until you know for all settings. Note that test also suspend/resume and hibernate if you use those features.

But to be on the safe side:

  • Backup your personal data to an external drive before changing anything.
  • Make sure you have a working USB installer stick available if the system does not boot after a change, because you may need to arch-chroot to your system and revert the problematic change.
1 Like

Fair enugh. ibt=off is from long ago when Arch wouldn’t boot without this.

The state of the nvidia drivers wasn’t really worse in 2019 than it is now. Unless you wanted to use wayland.

My tweaks:
I add nvidia_drm.modeset=1 nvidia-drm.fbdev=1 ibt=off to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub
Then I add nvidia nvidia_modeset nvidia_uvm nvidia_drm to modules in /etc/mkinitcpio.conf
Then I edit /etc/modprobe.d/nvidia.conf and add

I do the nvidia_drm.modeset=1 nvidia-drm.fbdev=1 as well, although i doubt the drm modeset option isn’t default by now since it’s basically necessary by this point, and i totally forgot what the fbdev thing does lol, but I assume I did it for a reason, it’s a recent addition i believe.

The mkinitcpio stuff is not gonna do anything on endeavouros since it uses dracut, it used to be necessary to make the nvidia drivers work on arch back in the day (at least with drm modesetting) but i’m not sure if that’s still the case.

As for your nvidia.conf edits, the nvidia drm modeset option is redundant since you already have it on your kernel commandline (assuming you are in fact using grub and not systemd boot that is, which is default for eos)

Those are all tweaks meant to fix some issues, i believe the NVreg_DynamicPowerManagement=0x02 is supposed to make reclocking available, but practically speaking unless you have a specific reason to use any of these settings, you probably shouldn’t be using them.

Then I enable and activate nvidia-powerd with sudo systemctl enable nvidia-powerd.service && sudo systemctl start nvidia-powerd.service

You don’t need to do this, it’s enabled by default assumming you installed the driver correctly.

And finally I do sudo systemctl enable nvidia-{suspend,resume,hibernate}.

Not sure about this one, it’s not enabled by default but do you really need it? :thinking:

1 Like

As far as I know NVreg_DynamicPowerManagement=0x02 enables the use of dynamic power management allowing the dGPU to be powered down during idle time.

As far as I know this is not required also as it is taken care of in the drivers. :thinking:

1 Like

Maybe this also helps.

https://download.nvidia.com/XFree86/Linux-x86_64/435.17/README/index.html

As I suspected, much of this has since become unnecessary. Thank you all for taking the time to contribute.