This article explains how to fix Chromium-based web browsers (Google Chrome, Chromium, Vivaldi, Opera, etc.) not working properly after resuming from suspend on Linux.
Those affected by this bug experience various issues with Chrome-based web browsers (Google Chrome, Chromium, Vivaldi, Opera, etc.) when resuming from suspend, like the Chrome interface flickering, sometimes the web pages contain visual glitches / artifacts, all websites already opened are completely black or white, and in some cases parts of a website from a different tab appear on top of the current tab.
This is a screenshot of this issue, when the web pages turn completely white and there are some artifacts on top of the address bar:
I’ve been having these issues with Chromium web browser for some time, and up until now I was restarting it to get it to work properly again, but a few days ago I got tired of restarting it, and finally decided to search for a fix or workaround, and I found one on AskUbuntu.
I’m not sure exactly what’s causing these black/white background tabs and flickering with Chromium-based web browsers after resuming from suspend, and I suspect not everyone is affected. For me, this happens with Ubuntu (it was happening with Ubuntu 20.04, and continues to happen after upgrading to Ubuntu 20.10) using proprietary Nvidia drivers, running under GNOME (X11).
Besides Chromium, which is what I use, I also tried to replicate this bug in Google Chrome, Vivaldi and Opera web browsers, and this Chrome bug after resuming from suspend happens in all of them.
Here are 2 solutions for this Chromium resume from suspend issue.
The first workaround for this resume from suspend Chrome bug is to enable Vulkan in the Chrome flags. This can be done by opening
chrome://flags in a new browser tab, search for
enable-bulkan, set it to
Enabled, then restart the browser.
You’ll need to have Vulkan installed for this to work. E.g. on Debian / Ubuntu / Linux Mint, install Vulkan for AMD graphics using
sudo apt install mesa-vulkan-drivers mesa-vulkan-drivers:i386, and for Nvidia
sudo apt install libvulkan1 libvulkan1:i386
It’s important to note that some users have reported that enabling Vulkan for Chromium-based web browsers decreases the performance for them. In my case (and there are some users in the same situation), I didn’t notice any performance decrease while using this. The slowness might be for amdvlk users only (I can’t test that since I only have one computer to test this on, with Nvidia graphics).
The second workaround is to launch your Chromium-based web browser, be it Chromium, Google Chrome, Vivaldi, Opera, etc., using
--use-cmd-decoder=validating command-line flags, e.g.
chromium-browser --use-cmd-decoder=validating --use-gl=desktop
It’s important to note that this reverts to a deprecated renderer, and it might stop working at some point.