Published: 23. 4. 2025   Category: GNU/Linux

NVIDIA proprietary drivers in Fedora 42

I have just updated from 41 to 42 and found that the NVIDIA driver is going to misbehave. The main reason is that Fedora 42 is using by default GCC 15.x and the driver can only compile with version 14.x. After googling a bit I was able to compile and install the NVIDIA driver manually with the latest Linux kernel 6.14.2-300.fc42.x86_64.

I installed the module on my new PC before from the official driver because the kmod-nvidia package was failing during compilation from RPM sources and I was not able to resolve the issue. So I expect you may have a similar setup and already did some configuration changes described in Fedora 42/41/40 NVIDIA Drivers Install Guide.

  1. Switch to root: sudo su -
  2. Install gcc 14.x: dnf install gcc14
  3. Download the driver: wget https://us.download.nvidia.com/XFree86/Linux-x86_64/570.144/NVIDIA-Linux-x86_64-570.144.run
  4. Extract the archive: ./NVIDIA-Linux-x86_64-570.144.run -x
  5. Go to driver source directory: cd NVIDIA-Linux-x86_64-570.144/kernel
  6. Set env. variable: export IGNORE_CC_MISMATCH=1
  7. Start compilation, press Enter to ignore warning: CC="gcc-14" make
  8. Copy modules to kernel path: make modules_install
  9. Install modules: modprobe nvidia-drm
  10. Now you should see nvidia modules in output of: lsmod | grep nvidia
  11. Go back to the directory with driver package: cd ../.. (you still need to finish installation of libs, utilities, etc.
  12. Add executable to package: chmod +x./NVIDIA-Linux-x86_64-570.144.run
  13. Install all except kernel module: ./NVIDIA-Linux-x86_64-570.144.run --no-kernel-modules
  14. If you are already in X switch to the text console by pressing: Ctrl+Alt+F2
  15. Restart X11 process: sudo killall -s HUP Xorg
  16. Everything should work until the next kernel update/restart :P

Source and few more details: NVIDIA – GCC15 on Fedora 42 Wrecks Compilation – and a Workaround..