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
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:
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:
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:
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:
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.
In the X Screen 0 and GPU 0 configurations, here are my tweaks that finalized the fix:
X Screen 0 Settings Menu
Under the "X Server Video Settings" tab, I changed the setting from "auto" to select my monitor directly:
This for some reason seemed to be the setting that finally fixed it. But read on for the rest of my configuration.
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):
And finally for this menu, my Antialiasing settings look like this:
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.
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:
Purge Chrome:
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.
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.
Symptoms:
I'll try to report this bug at cinnamon or ubuntu, I'm not sure what layer is at fault.
Try reinstalling nvidia driver by:
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.
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:
After this, you should now remove your current NVIDIA driver by entering the following into your terminal:
Now that you have done this, it is safe to install the latest version:
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:
After you have done this, you want to detect your sensors with the following command in terminal (pressing the enter key after each suggestion):
Now you can finally run the sensors program with the following command in terminal:
Generally you want to see temperatures below 80c.