Random temporary screen lags since upgrade to 18.04

12,325

Solution 1

NOTE: After some time, the problem has returned. I am currently in the process of backing up home folder for reinstall of Ubuntu. I am leaving this answer for reference, however I have unaccepted it as it didn't permanently solve my issue.


The fix to my problem was a rather lengthy process. The final fix looks, in a nutshell, like this:

  1. Re-add Drivers PPA -> Update -> Upgrade
  2. Use Generic Kernel
  3. Purge and Reinstall Graphics Drivers (just in case)
  4. Configure the Card
  5. Nuke local Chrome .config and Reinstall or (preferably) Switch to Firefox

Each action offers a slight improvement in performance culminating into a wonderfully performing system. The complete fix is as follows.

1. Proprietary GPU Driver PPA Disabled on Upgrade

First re-enable the graphics drivers ppa, and update drivers:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt upgrade && sudo apt dist-upgrade

2. Use Generic Kernel When Low Latency is Not Required

I do audio production and so was using the low-latency kernel. It seems this kernel would give priority to audio and would allow the rest of the system to hang to keep audio in time.

I installed the generic kernel:

sudo apt install linux-generic

To use this kernel hold shift at boot and select advanced options and boot into generic kernel.

3. Purge and Reinstall Drivers

Tried upgrading to driver 396 using Software & Updates. After reboot, I could not start X. It wouldn't start automatically and the command startx makes the screen flicker then brings me back to the command line. (your mileage may vary)

Users in comments suggested I should purge and reinstall drivers, so I figured this was the perfect time to do so. So purged everything out:

sudo apt purge "*-nvidia-*"
sudo apt autoremove && sudo apt autoclean

Reboot and reinstall driver 390 (or 396 if it works for you) via Software & Updates and reboot.

4. NVidia Card Requires Non Default Configuration

After doing all the purging and reinstalling, its time to fiddle with nvidia-settings.

sudo nvidia-settings

In the X Screen 0 and GPU 0 configurations, here are my tweaks that finalized the fix:

X Screen 0 Settings Menu

  1. Under the "X Server Video Settings" tab, I changed the setting from "auto" to select my monitor directly:

    NVIDIA X Server Settings

    This for some reason seemed to be the setting that finally fixed it. But read on for the rest of my configuration.

  2. I favored some quality over performance in "OpenGL Settings" as doing the opposite didn't have any effect (not sure if this actually did anything though):

    OpenGL Settings

  3. And finally for this menu, my Antialiasing settings look like this:

    Antialiasing Settings

GPU 0-(GeForce GPU) Menu

Under powermizer settings, I changed powermizer settings from Auto to Prefer Maximum performance. This setting does not hold after reboot, but now it seems to default to Adaptive instead of Auto.

Powermizer Settings

It seems that as a general rule, any setting that has an "auto" setting should be set to something specific when possible.

5. Fix Chrome or (preferably) Switch to Firefox

After all the above everything worked perfectly (movies, Steam, games, etc) except for when I was playing YouTube videos in Google Chrome.

Using Firefox instead I am no longer having any issues.

It is possible to fix Chrome to make it work better, but it's not perfect like using Firefox is. To fix chrome:

Rename config folder:

mv ~/.config/google-chrome ~/.config/google-chrome.bak

Purge Chrome:

sudo apt purge google-chrome-stable
sudo apt autoremove && sudo apt autoclean

You will now need to use Firefox to download Chrome from Google and install it. When you run Chrome it will be like for the first time and need to be configured.

Although this seems to fix Chrome, I notice that my system still has an occasional hiccup if and only if Chrome is running. This does not happen when using Firefox.

Solution 2

I had a problem with similar symptoms, on ubuntu-cinnamon-remix 21.04, Dell Precision 7710. Not sure if it's the same root cause.

I found some things closer to the root cause:

TL;DR: Ultimately the workaround/fix is setting /etc/UPower/UPower.conf IgnoreLid=true

It has to do with the lid state (closed/open) causing the system to query monitors every 30 seconds.

  • cinnamon/ubuntu 21.04 installed on Dell laptop precision 7710
  • both nouveau and nvidia drivers reproduce this.
  • The problem reproduces depending on combinations of the following:
    • lid power settings (e.g. lid state does not cause suspend nor external/internal monitor reconfigurations)
    • the current state of the lid (closed/open)
    • external monitor/s connected

Symptoms:

  • Every 30 seconds the display freezes for 500-3000 millisecs (length seems to depend on connected monitor and xrandr mode).
  • The mouse can move during the freeze. And everything else like audio and any running processes seem to proceed without problems.
  • Xorg.log has the following log every 30 sec
    [1360.782] (II) modeset(0): EDID vendor "DEL", prod id 16854
    [1360.782] (II) modeset(0): Using hsync ranges from config file
    [1360.782] (II) modeset(0): Using vrefresh ranges from config file
    [1360.782] (II) modeset(0): Printing DDC gathered Modelines:
    [1360.782] (II) modeset(0): Modeline "3840x2160"x0.0  594.00  3840 4016 4104 4400  2160 2168 2178 2250 +hsync +vsync (135.0 kHz eP)
    [1360.782] (II) modeset(0): Modeline "2560x1440"x0.0  ...
    
  • syslog might have the following log every 30 seconds (with nouveau without runpm=0)
    kernel: [ 3351.079896] nouveau 0000:01:00.0: Enabling HDA controller
    

I'll try to report this bug at cinnamon or ubuntu, I'm not sure what layer is at fault.

Share:
12,325

Related videos on Youtube

Joshua Besneatte
Author by

Joshua Besneatte

computer geek, homesteader, yoga teacher, world traveler I spend most of my time home working on my land and making YouTube videos for my channel http://youtube.com/piratesinteepees I only use Linux and open source applications. I use kdenlive for video editing and LMMS for music production. Linux makes the world a better place. I am here to contribute in any way I can. http://piratesinteepees.org

Updated on September 18, 2022

Comments

  • Joshua Besneatte
    Joshua Besneatte over 1 year

    Since I upgraded from 16.04 to 18.04 I have been having these strange screen freezes. Usually while playing videos or solitaire my screen will randomly hang. Although the mouse still works and moves and audio plays, the screen just freezes. The screen pauses for about 5-10 seconds and nothing can be moved, clicked, etc. However, if I try to perform an action with the mouse during one of these hangs, if I complete the action with the mouse, I will see the result once the screen catches up. So it seems that everything is working but there is some sort of display lag as if my video card is under a heavy load.

    The problem seems to get worse and more often the longer I am logged in as if there is a memory leak in the video card.

    Viewing card load with Nvidia apps shows no excessive load on the card, high temperatures or lack of memory.

    I have improved the performance, as will be outlined shortly, but the problem still persists.

    The system is a Quad Core Alienware Alpha with 8 gigs of ram. The card is an Nvidia 860 with two gigs of ram.

    I am using proprietary Nvidia driver 390 and (in the beginning) a low-latency kernel.

    $ lspci -k | grep -EA3 '3D|Display|VGA'
    01:00.0 VGA compatible controller: NVIDIA Corporation GM107M [GeForce GTX 860M] (rev a2)
    Subsystem: Dell GM107M [GeForce GTX 860M]
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
    
    $ lsmod |grep -i nvidia
    nvidia_uvm            757760  0
    nvidia_drm             40960  2
    nvidia_modeset       1110016  8 nvidia_drm
    nvidia              14340096  635 nvidia_modeset,nvidia_uvm
    drm_kms_helper        172032  1 nvidia_drm
    drm                   397312  5 nvidia_drm,drm_kms_helper
    ipmi_msghandler        53248  2 nvidia,ipmi_devintf
    
    • Jastria Rahmat
      Jastria Rahmat over 5 years
      this too happened on me. i think this is related to nvidia cards. if you find the answer. please post it here. i am looking for the fix too.
    • WinEunuuchs2Unix
      WinEunuuchs2Unix over 5 years
      Being annoyed at lags in 18.04 along with suspend/resume problems with my AW17R3 I just stay on 16.04. Every couple months I do the 18.04 upgrade to guage improvements. If 18.04 is worse than 16.04 why upgrade?
    • rob
      rob about 3 years
      Please help! Same Issue here on a system with GTX 1050 TI mobile, laptop with intel HD graphics as well on Ubunu 20.04. I can't find a way to stop the lags, I really can't use Ubuntu at all right now!
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    never have issue overheating... if you see in my question my card is never showing to be under any kind of heavy load
  • ipkpjersi
    ipkpjersi over 5 years
    Can you be more specific than breaks your system? What happens after you install the 396 driver?
  • ipkpjersi
    ipkpjersi over 5 years
    Do you have an integrated graphics card as well as the 860m? It is possible that it is using the wrong graphics card and that is why you are seeing lag.
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    I had already tried 396 yesterday per my last comment on OP
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    I am not really sure suggesting someone to do a full reinstall of OS is a very good idea... Seems like a Windows solution to me
  • ipkpjersi
    ipkpjersi over 5 years
    Wait - how is that suggestion insulting? Most laptops that have dedicated NVIDIA graphics cards also integrated graphics cards and use NVIDIA Optimus technology - which is not supposed well on Linux, and you generally have to install PRIME or Bumblebee, you have to make sure the correct GPU is selected in nvidia-settings, etc. No need to be rude, I am only trying to help.
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    Sorry, it's not a laptop. Also, you keep suggesting things I have already tried per my question and the comments after. I am getting the feeling you didn't read the question in detail. I know you are trying to help, but power user suggestions only please.
  • ipkpjersi
    ipkpjersi over 5 years
    Ah, I see - the output of one of your commands says GeForce GTX 860M which is a mobile graphics card, which 99% of the time means it's a laptop. I think I have used up about all of my Linux knowledge. Best of luck.
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    Oh gotcha... yea, this is a mini desktop and incorporates some laptop goodies for size.. I added that to my question. Also, before we go any further, I think I solved the issue finally... the answer was so simple we will all have sore butts for kicking ourselves :) I am going to post it now...
  • ipkpjersi
    ipkpjersi over 5 years
    I disagree. Sometimes upgrading can go wrong and cause random issues, and a clean install can help prevent any issues upgrading may have caused. That isn't specific to Windows, I've seen exactly that happen on Linux, ESXi, and many other operating systems. Software can be very finicky and break at the drop of a hat.
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    Hrm... I dunno man... I have been using this system for quite some time and it would take me weeks to rebuild my system to this state. I finally solved the problem on my own by tweaking nvidia settings (see my answer).... If I had reinstalled my system per this suggestion I would be ready to go full on postal
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    Nice answer. I'll try this next time I upgrade my 16.04
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 5 years
    Probably a good idea.
  • Joshua Besneatte
    Joshua Besneatte over 5 years
    @WinEunuuchs2Unix finally got my box working wonderfully! I moved the complete solution to the answer for future reference... next time you upgrade let me know if this works for you!