If you use the #NVIDIA  Linux drivers, thanks to +Thierry Reding's OutputClass patches, starting with xorg-server- you can put this snippet in /etc/X11/xorg.conf.d or /usr/share/X11/xorg.conf.d and dispense with xorg.conf entirely.  I'm hoping to make nvidia-installer create this automatically when it detects a sufficiently new X server.  If you're a distribution package maintainer, you can do this too instead of patching the server to auto-load the NVIDIA driver.

Note that it only works if nvidia.ko is loaded before the server starts.

# cat > /usr/share/X11/xorg.conf.d/nvidia.conf <<EOF
Section "OutputClass"
  Identifier "nvidia"
  MatchDriver "nvidia-drm"
  Driver "nvidia"
Shared publiclyView activity