Nvidia driver installation

This was my approach based on issue #2526 and works on kernel-5.9.14-1:

  1. Install the necessary tools:
    dom0: qubes-dom0-update gcc kmod grub2-tools perl-bignum make
  2. Install kernel-devel package from RPM file;
    dom0: dnf install kernel-latest-devel-5.9.14-1.qubes.x86_64.rpm
  3. Download the latest Nvidia driver from www.nvidia.com/en-us/geforce/drivers/
    In my case “NVIDIA-Linux-x86_64-455.45.01.run
  4. Copy the downloaded driver to dom0:
    dom0: qvm-run -p ${VM} 'cat /home/user/Downloads/NVIDIA-Linux-x86_64-455.45.01.run' > NVIDIA-Linux-x86_64-455.45.01.run
    dom0: chmod +x NVIDIA-Linux-x86_64-455.45.01.run
  5. Extract driver sources
    dom0: ./NVIDIA-Linux-x86_64-455.45.01.run --ui=none --no-x-check --keep --extract-only
  6. Build nvidia.ko kernel driver
    dom0: cd NVIDIA-*/kernel/; make module IGNORE_XEN_PRESENCE=y CC="gcc -DNV_VMAP_4_PRESENT -DNV_SIGNAL_STRUCT_RLIM"
  7. Copy compiled driver to /lib/modules/$(uname -r)/extra
    dom0: sudo cp nvidia.ko /lib/modules/$(uname -r)/extra/
  8. Load the driver and check
    dom0: sudo depmod -a; modinfo nvidia
  9. Edit grub2 entry add rd.driver.blacklist=nouveau to the end of GRUB_CMDLINE_LINUX
    dom0: sudo vim /etc/sysconfig/grub
  10. Update grub.cfg for UEFI
    dom0: grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg
  11. Disable nouveau driver; add to blacklist
    dom0: echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
  12. Reboot the system and enjoy the Nvidia driver

I’ve uploaded my build kernel rpm files to my git repository: GitHub Repo

5 Likes