I know my Asus laptop is not the best for Linux. I've had problems with all previous versions of Ubuntu, but only with suspend/resume. I was randomly unable to resume after being suspended.
However, things got worse from 20.04. My Gnome session dies in two to three days. Now, when I work from home, I do the same routine every day: Firefox for personal affairs, Chrome for work-related work, Citrix Workspace for remote access, Nautilus and sometimes LibreOffice.
Everything looks good after a new login. After a few hours, mouse and keyboard response will slow down. After a day or two, I face periodical freezes up to 10-20 minutes.The hard drive light is always on and it looks like a heavy swap is taking place. If I am able to switch to a virtual terminal, I see that either Firefox or Chrome is consuming CPU. But gradually gnome-shell starts to outpace the CPU consumption. Finally, the session freezes completely, and my laptop is not registered on the network anymore.
To rule out hardware issues, I spent two weeks by using Windows 10 on my laptop. I didn't have any problem. Just once closing the lid did not let the laptop sleep. Opening a lot of pages in browsers slows down the response, but in any case, the response time on Windows is always acceptable.
How can I troubleshoot the problem?
I added the required information
$ free -h
total used free shared buff/cache available
Mem: 7.6Gi 4.7Gi 712Mi 1.6Gi 2.2Gi 1.0Gi
Swap: 2.0Gi 1.6Gi 427Mi
$ sysctl vm.swappiness
vm.swappiness = 60
$ ls -al ~/.local/share/gnome-shell/extensions
total 16
drwxrwxr-x 4 yury yury 4096 May 1 17:34 .
drwx------ 4 yury yury 4096 Sep 12 14:03 ..
drwxrwxr-x 3 yury yury 4096 May 9 23:10 glassygnome@emiapwil
drwxr-xr-x 2 yury yury 4096 Jun 29 21:30 lockkeys@fawtytoo
$ ls -al /usr/share/gnome-shell/extensions
total 20
drwxr-xr-x 5 root root 4096 Jan 9 2020 .
drwxr-xr-x 7 root root 4096 Aug 18 09:54 ..
drwxr-xr-x 2 root root 4096 Aug 18 09:54 desktop-icons@csoriano
drwxr-xr-x 3 root root 4096 May 8 19:00 [email protected]
drwxr-xr-x 3 root root 4096 Aug 29 14:57 [email protected]
$ sudo dmidecode -s bios-version
X556UQ.315
It is original ASUS X556U laptop. The laptop has two graphic cards:
$ lspci | grep -i --color 'vga|3d|2d'
00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940MX] (rev a2)
Previously I always had problems with nouveau, so I installed propitiatory NVIDIA drivers.