[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

https://wiki.archlinux.org/title/NVIDIA_Optimus

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"
EndSection

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"
EndSection

and set the required ~/.xinitrc

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

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

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash "
GRUB_CMDLINE_LINUX="nvidia-drm.modeset=1"

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.