12

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
3
  • 1
    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. Sep 13 '18 at 20:41
  • 1
    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? Sep 19 '18 at 17:53
  • 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!
    – rob
    Apr 30 at 15:22
3

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.

3
  • 1
    Nice answer. I'll try this next time I upgrade my 16.04 Sep 19 '18 at 19:57
  • Probably a good idea. Sep 20 '18 at 3:44
  • @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! Sep 20 '18 at 15:48
1

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.

0

Try reinstalling nvidia driver by:

sudo apt-get purge nvidia*
sudo apt-get update
sudo apt-get install nvidia-driver-390

If this doesn't increase your performance, I suggest you to take all backup of files and reinstall a fresh Ubuntu-18.04 avoiding upgrade from previous LTS. There are some issue in upgrading from one LTS to another which is really pain in back.

3
  • 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 Sep 19 '18 at 17:11
  • 2
    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.
    – ipkpjersi
    Sep 19 '18 at 17:29
  • 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 Sep 19 '18 at 18:20
0

I would highly suggest upgrading your NVIDIA driver version.

To do this, you would add the graphics driver PPA with the following commands in terminal:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update

After this, you should now remove your current NVIDIA driver by entering the following into your terminal:

sudo apt-get purge nvidia*

Now that you have done this, it is safe to install the latest version:

sudo apt-get install nvidia-driver-396

Please note that it is nvidia-driver-396 on Ubuntu 18.04, it is nvidia-396 on Ubuntu 16.04 but you are not using 16.04.

If this does not help, it may be worth cleaning out your PC with compressed air, potentially replacing your thermal paste on your CPU, etc.

It may be worth investigating your temperatures to see if your laptop is throttling (as laptops commonly throttle).

To do this, run the following command in terminal to install the required sensors:

sudo apt-get install lm-sensors

After you have done this, you want to detect your sensors with the following command in terminal (pressing the enter key after each suggestion):

sudo sensors-detect

Now you can finally run the sensors program with the following command in terminal:

sensors

Generally you want to see temperatures below 80c.

8
  • never have issue overheating... if you see in my question my card is never showing to be under any kind of heavy load Sep 19 '18 at 16:38
  • Can you be more specific than breaks your system? What happens after you install the 396 driver?
    – ipkpjersi
    Sep 19 '18 at 16:49
  • 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.
    – ipkpjersi
    Sep 19 '18 at 16:53
  • I had already tried 396 yesterday per my last comment on OP Sep 19 '18 at 16:53
  • 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.
    – ipkpjersi
    Sep 19 '18 at 17:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.