Can't get sync.enable to work with nvidia driver, empty Nvidia X Server Settings

When trying to use sync.enable, gdm starts up but when I try to load Gnome, I get a black screen. (Same issue with Awesome WM, but I didn’t test as much there.)

offload.enable works but empty Nvidia X Server Settings and nvidia-smi sees gpu

Here is part of the code responsible for nvidia:

  hardware.nvidia.modesetting.enable = true;
  hardware.opengl.enable = true;
  services.xserver.videoDrivers = [ "nvidia" ];
  # hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;

  hardware.nvidia.prime = {
    # offload.enable = true;
    sync.enable = true;

    # Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
    intelBusId = "PCI:0:2:0";

    # Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
    nvidiaBusId = "PCI:2:0:0";
  };

lspci:

nvidia-smi with offload.enable:

Nvidia X Server Settings with offload.enable:
image

I remember sync.enable worked and all rendering was done on the gpu but then something happened and stopped but I couldn’t keep track of it. And this has been so for a long time, so the option to return to the previous generation disappears.

The crux of the question is how do I get sync.enable to work?