I never had to do anything similar, but I'd say you could go to:
System Settings -> Startup and Shutdown -> Autostart -> Add... -> Add Login Script and select a previously prepared script containing only that command
Remember to add #!/bin/sh as first line and make it executable
this been a will aware issue in Surface devices that the dgpu will not connect with linux because of microsoft integrated some auto setting into the gpu system itself , unless you are running a surface-linux kernel and you run the command and it will not stay on all the time it will disconnect,
so many of the surface community tried but it didnt workout
this is looks like a solution for them
btw we tried the systemd service before
the gpu would not stay on after restarting
As long as your issue is fixed, all is fine.
In your posted link (bug report), they are suggesting a service and a script. That’s what you need.
The rest of our/my comments are about using a depreciated method to do what is properly done as suggested in the bug report discussion.
Using sudo in a service which is non-interactive is not working.
System services are executed as root, which means you don’t need sudo.
If you need more help on this gpu issue,ask again.