Skip to content

Instantly share code, notes, and snippets.

@pantor
Last active May 30, 2026 10:01
Show Gist options
  • Select an option

  • Save pantor/9786c41c03a97bca7a52aa0a72fa9387 to your computer and use it in GitHub Desktop.

Select an option

Save pantor/9786c41c03a97bca7a52aa0a72fa9387 to your computer and use it in GitHub Desktop.
Installing NVIDIA drivers on a realtime Linux (PREEMPT-RT)
# Tested on Ubuntu 16.04 and X11, 2019
# 1. Download NVIDIA driver as a .run file
# 2. Stop X-Server
sudo service lightdm stop
# 3. Blacklist Nouveau driver
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
# Insert into file:
# blacklist nouveau
# options nouveau modeset=0
# 4. Update kernel initramfs
sudo update-initramfs -u
sudo reboot # I'm not sure if needed
# 5. Install driver!
sudo IGNORE_PREEMPT_RT_PRESENCE=1 bash <*>.run # Insert downloaded .run file
# 6. Reboot
sudo reboot
@wolframd

Copy link
Copy Markdown

A few additional remarks for not so competent Users:

Install gcc, make, pkg-config, libglvnd0 and libglvnd0:i386 first (the last three are probably already installed, the first two not necessarily):
sudo apt-get install gcc make pkg-config libglvnd0 libglvnd0:i386 -y

After stopping lightdm, enter console with Alt+F1. Stop the lightdm service before step 5. again, perhaps you can navigate to your Nvidia-xxx.run file in your file manager first, perform a right click and open the folder in your terminal. When you rename your .run file first (e.g. nvidia-525.run) it's much more convenient.

The script suggests installing via gui driver installation, don't do this and confirm "Continue Installation".

Work's like a charme with ubuntucinnamon 23.10.

@wolframd

Copy link
Copy Markdown

Thank you!

@wolframd

Copy link
Copy Markdown

Link for .run file to be found via
docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html#runfile
(as of May 2023)

@mbilalmce

mbilalmce commented May 30, 2023

Copy link
Copy Markdown

Hi,
I installed real-time kernel 5.15.113-rt64 on Ubuntu 20.04.6 LTS. I have NVIDIA GeForce RTX 3080 Ti.
I downloaded the .run file from the Nvidia website. I followed the same instructions, but the system stuck after I reboot the system.
How can I solve this problem? I tried many ways but did not succeed.
Thank you

@chinahuangyong

Copy link
Copy Markdown

Hi, I installed real-time kernel 5.15.113-rt64 on Ubuntu 20.04.6 LTS. I have NVIDIA GeForce RTX 3080 Ti. I downloaded the .run file from the Nvidia website. I followed the same instructions, but the system stuck after I reboot the system. How can I solve this problem? I tried many ways but did not succeed. Thank you

maybe becuse of bios security,you can ref https://askubuntu.com/questions/1408379/cant-set-nvidia-as-default-gpu-ubuntu-freeze-on-boot-after-installing-nvidia-d

@cielavenir

Copy link
Copy Markdown

Based on the IGNORE_PREEMPT_RT_PRESENCE=1 info, I was able to install nvidia-driver-dkms on RT kernel. Thank you!

https://qiita.com/cielavenir/items/c4afeb7af8f2ba510a59

@cielavenir

Copy link
Copy Markdown

Hi, unfortunately there are cases it does not work well. In my case, installing vmware caused kernel panic.

@topin89

topin89 commented Sep 10, 2023

Copy link
Copy Markdown

That worked, but when you install this on bare Ubuntu 22.04 right after debootstraping it, you should also install:

sudo apt install libglvnd-dev pkg-config dkms

and, if you plan using Wine, you should also install i386 version of libglvnd-dev

sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libglvnd-dev libglvnd-dev:i386 pkg-config dkms

Installer itself asked to install these libs and packages

@BryanDucourt

Copy link
Copy Markdown

Worked on Ubuntu 20.04 with 5.15.107-rt62 kernel, thanks a lot

@ionutnechita

ionutnechita commented Feb 24, 2024

Copy link
Copy Markdown

Works correctly with IGNORE_PREEMPT_RT_PRESENCE=1 and nvidia-driver-545=545.29.06-0ubuntu5, on Ubuntu 24.04 and kernel 6.8.0-rc5-realtime-sunlight1-rt4(6.8.0-rc5-rt4).

cat /etc/modprobe.d/nvidia-graphics-drivers-kms.conf
# This file was generated by nvidia-driver-545
# Set value to 0 to disable modesetting
options nvidia-drm modeset=1 fbdev=1

[ 2.705146] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 545.29.06 Thu Nov 16 01:59:08 UTC 2023

@aopolin-lv

Copy link
Copy Markdown

Worked on Ubuntu 20.04 with 5.15.107-rt62 kernel, thanks a lot

Thanks, following this setting, I succeed.

@ynrng

ynrng commented May 15, 2024

Copy link
Copy Markdown

Succeed on 5.15.0-rt17 with ubuntu 20.04.6 . I hesitated when it popped out saying "GUI has better supporting installation versions." Thank you.

@Oct19

Oct19 commented May 25, 2024

Copy link
Copy Markdown

It worked on Ubuntu 22.04 RT with NVIDIA 535

@jmcoholich

Copy link
Copy Markdown

I also installed the RTK on an ubuntu 20 machine with NVIDIA gpus. The machine was working fine for awhile, but now the system only boots into command line after showing "ACPI BIOS Error". startx fails from this command line environment. I'm wondering if installing the RTK with IGNORE_PREEMPT_RT_PRESENCE=1 is the root cause of my issues. (Desktop env failing could indicate problems with graphics drivers).

@liver121888

Copy link
Copy Markdown

Tested on Ubuntu 22.04.5 with version 550 run.sh, works.

@felix-h-kong

Copy link
Copy Markdown

Worked on Ubuntu 22.04.5 with 5.15.0-1072-realtime and NVIDIA-Linux-x86_64-550.127.05.run

@solnox99

solnox99 commented Dec 6, 2024

Copy link
Copy Markdown

Worked on Ubuntu 22.04.5 with 5.15.0-1072-realtime and NVIDIA-Linux-x86_64-550.127.05.run

저도 같은 조건에서 잘 되었습니다.

@pcchenxi

Copy link
Copy Markdown

Worked on Ubuntu 20.04 with 5.15.107-rt62 kernel, thanks a lot

Worked on the same setting, Ubuntu 20.04 with 5.15.107-rt62 kernel and Nvidia-535, thanks a lot!

@hwmanager

Copy link
Copy Markdown

it worked on the same setting, Ubuntu 22.04 with 5.15.0-1081-realtime kernel and nvida-535. thx bro

@yaoweixiao-ux

Copy link
Copy Markdown

Hi ALL how did I get 5.15.0-1081-realtime or 5.15.0-1072-realtime kernel
I can't find this two version in following 2 URL
https://www.kernel.org/pub/linux/kernel/
https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/5.15/older/

@yaoweixiao-ux

Copy link
Copy Markdown

@hwmanager

hwmanager commented May 20, 2025

Copy link
Copy Markdown

@yaoweixiao-ux

There was a misunderstanding.
i mean a realtime kernel with a ubuntu pro kernel

@racarla96

Copy link
Copy Markdown

Works correctly with IGNORE_PREEMPT_RT_PRESENCE=1 and nvidia-driver-545=545.29.06-0ubuntu5, on Ubuntu 24.04 and (6.8.0-rc5-rt4).

cat /etc/modprobe.d/nvidia-graphics-drivers-kms.conf # This file was generated by nvidia-driver-545 # Set value to 0 to disable modesetting options nvidia-drm modeset=1 fbdev=1

[ 2.705146] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 545.29.06 Thu Nov 16 01:59:08 UTC 2023

How can I install kernel 6.8.0-rc5-realtime-sunlight1-rt4?

@ionutnechita

Copy link
Copy Markdown

Hi @racarla96,

Are you looking to install the realtime version from the 6.8 branch? I'd be happy to help you get it set up properly.
To provide you with the most accurate guidance, could you please share some details about your current setup:

Your current Linux distribution and version
Hardware specifications (CPU architecture, etc.)
What specific realtime features you're planning to use
Any particular use case or application you have in mind

As the author and maintainer of the Sunlight Linux kernel, I can provide you with detailed installation instructions, configuration recommendations, and help troubleshoot any issues you might encounter during the process.
For more efficient communication and detailed technical support, feel free to reach out to me directly at: ionut.nechita@protonmail.com
This way we can have a more streamlined conversation and I can provide you with personalized assistance based on your specific needs.

Best regards,
Ionut Nechita
ionutnechita
Sunlight Developer Kernel - AMD/Intel Lowlatency Platform

@spookyfirehorse

Copy link
Copy Markdown

yes with the runfil is it possible to install nvidia-driver on 6.12 rt kernel !!

but when you install cuda with runfile and compile ffmpeg --eenable-cuda-nvcc the error is nvcc not found

when i install nvidia-cuda-toolkit wih apt without repro from nvidia nvcc was found

but when i install cuda with apt i must install nvidia-driver also and than i have no realtime kernel

regards spooky

@pucciland95

Copy link
Copy Markdown

Tested with Ubuntu 24.04 and 6.11.1-rt7 and Nvidia Driver Version: 570.195.03.
It works!

Cheers

@spookyfirehorse

Copy link
Copy Markdown

ubuntu running without any work and sorry for my bad english !

i search long time for a solution but i found a solution for debian 13 trixie

sudo apt install libfdk* nvidia-cuda-toolkit nvidia-driver nvidia-kernel-dkms build-essential yasm cmake libtool libc6 libc6-dev unzip wget libnuma1 libnuma-dev ffmpeg mpv

sudo apt-build-dep ffmpeg mpv

sudo reboot

sudo nano /usr/src/nvidia-current-550.163.01/dkms.conf

put this in

###########################

# DKMS configuration for the NVIDIA kernel module.  -*- sh -*-

PACKAGE_NAME="nvidia-current"
PACKAGE_VERSION="550.163.01"

 # Only kernels from 3.10 onwards are supported.
#BUILD_EXCLUSIVE_KERNEL="^(3\.[1-9][0-9]|[4-9]\.)"

 # The NVIDIA driver does not support real-time kernels.
 #BUILD_EXCLUSIVE_CONFIG=""
 #BUILD_EXCLUSIVE_CONFIG="!CONFIG_PREEMPT_RT !CONFIG_PREEMPT_RT_FULL"


 AUTOINSTALL=yes

 MAKE[0]="env NV_VERBOSE=1 \
  make ${parallel_jobs+-j$parallel_jobs} modules KERNEL_UNAME=${kernelver} IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 "
 CLEAN="true"

 BUILT_MODULE_NAME[0]="nvidia"
 DEST_MODULE_NAME[0]="$PACKAGE_NAME"
 DEST_MODULE_LOCATION[0]="/updates/dkms"

 BUILT_MODULE_NAME[1]="nvidia-modeset"
 DEST_MODULE_NAME[1]="$PACKAGE_NAME-modeset"
 DEST_MODULE_LOCATION[1]="/updates/dkms"

 BUILT_MODULE_NAME[2]="nvidia-drm"
 DEST_MODULE_NAME[2]="$PACKAGE_NAME-drm"
 DEST_MODULE_LOCATION[2]="/updates/dkms"

 BUILT_MODULE_NAME[3]="nvidia-uvm"
 DEST_MODULE_NAME[3]="$PACKAGE_NAME-uvm"
 DEST_MODULE_LOCATION[3]="/updates/dkms"

 BUILT_MODULE_NAME[4]="nvidia-peermem"
 DEST_MODULE_NAME[4]="$PACKAGE_NAME-peermem"
 DEST_MODULE_LOCATION[4]="/updates/dkms"

####################################

sudo IGNORE_XEN_PRESENCE=1 IGNORE_CC_MISMATCH=1 IGNORE_PREEMPT_RT_PRESENCE=1 apt install --reinstall linux-image-rt-amd64 linux-headers-rt-amd64

#############################

 apt source ffmpeg

 cd ffmpeg?????

 ./configure --prefix=/usr/ --extra-version=3 --toolchain=hardened  \
 --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 \
 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom  \
 --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio \
 --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig \
 --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm \
 --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt \
 --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband \
 --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh \
 --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis \
 --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid \
 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2  --enable-openal \
 --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx \
 --enable-librsvg --enable-libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 \
 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e \
 --enable-shared --disable-static --enable-nonfree --enable-cuda --enable-cuda-llvm --enable-vaapi \
 --enable-nvdec --enable-cuvid --enable-nvenc --enable-ffnvcodec  --enable-libfdk-aac --enable-libwebp \
 --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract \
 --enable-libvo_amrwbenc --enable-version3 --enable-cuda-nvcc --enable-libnpp  --enable-vulkan  && make -j4 &&  sudo make -j 4 install

cuda-nvcc enabled

cheers

@lusu8892

lusu8892 commented Dec 8, 2025

Copy link
Copy Markdown

Has anyone tried with blackwell gen nvda GPU?

@spookyfirehorse

Copy link
Copy Markdown

NVIDIA GeForce GTX 1050 working

@ionutnechita

ionutnechita commented Feb 22, 2026

Copy link
Copy Markdown

Works correctly with IGNORE_PREEMPT_RT_PRESENCE=1 and NVIDIA-Linux-x86_64-580.126.18.run, on openSUSE Tumbleweed 20260220 and kernel 6.19.3-lowlatency-sunlight1(6.19.3).

cat /etc/modprobe.d/nvidia-graphics-drivers-kms.conf
//# Set value to 0 to disable modesetting
options nvidia-drm modeset=1 fbdev=1

[ 4.178917] NVRM: loading NVIDIA UNIX x86_64 Kernel Module 580.126.18 Wed Feb 11 18:49:55 UTC 2026
Linux 6.19.3-lowlatency-sunlight1 #1 SMP PREEMPT_RT Sun Feb 22 13:48:01 EET 2026 x86_64 x86_64 x86_64 GNU/Linu

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