[SOLVED] PRIME Synchronization doesn't work

I am trying to configure my laptop with hybrid graphics and external monitor setup. I have installed the latest nvidia-470 driver on Ubuntu. I have read the Arch section for NVidia


and since I have the laptop plugged all the time, I don’t care for power saving features. Thus I chose “Use NVidia graphics only”. I used the following xorg configuration

Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    Option      "metamodes"  " DP-0.1: nvidia-auto-select +1680+0 {ForceCompositionPipeline=On}, DP-0.3: nvidia-auto-select +0+390 {ForceCompositionPipeline=On} "
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"

and set the required ~/.xinitrc

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

as well as the kernel mode setting in /etc/default/grub

GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`

With the ForceCompositionPipeline option vertical sync works on the external monitors connected via the Display port, but not on the laptop screen (or PRIME display), although the drm setting is set. When I run ``xrandr --verbose | grep PRIME, I get

        PRIME Synchronization: 0 

so apparently PRIME sync is turned off. If I could choose, I would want the laptop screen to be rendered by the iGPU and the external monitors by the dGPU. Is that possible?

Solved with the latest update on Ubuntu.