Ubuntu 20.04 very slow response or freeze at login after setting Prime Synchronization for Nvidia optimus laptop
Solution 1
Answering my own question here. It appears that the problem is caused by an old bug in gdm3 when Prime Synchronization is enabled. I found two potential solutions (or workarounds) from the discussions of the bug:
Use
lightdm
instead ofgdm3
. To do this, run the commandsudo apt install lightdm
, then chooselightdm
as the default display manager when the terminal prompts you to do so. However, usinglightdm
will disable screen locking, and has a annoying bug that the mouse will change color at the desktop. Therefore, I use the second solution.Continue to use
gdm3
as the display manager, but addneeds_root_rights=yes
to/etc/X11/Xwrapper.config
, then reboot the machine.
I experienced no further problems when using the second solution. However, I am not sure about the potential security consequences of giving root access to Xwrapper. Many some experts on X11 or X server can comment on this.
Solution 2
If you don't use your Nvidia card regularly which was the case for me I just disabled my nouveau drivers which not only resulted in a smoother system but also solved my screen tearing.
For disabling my nouveau drivers I used this https://moduate.com/blog/disabling-nouveau-drivers-in-ubuntu-18.04/
Related videos on Youtube
Cloudy
Updated on September 18, 2022Comments
-
Cloudy over 1 year
So I have just done a fresh install of Ubuntu 20.04 on my laptop (Intel i7 7700HQ + NVIDIA 1050Ti), I noticed that when enabling the NVIDIA driver (version 440.62) the laptop screen suffers from screen tearing, and I tried to enable Prime Synchronization by the following method:
- Create a new file
/etc/modprobe.d/nvidia-graphics-drivers.conf
; - Input
options nvidia_drm modeset=1
to the file; - Run
sudo update-initramfs -u
- Reboot.
After rebooting the GUI had very slow response at login screen, sometimes I had to wait several minutes after input the password for my desktop to show up, sometimes the desktop never appeared. Even if the desktop appeared, it may still freeze after a random time. Reverting the previous steps can solve the problem but screen tearing re-appeared.
I hope to know what is the cause of this problem? Did I enable Prime Synchronization correctly?
- Create a new file
-
Aleksandr Panzin over 3 yearsThis is related to the proprietary driver, not noveau.
-
vahid-dan over 3 yearsI had this annoying problem for more than 6 months and the second solution worked for me like a charm!
-
rob about 3 yearsdidn't fix it for me. GTX 1050 TI on Ubuntu 20.04