How to save the X server settings?

Hi,

I have a 440.64 driver and GeForce RTX 2080 Graphics Card.

I get terrible screen tearing on my external monitor.

To fix it I have to open NVIDIA X Server Settings -> Display Configuration -> Advanced
and apply Force Composition Pipeline and Force Full Composition Pipeline

Every time I restart my computer this setting is undone (annoying).

So I press “Save to X Configuration File” but this asks me where to save the file.

I am running Ubuntu - where do I save the file?

Also, from a user experience standpoint, I must say this is really not ideal.

How am I supposed to know where this file goes?
Everything I read online says that this file is “mostly deprecated”, so why is Nvidia still using it?

Anyway, I saved it in the default location /etc/X11/xorg.conf and on reboot my computer just stops at a blank screen with “3424224 blocks clean” showing…So it looks like X never started? This is of course complicated because there are now old xorg.conf files in that directory…what a mess.

Main question here: What is the correct location on Ubuntu for the xorg.conf file, why is it necessary and does location depend on distribution?

The problem is most likely that you have a hybrid intel/nvidia graphics system so having a simple xorg.conf breaks it. You can try a conditional config snippet:
remove any xorg.conf in /etc/X11
create directory /etc/X11/xorg.conf.d
create file /etc/X11/xorg.conf.d/20-nvidia-antitear.conf with contents

Section "OutputClass"
    Identifier "nvidia-antitear"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "ForceCompositionPipeline" "true"
EndSection

I do have a hybrid intel/nvidia system…So thanks.

It’s interesting - are normal computer users supposed to know how to do this or is the expectation that everyone with more than one monitor just has to ask for support online?

I don’t know why this is considered to be an acceptable user experience but I also do not know to whom I should express my frustration.

Also, where would I find any documentation on this file? (i.e. why it starts with 20-, why it contains what it does, why it is in that particular folder)?

man xorg.conf.d
https://manpages.debian.org/experimental/xserver-xorg-core/xorg.conf.d.5.en.html

/etc/X11/xorg.conf.d is just one of many search paths the Xserver is looking for additional config files in. This one is mainly used for user defined config snippets.
“20” is just for the case that those files have to be applied in a specific order, I arbitrarily made it up, would work without.
Any section with “Class” modifies the Xserver’s autoconfig behaviour, the opposite would be e.g. having a “Device” section, meaning, don’t do autoconfig, use exactly this device with these settings.
This file means
If, during autoconfig, you add a gpu (OutputClass) that uses the kernel driver “nvidia-drm” (MatchDriver) please additionally apply the following options.

Thank you.