The post you linked is irrelevant. To get what you want, basically you just need to enable the egpu for graphcs use and enable prime.
If you have any /etc/X11/xorg.conf created, delete it. Then create /etc/X11/xorg.conf.d/10-nvidia-egpu.conf only containing
Section "OutputClass"
Identifier "nvidia-egpu"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowExternalGpus" "True"
EndSection
After reboot, the gpu should be in offload, aka on-demand mode
https://download.nvidia.com/XFree86/Linux-x86_64/495.44/README/primerenderoffload.html
If you want the nvidia gpu render everything, change it to
Section "OutputClass"
Identifier "nvidia-egpu"
MatchDriver "nvidia-drm"
Driver "nvidia"
Option "AllowExternalGpus" "True"
Option "PrimaryGpu" "yes"
EndSection
If anything fails
,