Fix graphics glitches upon resume with Nvidia GPU on Ubuntu

setsid compiz --replace

This does not require sudo. In the end I temporarily reverted back to Nvidia driver 340 while waiting for the fix in Nvidia driver 38x. Nouveau also works OK.

Reference

https://askubuntu.com/a/802744