From Archwiki:
it may be required to create a configuration file (prefer
/etc/X11/xorg.conf.d/20-nvidia.conf
…
A basic configuration block in 20-nvidia.conf (or deprecated in xorg.conf) would look like this:
/etc/X11/xorg.conf.d/20-nvidia.conf
Section "Device"
Identifier "NVIDIA Card"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce GTX 1050 Ti"
Option "UseEdidDpi" "false"
EndSection