20

Several users (one, two, three, four, five) have reported that Intel graphics cards cause severe screen tearing/flickering on Ubuntu >= 16.10. The oft-proposed "solution" is to add the boot parameter i915.enable_rc6=0.

However, while fixing the screen flickering/tearing, this "solution" causes the fan to run constantly (as in it never, ever turns off) and at an excessively high speed. I am posting this question to see if anyone has a remedy to the fan issue (or, in the alternative, to the flickering/tearing issue but without causing the fan issue).

For completeness, I am running Ubuntu 16.10/17.04/17.10 using kernel 4.11.0-10-generic on a Lenovo 910 (Kabylake) and my graphics card is VGA compatible controller: Intel Corporation Device 5916 (rev 02).

Note: I just confirmed that this problem still exists with the upstream kernel (v4.13.0-041300rc4). Reverting the kernel to the 16.04 LTS kernel fixes the screen tearing, but that is just a workaround. I recently (09.03.2017) tried the default Debian install with kernel 4.9.0-3-amd64, and there is no screen flickering (though the screen is rotated 90 degrees).

Note 2: Using the boot parameter i915.enable_rc6=0 leads to system degredation over extended use. I tried to watch a streaming video for 3 hours and the machine starting acting sluggish and unresponsive.

Note 3: I filed a bug report.

Note 4: This may not be relevant, but the screen tearing stops completely when the pointing device (trackpad) or the keyboard is in use.

Rsync
  • 1,274
  • 6
  • 19
  • 32
  • Are you getting these warning messages when your kernel is updated with sudo update initramfs -u? I have an Ivy Bridge and had screen tearing but fixed it with other methods using Xorg options. – WinEunuuchs2Unix Aug 13 '17 at 17:14
  • Nope, I don't get those messages when issuing sudo update-initramfs -u. But that is likely because I manually installed those drivers from Intel ( https://01.org/linuxgraphics/downloads/firmware). Care to share the options you used? I'll try them. – Rsync Aug 13 '17 at 17:18
  • I didn't document them at the time and it was a year ago so don't remember every step. My primary source for fixing things came from Arch Linux. Additionally I used Thermald, Powerclamp and TLP for fan control and CPU frequencies. Here is a comprehensive list I wrote a few weeks ago. – WinEunuuchs2Unix Aug 13 '17 at 17:45
  • Which one are you running? Ubuntu 16.10/17.04/17.10? – fosslinux Aug 14 '17 at 00:06
  • I ran each for about a week. Now I'm just on 17.10 on that partition - and 16.04 for my daily driver until this is remedied. – Rsync Aug 14 '17 at 14:54
  • It is obvious that i915.enable_rc6=0 leads to increased power consumption and some performance degradation. So what is the question? Don't use it. – Pilot6 Aug 20 '17 at 16:47
  • @Pilot6 -- agreed! Wanted to ensure everyone was aware of the issue, because i915.enable_rc6=0 is posted as a solution on many sites -- even though it is not. That said, I haven't seen any workable solution. – Rsync Aug 20 '17 at 17:33
  • I ran a Lenovo IdeaPad Z510, and had to use i915.enable_psr=0, which disables Intel's Page Screen Refresh feature. Worked for me under 16.04, but haven't used that particular machine on any more recent releases of Ubuntu. – richbl Sep 03 '17 at 05:49
  • Thanks @richbl. I had tried that as well, but unfortunately it did not work. – Rsync Sep 03 '17 at 15:22

3 Answers3

22

The correct solution would be to create the following file:

/etc/X11/xorg.conf.d/20-intel-graphics.conf

having the following content:

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "TripleBuffer" "true"
   Option      "TearFree"     "true"
   Option      "DRI"          "false"
EndSection

Do not create these files in /usr/share/X11/xorg.conf.d. That is the location for example configuration files for X, not the ones that are actually loaded.

Fabby
  • 34,259
Adam Gausmann
  • 323
  • 2
  • 6
  • 1
    I had to set DRI to true, otherwise certain apps using OpenGL would fail to run. Probably caused by DRI being enabled during compilation. I still get tear-free scrolling and video playback when it is enabled with these other options also enabled, though. Uncertain why it is suggested disabled in the answer. – Lars Haugseth Jul 25 '18 at 15:42
  • 1
    This fixes some constant diagonal tearing on my Dell XPS 13 9350 when I have portrait-mode external monitors, but it causes extremely slow screen redraws (~10 fps?) and extremely high gnome-shell CPU use. – Nick T Jan 27 '19 at 17:57
  • 4
    note that the directory /etc/X11/xorg.conf.d doesn't exist by default in Ubuntu. You have to create it with sudo mkdir /etc/X11/xorg.conf.d – Kat Amsterdam Apr 21 '19 at 23:23
  • Thanks so much! Now my videos are flicker-free. – Brian Cannard Aug 04 '19 at 17:15
  • @Fabby are you sure about your edit? The documentation says "Files ending in *.conf in the /usr/lib/X11/xorg.conf.d/ directory (NOTE: will be changed to /usr/share/X11/xorg.conf.d for 10.10) are automatically loaded by X at start prior to reading the xorg.conf" hasn't been updated since 2014 though. –  Oct 04 '19 at 12:46
  • I created this file, but now my dual monitors act as a single monitor (I see the same image twice) –  Oct 04 '19 at 12:46
  • I applied this to my Latitude 7480 and Lenovo T480s work computers. First I had the Dell with Ubuntu 18.04. After applying this setting, I felt it became better but the display froze occasionally until its motherboard got destroyed and I got the Lenovo. Since it has basically the same graphic card, I applied this fix, but again it froze occasionally. Reverted it. Had no problem ever since. – AlexStack Nov 10 '19 at 20:03
  • Worked for me as well, fixed issue I had trying to rotate one monitor with an Intel NUC (NUC8i5BEH). Had no problems in landscape mode, but there were severe issues when one monitor was rotated - tearing, along with inccorect rendering of my desktop in general: bits of firefox were on the wrong monitor, dialogs would shift around as you moused over them - it was basically unusable. This fixed all of that though, so thanks! – YellowShark Apr 14 '20 at 21:26
3

I used these steps to fix screen flickering,

sudo gedit /usr/share/X11/xorg.conf.d/20-intel_flicker_fix.conf

paste these lines,

Section "Device"
  Identifier  "Intel Graphics"
  Driver      "intel"
  Option      "TripleBuffer" "true"
  Option      "TearFree"     "true"
EndSection

save, reboot.

If it still doesn't fix it, you can remove is using

sudo rm /usr/share/X11/xorg.conf.d/20-intel_flicker_fix.conf
  • Thanks for the suggestion Sirajus. Unfortunately, that had no effect. – Rsync Sep 06 '17 at 01:31
  • @MBWD, have you set 'Option "DRI" "false"' as mentioned? It was missing from the fixes you listed. – Sirajus Salekin Sep 06 '17 at 07:07
  • Yes, I implemented your entire solution above (sudo gedit /usr/share/X11/xorg.conf.d/20-intel_flicker_fix.conf and pasting the lines, including DRI). It didn't work. Was there something else I should do? – Rsync Sep 06 '17 at 17:51
  • Running Ubuntu 18.04, if I add any conf file similar to this one, on every logon I get an error about outputs not found, outputs "not disconnected" but with no modes, or something. The session appears to be configured correctly, even though the error dialog warns that it might not be, but errors at every logon clearly means something is wrong. – dgw Jul 07 '18 at 22:35
  • @dgw, you can try commenting out each of the Option lines by adding # infront of it. Then reboot, to test if the error is gone. – Sirajus Salekin Jul 09 '18 at 11:13
  • When I enabled these options - CPU usage increased greatly, video playback become with jerks – Eugene Mala Sep 06 '18 at 07:54
  • @EugeneMala, hi, can you try without the 'Option DRI false' line ? – Sirajus Salekin Sep 10 '18 at 03:14
  • @sirajus-salekin, Option "TearFree" "true" was the only needed option to avoid screen flickering on my Core i5 integrated video and to keep CPU usage low – Eugene Mala Sep 12 '18 at 21:55
  • 1
    Option "TripleBuffer" "true" makes high CPU load and Videos, Chrome and Firefox slow video playback. – Eugene Mala Sep 12 '18 at 21:57
  • @EugeneMala, I am glad you figured out the best solution for you. TripleBuffer is used to make sure applications run at the same speed of refresh_rate, this increases memory consumption quite a bit and decrease performance a little bit, but makes sure we don't get choppy playback. I wonder why you're facing trouble with this, my 4gb i3 seems to run fine. Anyway, here are some other settings you might like reading. – Sirajus Salekin Sep 13 '18 at 02:53
  • I am using 3 monitors and one is in a "portrait" rotation, may be these is causing significant slow down when using "TripleBuffer" "true" – Eugene Mala Oct 25 '18 at 14:39
0

I am not sure what solved the problem. I initially thought it was installing Ubuntu 17.10, which runs kernel 4.13.0-16. But I just returned to a backup of 17.04 and the 4.10.0-37-generic kernel ran fine.

I am going to guess that the fix was actually upgrading the Lenovo firmware, which you can only do (to my knowledge) through Windows. I accidentally booted into Windows partition at one point, and endured the upgrade process. But I think that had to be what fixed it.

Note: I also "solved" the problem before 17.10 was released by compiling and using the Kali Linux kernel.

Rsync
  • 1,274
  • 6
  • 19
  • 32
  • 1
    is ther by any chance you're using wayland? When I switched to wayland I saw almost all the problems disappeared, without needing any configs. – Sirajus Salekin Sep 21 '18 at 06:08