Skip to content

Instantly share code, notes, and snippets.

@pantor
Last active May 15, 2024 15:52
Show Gist options
  • Save pantor/9786c41c03a97bca7a52aa0a72fa9387 to your computer and use it in GitHub Desktop.
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
@chinahuangyong
Copy link

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

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

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

@topin89
Copy link

topin89 commented Sep 10, 2023

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

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

@ionutnechita
Copy link

ionutnechita commented Feb 24, 2024

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

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

Thanks, following this setting, I succeed.

@ynrng
Copy link

ynrng commented May 15, 2024

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.

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