Problems with Chrome browser after suspending the computer on Ubuntu 20.04
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
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).
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