Sometimes when using proprietary NVIDIA drivers on linux machine you can experience something like this. Unfortunately this is a very common issue on laptops with hybrid graphics, that use NVIDIA Optimus. To address this, a little trick called PRIME Synchronization was introduced back in 2016. It works well, but users often need to enable it manually.

Solution

Make sure that you are using drivers >=364.12

Add nvidia-drm.modeset=1 parameter to GRUB_CMDLINE_LINUX_DEFAULT line in /etc/default/grub file.

So it’s gonna look like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"

Update GRUB bootloader:

update-grub

Restart your machine

Links