My solution also works around another bug which causes Ubuntu to default
to a low framerate (40Hz for me) by using the intel driver instead of
the modesetting driver and using custom modeline settings. If you don't
want that remove the monitor config file and adapt the makefile.
--
You received
For anyone who is looking for a solution to their problem with newer Nvidia
cards and the regression that you need to reboot to switch graphics:
https://github.com/matthieugras/Prime-Ubuntu-18.04
I solved the problem by using bbswitch instead of nouveau to switch off
the graphics cards and