Ubuntu 20.04 very slow response or freeze at login after setting Prime Synchronization for Nvidia optimus laptop

7,411

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:

  1. Use lightdm instead of gdm3. To do this, run the command sudo apt install lightdm, then choose lightdm as the default display manager when the terminal prompts you to do so. However, using lightdm will disable screen locking, and has a annoying bug that the mouse will change color at the desktop. Therefore, I use the second solution.

  2. Continue to use gdm3 as the display manager, but add needs_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/

Share:
7,411

Related videos on Youtube

Cloudy
Author by

Cloudy

Updated on September 18, 2022

Comments

  • Cloudy
    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:

    1. Create a new file /etc/modprobe.d/nvidia-graphics-drivers.conf;
    2. Input options nvidia_drm modeset=1 to the file;
    3. Run sudo update-initramfs -u
    4. 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?

  • Aleksandr Panzin
    Aleksandr Panzin over 3 years
    This is related to the proprietary driver, not noveau.
  • vahid-dan
    vahid-dan over 3 years
    I had this annoying problem for more than 6 months and the second solution worked for me like a charm!
  • rob
    rob about 3 years
    didn't fix it for me. GTX 1050 TI on Ubuntu 20.04