Nvidia-prime how-to

https://download.nvidia.com/XFree86/Linux-x86_64/440.64/README/optimus.html

https://download.nvidia.com/XFree86/Linux-x86_64/440.64/README/randr14.html

https://download.nvidia.com/XFree86/Linux-x86_64/440.64/README/primerenderoffload.html

There’s also now the output sink feature (new), but I don’t know about a documentation for it.