Multicolor barcodes around windows and context menus [duplicate]

Two days ago, after putting my computer for less than one hour in sleep mode, I noticed weird lines of different colors around all windows as you can see on this screenshot:

Around all windows, active or not

Lines are both horizontal and vertical, from different colors, they look like barcodes and on the edges horizontal and vertical lines are scrambled. Those lines appear whether the window is active or not, in the foreground or not.

The lines also appear on the "X" "-" "|_|" icons on the top left hand corner of each window.

The bug also happens in search results in Chrome for instance, actually in any input field with autosuggestion on an HTML webpage:

In Chrome search results

It also happens when a context menu is open. For instance after a mouse right click there are lines all around the menu.

I use Ubuntu 16.04. I upgraded from Ubuntu 14.04 last week. When I upgraded to Ubuntu 16.04 I had a graphic issue (Computer in low graphics mode, solved with: Graphics issues after/while installing Ubuntu 16.04/16.10 with NVIDIA graphics ), but after solving the initial issue everything was fine and I don't think I installed anything special after.

If I reboot my computer, the problem is solved. But it reappears after sleep mode.

Specs:

  • Asus N56VM
  • BIOS: N56VM.206
  • 01:00.0 VGA compatible controller: NVIDIA Corporation GF108M [GeForce GT 630M] (rev a1)
    • Kernel driver in use: nvidia
    • Kernel modules: nvidiafb, nouveau, nvidia_375_drm, nvidia_375
  • 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
    • Kernel driver in use: i915
    • Kernel modules: i915

Solution 1:

As Rafal said it's a known bug that should be fixed with the next release: https://devtalk.nvidia.com/default/topic/990898/suspend-corrupts-window-manager-after-upgrade-to-378-09/?offset=30

In the meantime I solved the bug by restarting compiz: compiz --replace

Another solution is to downgrade to the previous driver version ( https://askubuntu.com/a/896544/657603 ):

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt purge nvidia*
sudo apt install nvidia-370
sudo reboot

Solution 2:

What version is you NVIDIA driver. I have the same issue with 378.13 and GeForce 1080 ti GPU.

There is a regression in latest drivers release. Check this link: https://devtalk.nvidia.com/default/topic/990898/linux/suspend-corrupts-window-manager-after-upgrade-to-378-09/2

According to this thread it should be fixed with the next release. Also there is a hotfix described there. It works for me but the desktop wallpaper get pure black and I need to reset is after suspend (this could be done automated with a script). Also I must say the hotfix does't work for me 100%. Sometimes with multiple suspends the Unity shell crash and Launcher and top bar disappear. Didn't have time to debug it yet.