Skip to content

Instantly share code, notes, and snippets.

@XakepSDK
Last active June 16, 2024 12:13
Show Gist options
  • Select an option

  • Save XakepSDK/2266be5f26c10c0b155d4313720acfe2 to your computer and use it in GitHub Desktop.

Select an option

Save XakepSDK/2266be5f26c10c0b155d4313720acfe2 to your computer and use it in GitHub Desktop.

Nvidia Linux kickstart guide

Terms

  1. Userspace driver - implements APIs like OpenGL, Vulkan, OpenCL, CUDA, etc
  2. Kernel driver - manages hardware
  3. GSP - nvidia co-processor to offload some or all hardware management to the hardware itself

Current state

Made by NVIDIA:

  1. Nvidia open kernel drivers - nvidia kernel driver with mixed MIT and GPL licenses. The intention is to completely replace proprietary kernel driver with it in the future. Not included in the linux kernel. It means it must be installed manually. Open kernel drivers use GSP.
  2. Nvidia proprietary kernel drivers - proprietary version of the open kernel drivers. Proprietary driver does not use GSP
  3. Nvidia proprietary userspace driver - Driver that implements many features, like OpenGL, OpenCL, Vulkan, CUDA, RTX, etc. Works only with nvidia open or proprietary driver. Does not work with Nouveau

Made by 3rd part companies and community:

  1. Nouveau - open source kernel driver for nvidia graphics cards. Included in the kernel. It means you don't need to install it separately. Nouveau uses GSP.
  2. NVK - open source vulkan driver for nvidia. Works only with nouveau

Arch Linux Guide

This guide assumes you have fresh Arch Linux installation with stock kernel (linux package is used as your main kernel)

  1. Install nvidia driver: pacman -S nvidia. This will install nvidia proprietary kernel driver and proprietary userspace driver
  2. Reboot OR refer to the extra configs part. After you finish configuring extra configs, you need to reboot.
  3. Congratulations! You're ready to run graphical applications.

Extra configs

To use some of extra configs, you need to pass parameters to the nvidia kernel module. Create file named nvidia.conf here /etc/modprobe.d/. Full path to the file should look like this: /etc/modprobe.d/nvidia.conf

Each line in the file should contain one entry in this format: options kernelModuleName moduleParameter=parameterValue

Nvidia made open and proprietary driver contains several kernel modules. Don't be surprised when you see something else than nvidia in kernalModuleName place. It's ok as long as it contains nvidia.

  1. Enable Wayland: Put this line in your nvidia.conf:
    options nvidia-drm modeset=1

  2. Enable suspend/resume:
    There are two ways to enable it. This guide only shows modern way. Please, refer to the nvidia driver readme if you want to use old way.
    You can read more about suspend states here: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate
    First, check if your hardware supports it:

    For GPU:

    1. Run this: grep 'Video Memory Self Refresh' /proc/driver/nvidia/gpus/*/power
    2. If the output says it's supported, proceed with CPU check. If not, you need to use old way.

    For CPU:

    1. Run this: cat /sys/power/mem_sleep
    2. Output does not contain s2idle: You need to use old way for suspend/resume
    3. Output contains s2idle, but it's not in [], e.g. it's not [s2idle] -> refer to the guide link above to enable it
    4. Output contains [s2idle] -> the best case, put this in your nvidia.conf:
      options nvidia NVreg_EnableS0ixPowerManagement=1
  3. What about PAT:
    It's enabled by default on supported configurations

  4. What about xorg config:
    You don't need it. Xorg will auto-configure everything.

  5. What about tearing:
    You need a compositor with working VSync implementation. KDE Plasma and Gnome have it.

  6. What about ...:
    You don't need it. It should just work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment