This solution was found in Ubuntu forums. It’s mostly a note to myself.
- Enable “Sync to VBlank” in NVidia xserver settings, under OpenGL Settings;
- Start CompizConfig settings manager, under General Options – Display Settings set the refresh rate to your monitor’s refresh rate. Also, check Sync to VBlanc.
- Display visual effects must be set to at least “Normal” (under Appearance preferences -> Visual effects)