This was my approach based on issue #2526 and works on kernel-5.9.14-1:
- Install the necessary tools:
dom0:qubes-dom0-update gcc kmod grub2-tools perl-bignum make
- Install kernel-devel package from RPM file;
dom0:dnf install kernel-latest-devel-5.9.14-1.qubes.x86_64.rpm
- Download the latest Nvidia driver from www.nvidia.com/en-us/geforce/drivers/
In my case “NVIDIA-Linux-x86_64-455.45.01.run” - 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
- Extract driver sources
dom0:./NVIDIA-Linux-x86_64-455.45.01.run --ui=none --no-x-check --keep --extract-only
- 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"
- Copy compiled driver to
/lib/modules/$(uname -r)/extra
dom0:sudo cp nvidia.ko /lib/modules/$(uname -r)/extra/
- Load the driver and check
dom0:sudo depmod -a; modinfo nvidia
- Edit grub2 entry add
rd.driver.blacklist=nouveau
to the end ofGRUB_CMDLINE_LINUX
dom0:sudo vim /etc/sysconfig/grub
- Update
grub.cfg
for UEFI
dom0:grub2-mkconfig -o /boot/efi/EFI/qubes/grub.cfg
- Disable nouveau driver; add to blacklist
dom0:echo "blacklist nouveau" >> /etc/modprobe.d/blacklist.conf
- Reboot the system and enjoy the Nvidia driver
I’ve uploaded my build kernel rpm files to my git repository: GitHub Repo