Problems with Chrome browser after suspending the computer on Ubuntu 20.04
Solution 1
I'm having more or less the same issue, on:
- Ubuntu 18.04, 64 bit
- GPU: GeForce GTX 1070
- Driver: 440.100
- Chrome Version: 86.0.4240.75 (Official Build) (64-bit)
I don't want to have to deactivate GPU usage for Chrome, and I don't want to have to restart the browser every time, losing all my tabs.
But I found a workaround that is good enough for me (at least for now):
You can kill just the browser's GPU process
-
Open the Task Manager:
- Hit Shift+Esc (as pointed out by @NYCeyes in the comments).
- Or alternatively, go to the Chrome main menu (3 dots on the top right corner) → More Tools → Task Manager.
-
Sort by process Task name.
-
Find the process called GPU Process.
-
Click on End process.
That will "clean" all the glitchy image noise. And Chrome will immediately create a new GPU process automatically.
Note: You can automatize the process, check Andrew Bruce's answer putting these steps in a script that runs automatically.
I assume the problem is something like the GPU process using memory assuming it has the old state as before the sleep cycle, but it just has some default random noise from the default state. So I imagine Ubuntu doesn't save and restore GPU memory on a sleep cycle (I don't think it should) but the Chrome process doesn't detect that. And by killing the process it "frees" that GPU memory and then Chrome creates a new process that re-generates any needed GPU memory state (that's instant).
Solution 2
Same problem for me.
Enabling enable-vulkan
in chrome://flags
then restarting the browser fixed it. If that does not work, you can also try enabling ignore-gpu-blacklist
as well.
Answer based on this old askubuntu answer
Solution 3
Using tiangolo's answer, you can automate the restart of the Chrome GPU process on wake. As root, I put this script in /lib/systemd/system-sleep/revive-chrome-gpu
:
#!/bin/sh
set -e
if [ "$2" = "suspend" ] || [ "$2" = "hybrid-sleep" ]
then
case "$1" in
pre)
true
;;
post)
sleep 1
pkill -f 'chrome \-\-type=gpu-process'
;;
esac
fi
Be sure to make the script executable with:
chmod +x /lib/systemd/system-sleep/revive-chrome-gpu
Solution 4
I have the same issues on Arch, and although enabling Vulkan does fix the glitches when resuming from sleep or hibernation, it also impacts performance a lot. Based on this bug report and this answer I've tried starting Chrome with the following flags: --use-cmd-decoder=validating --use-gl=desktop
and this seems to fix my issue without any performance penalties.
I'm not sure if this applies to all distros, but on Arch you can put these arguments into ~/.config/chrome-flags.conf
and then they will be used every time Chrome is started (or ~/.config/chromium-flags.conf
if using Chromium):
~/.config/chrome-flags.conf
--use-cmd-decoder=validating --use-gl=desktop
Solution 5
1st Solution (performance issues)
In my case a solution for the Chrome browser is disable
in Settings
: Use hardware acceleration when available
.
chrome://settings/system
2nd Solution
Yes, the above solution comes with performance issues. If you don't like that, you can test this other option, Chrome will run flawlessly.
Run Chrome with some flags, run always Chrome by terminal.
google-chrome-stable --use-cmd-decoder=validating --use-gl=desktop &
The &
avoid blocking the terminal.
christianbueno.1
Updated on September 18, 2022Comments
-
christianbueno.1 almost 2 years
- Kubuntu 20.04, 64 bit
- GPU: Geforce GT610
- nvidia-driver-390
- Chrome Version 85.0.4183.83
- Intel i5-4430, core 4, 4 thread , 3GHz
- RAM: 16GB
Each time I go into suspend mode and then resume, Chrome browser displays the current tab as full of sand of colors, something like dithering in image processing.
Other tabs display glitches too.
The current solution is to close and reopen the browser.
I tested
nvidia-driver-418
but got a black screen problem and reinstallednvidia-driver-390
.The problem is more evident in Chrome, but it sometimes appears in vscode in small areas. There, hovering the mouse over the affected place or resizing the window fixes the problem. In Kubuntu the avatar of the user in the application launcher also shows dithered.
I tested in the same machine with fedora 32 workstation(gnome), nvidia driver, and had the same problems with Chrome browser.
Could it be a GPU problem?
-
EraserPencil almost 4 yearsCould you see if the solution from askubuntu.com/q/1270689 helps?
-
user3352133 almost 4 yearsMe too, I created a bookmark for chrome://restart so can click it whenever the machine wakes up. Had a new version of Chrome today but it still doing it. I am plain old 20.04 Ubuntu runing on a Dell XPS 17 2020
-
dharmatech almost 4 yearsSame issue on Ubuntu 20.04.01 on ThinkPad W530. The answer below solved it!
-
SimonAlfie almost 4 yearsThis has come in with a recent update, as I had no issues before. I am also seeing issues with kdiff3. Not noticed any issues with VSCode myself, but maybe they are too subtle from me to of noticed yet. Running a Dell XPS 15 with 20.04.
-
Matthew Miller over 3 yearsI just wanted to add that the reason that VSCode experiences issues is because it runs on ElectronJS which further runs on Chromium. As far as I know, FireFox does not experience these problems. Thus, it's an underlying problem in Chromium. I've only had success solving the problem by disabling hardware acceleration although this is not ideal. I think the best course of action is to wait for the problem to be patched at Chromium.
-
AlikElzin-kilaka over 3 yearsHappens on
19.10
as well. Chrome version:85.0.4183.121 (Official Build) (64-bit)
. It started happening after upgrading chrome. -
AlikElzin-kilaka over 3 yearsRelated: askubuntu.com/questions/1270689/…
-
bain over 3 yearsUpstream bug: bugs.chromium.org #1113040
-
Daniel Rosehill over 3 yearsI just upgraded from 20.04 to 20.10 and this issue began. Very annoying as I use the suspend and restore from suspend throughout the day. I have no idea what NVIDIA driver I had before the upgrade, but now it brought me up to Nvidia-driver-450. I manually upgraded to Nvidia-driver-455 hoping that would resolve the issue but no such luck. I'll try adding the Chrome flag. Probably should have stuck with the LTS release!
-
christianbueno.1 over 3 yearsThere is no problem in fedora 33 with Nouveau NVD9 open source drivers, it would be very important to test if the problem persist with nouveau in ubuntu.
-
kelalaka over 3 yearsIt seems so many people like me have the same problem. At the moment, the best solution is
chrome://restart/
-
Jared Chu over 3 yearsThe issue is fixed for me on
nvidia-driver-455
and ChromeVersion 87.0.4280.66 (Official Build) (64-bit)
-
trusktr about 3 yearsThere is a similar issue in Chrome's bug tracker: bugs.chromium.org/p/chromium/issues/detail?id=1134981
-
dharmatech almost 4 yearsWorks perfectly! Thank you!!!
-
Dark Templar almost 4 yearsThis slows down dramatically chrome with 10+ open tabs...
-
xx77aBs almost 4 yearsNo need to enable ignore-gpu-blacklist. Just enabling Vulkan fixes the issue for me, although chrome does get slow down, especially when multiple windows are open :(
-
xx77aBs almost 4 yearsThis comes with huge performance penalty, especially when watching videos. If you're on laptop, your batter life will get shortened a lot.
-
Camilo Rada almost 4 yearsJust enabling Vulkan fixed it for me.
-
Diego Rivera almost 4 yearsThis is an Arch-specific extension, and is not currently available in other Linux variants (that I know of).
-
christianbueno.1 almost 4 yearsThanks pal,
disabling hardware acceleration
reduce the performance. That's flags works better. You can run chrome by terminalgoogle-chrome-stable --use-cmd-decoder=validating --use-gl=desktop &
, using&
avoid blocking the terminal. -
Terminal User almost 4 yearsIt fixed the issue. but make chrome really slow when watching youtube.
-
christianbueno.1 over 3 yearsThanks pal, now in the future when we don't need those flags, how can we revert that?
-
Christian Fritz over 3 yearsYou can just stop using the modified
.desktop
file and use the one installed by the package instead when that happens. -
AlikElzin-kilaka over 3 yearsUpvoted. Starting chrome with
google-chrome --use-gl=desktop
solved the issue. Saw it here as well: askubuntu.com/a/1270843/13330 -
Jared Chu over 3 yearsThanks a lot! It fixed the issue for me. My specs: Ubuntu 20.04, Ryzen 7, RTX 2060.
-
Homero Esmeraldo over 3 yearsHas anyone tested the second solution? Can you explain what exactly those flags are doing?
-
Passiday over 3 yearsFixes the rendering issue, but now the CPU cooler goes full speed all the tiime.
-
mr_azad over 3 yearsThe second solution worked for me .. Thanks :)
-
K.-Michael Aye over 3 yearsthis works for Brave on my Kubuntu 20.04 system, using
brave://flags
, thanks! -
NYCeyes over 3 years\o/ This is an excellent answer and works without making performance compromises. I will note though, that because Chrome's hamburger menu may be obfuscated by the glitchy pixelation, simply pressing
<Shift>
+<Escape>
will get you to Chrome's (and Chromium's)Task Manager
directly, where you can then kill theGPU process
that you mentioned. -
Daniel Rosehill over 3 yearsFixed the issue for me but not sure about performance. Will edit comment later when I have a large amount of tabs open.
-
Daniel Rosehill over 3 yearsDisabling hardware acceleration worked for me.
-
Youw over 3 yearsWorked for met too: GTX 1060, driver 455
-
Rob Cranfill over 3 yearsI had the same issue on my new machine with Ubuntu 20.10 and Chrome "86.0.4240.111 (Official Build) (64-bit)", but this still fixed it!
-
Andrew over 3 yearsWorks. Ubuntu 20.04, Nvidia Vulkan β drivers, google-chrome-β. Hole feeling that it start work even faster! At lease is shows 42 fps now, vs 25 fps before on this page: shadertoy.com/view/ldB3Dt
-
Ryan Hartman over 3 yearsThis is the best answer so far.
-
Redu over 3 yearsEnabling Vulkan made my Google Maps crawl like a snail.
-
Elias over 3 yearsThis is also exactly why linux is currently not really suitable as a daily driver. I have this issue every time and it's soo annoying. Still, linux/unix is 100x better than windows when developing so I guess I'm stuck with this mess.
-
BeastOfCaerbannog over 3 yearsThis works and is a handy addition to tiangolo's answer. Note that if you use another Chromium-based browser, for example Brave, you should properly change the
pkill
command. In Brave's case it would becomepkill -f 'brave --type=gpu-process'
. -
christianbueno.1 over 3 yearsThanks pal, very useful solution. think that the problem is with NVIDIA drivers and the kernel in Linux, because in fedora 33 with open source drivers nouveau there is no problems about it, but after install NVIDIA proprietary drivers from rpmfusion in fedora 33 the problems begin to appears.
-
christianbueno.1 over 3 yearsAnd the problems appears in vscode too, in kubuntu it affects to the user avatar.
-
BeastOfCaerbannog over 3 yearsThis answer, combined with Andrew Bruce's answer, is the best option to use Chromium-based browsers with hardware acceleration until the problem gets resolved.
-
tiangolo over 3 yearsNice! I used it and it works perfectly. I just added a note to my original answer pointing to this answer. 🚀
-
raj over 3 yearsYou can change the shortcut for Chrome to include these parameters, thus you don't need to run it from a terminal.
-
kelalaka over 3 yearsDo we run with
sudo
? -
RedEyed over 3 yearsNo, as you can see:
sudo
is inside the script -
RedEyed over 3 yearsOh, then u have several drivers. IDK, just change the
NVIDIA_DIR
to the driver path u have installed -
RedEyed over 3 yearsUpdated the script to get the right version
-
kelalaka over 3 yearsAlthough I've upvoted, this not solved the issue. The best is
chrome://restart/
-
RedEyed over 3 yearsSad to hear. Thanks for the upvote. In my case, it solves partially: Slack (which is based on chrome) now works fine, but Firefox is still has "artifacts" after suspending
-
kelalaka over 3 yearsI've only problem with the chrome, though, strange.
-
Gui Ambros over 3 yearsThis works, but has its own side effects. After a few rounds of suspend-restart-suspend-restart, Chrome detects the successive failures and reverts back to software emulation. Everything will work and the GPU process will even show up under Chrome Task Manager, but if you investigate with
chrome://gpu/
you'll see that you're running in software emulation, which uses your CPU instead of GPU. Unfortunately the only real clean solution I found so far is to restart Chrome entirely (which is a pain). -
Thomas Kainrad over 3 yearsThanks a lot for this answer! Solves the problem also for Electron-based apps, e.g. my file now has 3 pkill commands like this:
sh pkill -f 'chrome \-\-type=gpu-process'; pkill -f 'keycombiner \-\-type=gpu-process'; pkill -f 'spotify \-\-type=gpu-process'
-
Andrew Bruce over 3 yearsYou're welcome. You could get fancy and use a regexp instead of the three kills. An exercise for the reader!
-
Chris Watts over 3 yearsFor me, I find that just a
pkill -f type=gpu-process
will work for Chrome and other Electron-based apps all in one go. That being said, I have switched Chrome to using Vulkan too. -
Brandon over 3 yearsI found that this solution doesn't work nicely with xterm.js (VS Code terminal as well as Hyper terminal). It winds up causing most of the terminal to go blank. I wound up having to resize VS Code (
Ctrl +
thenCtrl -
to solve my problems). With Hyper I have to restart completely. -
Andrew Bruce over 3 yearsYeah I still end up restarting my browser, because although the image is restored and usable, the scrolling etc. is severely degraded after the GPU process has been killed. Perhaps the processes using the old GPU process are kicked down to CPU?
-
Kishalay over 3 yearsFor chrome the command will change. Please check your task manager. It will come under "--type=gpu-process"
-
trusktr about 3 yearsSimilar issue in Chrome's bug tracker: bugs.chromium.org/p/chromium/issues/detail?id=1134981
-
Siniša over 2 yearsWorked for me too! Ubuntu 20.04 with nVIDIA 480 (proprietary, tested) on a Dell laptop with nVIDIA GTX 1050 Ti Mobile had issue with Google Chrome. If I would take a tab and drag it to be a separate window, that window would be drawn with additive over everything and pretty much be either all white after few seconds. Enabling Vulkan extension fixed it! Thanks mate!
-
w-sky over 2 yearsThis seems to be the simplest solution and it works fine on my system for Chromium! (Also an Ubuntu 20.04 system with Intel i5, Nvidia GeForce graphics, recommended Nvidia driver.) However I do also use Chrome (the Google version), does anyone know how to apply this fix for Chrome? I tried ".chrome-browser.init" and "CHROME_FLAGS" but that does not work.