NVIDIA drivers don't see my only monitor as primary thus ForceFullCompositionPipeline/Color Correction don't work

I’ve got something extremely weird going on.

It looks like NVIDIA drivers [415.25] work with a different monitor than I have even though I’ve got the only one. This is a desktop PC with a single GPU.

As a result the ForceFullCompositionPipeline option doesn’t work (there’s heavy tearing in all applications) and nvidia-settings cannot change Color Correction settings among other things.

The only “fix” I’ve found so far is to software suspend/resume or to physically unplug and plug back my monitor’s HDMI cable.

OS: Fedora 29 64 with all updates installed, kernel 4.19.13-300.fc29.x86_64
Drivers: 415.25
GPU: GTX 1060 (the only one in a system)
Monitor: a single monitor connected via HDMI

Old description/irrelevant:

$ cat /etc/X11/xorg.conf.d/99-nvidia.conf 
Section "Device"
	Identifier	"Videocard0"
	BusID		"PCI:1:0:0"
	Driver		"nvidia"
	VendorName	"NVIDIA"
	BoardName	"NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] (rev a1)"
	Option		"Coolbits" "28"
	Option		"metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
	Option		"RegistryDwords" "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerLevel=0x3; PowerMizerDefault=0x3; PowerMizerDefaultAC=0x3"
	Option		"UseNvKmsCompositionPipeline" "Off"
	Option		"TripleBuffer" "On"
	Option		"RegistryDwords"  "RMUseSwI2c=0x01; RMI2cSpeed=100"
EndSection

[s]DE: XFCE/XFWM without compositing
Applications: all of them, including Mozilla Firefox, Google Chrome, text editors, RSS readers, graphical terminals (even xterm), everything

I don’t know what I’ve updated recently on my Fedora 29 64 but now I “enjoy” heavy diagonal tearing in all applications and it’s driving me mad.

I even tried options nvidia-drm modeset=1 but that didn’t help. Even when I’m scrolling text in this tiny Create Topic window I get tearing. Damn!

Please advise.

Edit: I also cannot edit any Color Correction settings - when I try to adjust gamma, contrast,brightness nothing happens at all.

Edit 2: I physically unplugged the HDMI cable from my display and connected it again - that solved everything. No idea what’s going on. I will now attach Xorg.0.log for everyone concerned.
[/s]
Xorg.0.log (25.2 KB)

This now happens on every boot: NVIDIA drivers somehow misidentify my monitor (as if it’s not my primary one) and either I have to replug it or use software suspend to rectify the issue.

This is extremely annoying and I don’t know what to do.

Does adding this option to the “Screen” or “Device” section makes any difference?

Option "ForceCompositionPipeline" "true"

I had a similar problem on a laptop with an external display connected via HDMI.
ForceCompositionPipeline in the metamodes line does not always work for me.

Like I said even Color Correction doesn’t work, so there’s a deeper issue as if NVIDIA drivers see two physical monitors when I’ve got just one and it’s a desktop PC with a single GPU in the system.

This started happening almost at the same time when I plugged headphones into my monitor (it’s got a headphone jack), so that might be the issue however I’m not sure what the headphones have to do with any of this.

Does anyone know a command which makes NVIDIA drivers reinitialize the connected monitor?

Edit:

xrandr -s 1680x1050
xrandr -s 1920x1080

Did the trick but it’s still hugely annoying.

Edit 2:

xrandr --listactivemonitors

Should probably work as well.