Fix for Intel i915 GPU Freeze on Recent Linux Kernels

Recently Intel started including their graphics drivers into the mainline Linux kernel.  This is great except when it stops working.  Having suffered intermittent, sporadic GPU freezes on my Lenovo x270 (Kabylake) work laptop since Kernel 4.12+ I came across a bug report that seemed related.  Here’s a my temporary fix on Fedora 28 for getting things stable again until it’s fixed for good upstream.


The Intel Integrated Graphics Crash
I started having complete system freezes intermittently where my laptop display would shudder / jitter and then hard lock.  There was no real pattern to this happening nor was I able to get any log file information or journal information about the issue as it completely froze.  No network, no ping, nothing.

VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02)

I’ve had this issue on both Skylake and Kabylake Intel-based laptop systems with integrated HD graphics (i915 driver) across Kernels 4.12+ through the 4.16.8 Fedora 28 Kernel.  I recall this also happened on my previous Lenovo x240 though less frequently.

I am sure at some point this will be permanently fixed and disseminate down to all the major Linux distributions.  I was impatient and frustrated and wanted something to work right away, here’s how I got there.

Update: 2018-05-28:  It seems that as of Skylake Fedora no longer uses the intel/i915 driver by default if you’re using Xorg.  It instead uses the xorg-x11-drv-intel driver which means the testing below is not relevant currently (thanks to Venemo in the comments).

I doing more testing now against the stock 4.16.10 kernel using the Intel driver in lieu of the xorg-x11-drv-intel driver.

To switch to the intel driver make yourself an xorg shim config and then restart Xorg or reboot.

cat > /etc/X11/xorg.conf.d/10-intel.conf <<EOF
Section "Device"
Identifier "Intel Graphics"
Driver "intel"

If you were running the xorg Intel drivers you’d have seen something like this in /var/log/Xorg.0.log:

[ 18.547] X.Org Video Driver: 23.0
[ 18.547] X.Org XInput driver : 24.1
[ 18.547] X.Org Server Extension : 10.0

If you are now running the Intel i915 driver you’d see this instead:

[ 17.369] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[ 17.369] (II) intel: Driver for Intel(R) HD Graphics
[ 17.369] (II) intel: Driver for Intel(R) Iris(TM) Graphics
[ 17.369] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics
[ 17.370] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20171222
[ 17.372] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 620

Update: 2018-05-29: I’m still getting GPU freezes with the 4.16.11 Fedora 28 kernel and the Intel i915 driver.

I have also tried the following kernel parameter which doesn’t help:


I am now testing the latest drm-tip against the Fedora Rawhide 4.17.0-rc kernels as I have time to hopefully see if/when a fix appears.

Update: 2018-06-04: So far things have been stable for 4 days on 4.17.0-rc7 and latest Intel drm-tip kernel tree modules copied in, I will keep this updated if I have another freeze.

Commenter Venemo has stated he’s still getting this freeze on 4.17.0-rc7 however on another system.

Update: 2018-06-05:  I experienced another GPU freeze but it took about ~5 days of normal usage and dozens of suspend/resumes.  For giggles I tested trying to trigger this in the BIOS and was able to get screen artifacts by jerking the laptop around and also by squeezing (a normal amount) the palm rest area of the laptop.

I also tried a Windows 10 USB stateless image and indeed I get the same GPU freezes there too.  This makes be believe it’s a hardware defect.  I’ve filed a ticket with Lenovo and I’ll be mailing my laptop in for repair/replacement – I’ll let ya know how it goes.

Testing Intel Upstream Linux Kernel Drivers

Below is how I previously tested the latest 4.17.0-rc kernel and Intel drm-tip kernel modules which may still be useful to others so I’m leaving it here.

Temporary Fix for the Intel Graphics Crash
The fix I found was to use the absolute latest Intel drm-tip git kernel code combined with a 4.17.0-rc5 Kernel build.  I then installed a Fedora development (rawhide kernel) and later copied in the compiled Intel kernel modules in afterwards, Yolo.

The full docs for setting up the latest Intel stack is here but I’m going to explain just the basics in case you are hitting this as well and want to get up and running quickly.

Build Kernel (Modules) Against drm-tip
This is going to clone a rather large git repository of all the upstream intel drm bits and build the latest kernel and modules.  Note that we’re ommitting the actual make install of the kernel, we only care about the modules.  You’re going to need this later.

First you’ll need some build and compiler tools, this is what I needed to install prior:

sudo dnf install openssl-devel automake gcc elfutils-libelf-devel zlib-devel flex bison

Next build the thing against the latest upstream Intel drm-tip repository.  This may take quite some time.  Ironically the GPU froze on me a few times trying to build the latest drivers that should supposedly contain the crash fix!  Maybe it could sense it.

export MY_DISTRO_PREFIX=/usr
export MY_DISTRO_LIBDIR=/usr/lib64
git clone git://
cd drm-tip
make defconfig
sed -i 's/CONFIG_DRM_I915=y/CONFIG_DRM_I915=m/g' .config
sed -i 's/CONFIG_DRM=y/CONFIG_DRM=m/g' .config
sed -i 's/CONFIG_DRM_MIPI_DSI=y/CONFIG_DRM_MIPI_DSI=m/g' .config
sed -i 's/CONFIG_DRM_I915_USERPTR=y/CONFIG_DRM_I915_USERPTR=m/g' .config
sed -i 's/CONFIG_DRM_PANEL=y/CONFIG_DRM_PANEL=m/g' .config
sudo make modules_install

The last line will copy the kernel modules you create into /lib/modules/KERNEL_VERSION/kernel/drivers/gpu/drm along with a bunch of other kernel drivers we’re not going to need.

If you get a compilation issue about asm-goto support you’ll need to comment that out of arch/x86/Makefile and try again:

183 #ifndef CC_HAVE_ASM_GOTO
184 # $(error Compiler lacks asm-goto support.)
185 #endif

Install Rawhide Development Kernel
While you could just run the drm-tip Kernel chances are you’d need a whole lot more modules configured/enabled for your hardware.  I find it is much easier to just use your distributions latest kernel (if it matches latest upstream) as those are generally better configured for most hardware use cases and you’ll have everything reasonable provided as a loadable module.

You might substitute Rawhide here for your distributions development / bleeding edge Kernel like Tumbleweed for SuSE.  For Fedora users I am providing the direct paths here, which may change so double check the parent location.

cd /tmp/

Install the Development 4.17+ Kernel
Now install the Rawhide development kernel and associated packages.

cd /tmp/
sudo dnf localinstall kernel-*.rpm

Copy the drm-tip Kernel GPU Modules Over
The current Rawhide kernel does not have the latest version of the Intel drivers that we’ll need that contain the actual fix so we’re going to copy them in manually.  This is fairly bad practice but in general but we don’t really care – we’d prefer something working to good etiquette that doesn’t.

Your paths and names may vary, but I copied over the entirety of the /lib/modules/KERNEL_MODULES_YOU_BUILT/kernel/drivers/gpu/drm/* into the modules location of the Rawhide kernel that I just installed.

sudo cp -Rv /lib/modules/4.17.0-rc5+/kernel/drivers/gpu/drm/* /lib/modules/4.17.0-0.rc5.git1.1.fc29.x86_64/kernel/drivers/gpu/drm/

Again, not the most elegant fix but gets the job done.  At this point just reboot into the new kernel and if you had crashes before due to the bug I was hitting hopefully they have gone away.

Usage and Testing
After ~20 hours of GPU torture tests (hundreds of glxgears spinning, open/close images in a shell loop, suspend and resume constantly over and over, old games raging in wine) things seem pretty stable.  Before I’d get hard GPU lockups anywhere from 6 minutes to 6 hours into normal desktop usage.

I realize this is a rather temporary blog post and I’m positive that all this will get fixed in upstream kernels.  For now it was important (and frustrating enough) to find a fix as soon as possible and then write about it.  I hope this helps someone else.

How to Debug an Intel GPU Crash
If you’re lucky enough to get logs or data written in case of a GPU crash there’s an easy way to gather debug information to file an Intel graphics driver bug.

sudo mount -tdebugfs debug /sys/kernel/debug
sudo cat /sys/kernel/debug/dri/0/i915_error_state > i915_error_state


About Will Foster

hobo devop/sysadmin, all-around nice guy.
This entry was posted in open source, sysadmin and tagged , , , , , , , , . Bookmark the permalink.

25 Responses to Fix for Intel i915 GPU Freeze on Recent Linux Kernels

  1. venemo says:


    I’m experiencing a similar freeze on a Dell XPS 13 9370. Basically the screen turns blank and the laptop stops reacting to any input – does this sound familiar?

    Some questions:
    – Do you use Wayland or Xorg when this occours?
    – In case of Xorg, are you sure you actually used the Intel X11 driver? On Fedora it is not used on Skylake and newer hardware.


    • Will Foster says:

      Hey @venemo, yes this does sound similar to my issue minus the black screen – most of the time it just shudders a bit then freezes and laptop function keys respond but nothing else. Occasionally when resuming from suspend it will hang on a black screen (assuming my xscreensaver blank screen)

      I’m using xorg. Interesting, you are correct it seemed to have been using the Xorg intel driver.

      This makes me wonder if it’s instead a bug with the Xorg-x11-intel driver and has nothing to do with the i915/intel.


      • Will Foster says:

        I’m going to try forcing the Intel driver usage now via /etc/X11/xorg.conf.d/10-intel.conf

        Section "Device"
        Identifier "Intel Graphics"
        Driver "intel"

        I’m also testing out the following kernel parameter for Kabylake, I have no real scientific reason for this other than it was a workaround for a Baytrail bug that had similar symptoms.


        I’ll report back.


      • venemo says:

        For me there are two different freezes:
        1. most often it just freezes the current image on the screen, but with red stripes and dots at some places
        2. sometimes the screen goes completely blank

        Now interestingly some of these freezes are not actually the fault of the GPU, but rather my crappy Atheros wifi card. The ath10k wifi driver crashes and somehow takes the whole system with it. This has been to some degree mitigated by a firmware upgrade, but occasionally the firmware and/or the driver still crash. (But they don’t always bring down the entire system anymore.)

        In other cases however the crash occoured under graphics load, so is very unlikely (but not completely impossible) to be the fault of the wifi driver. In this case, yes, I suspect the Intel GPU to be at fault. Now in my previous experience on my previous laptop, the power saving parameters that everyone suggest to mindlessly apply to your kernel command line can and do cause instability. So, I’m currently experimenting with tweaking some kernel boot parameters that disable some power saving options.

        With regards to the Intel X11 driver: the reason why Fedora (and Debian, etc.) decided to disable it on Skylake and above is because it has had a bad reputation of being quite unstable. See here: – I will leave it at that for now, but of course am interested in your findings!

        Liked by 1 person

      • Will Foster says:

        Ok so far:

        * Kernel 4.10.11 with Intel driver = freeze
        * Kernel 4.10.11 with Intel driver and i915.enable_dc=0 = freeze

        Back to the drawing board, I will keep testing newer drm-tip modules and 4.17.0-rc kernels from rawhide I suppose.

        In the meantime if you could also comment here with your findings this might help:


      • venemo says:

        So right now I’ve got these kernel parameters: i915.enable_fbc=0 i915.reset=1 i915.modeset=1 i915.disable_power_well=0 i915.enable_dc=0

        – enable_fbc and disable_power_well were enabled by default, so I disabled them
        – modeset was -1 by default I think
        – added enable_dc=0 at your suggestion

        Unfortunately these also make the kernel tainted… And now in addition to the freezes I started seeing gpu driver crashes in dmesg, with no real noticable benefits or fewer crashes.


      • venemo says:

        I’m starting to think that this is not (necessarily) a graphics problem (at least on my machine). Right now I’m testing a patch to the ath10k wifi driver which should eliminate at least part of the problem.

        Since messing around with those kernel parameters actually made the system less stable, I’m not using those anymore.


      • Will Foster says:

        Perhaps it may not be necessarily a GPU / Intel issue but I have an Intel wifi card for what it’s worth.


  2. Will Foster says:

    I’m going to take a run at the latest drm-tip upstream code again and kernel-4.17.0-0.rc7.git0.1.fc29.x86_64.rpm from Rawhide and see if I have any luck, stay tuned.


    • venemo says:

      Just out of curiosity, did you try older kernels perhaps? Was there a version where this worked correctly?


    • Will Foster says:

      Ok I’ve got 4.17.0-rc7.git0.1.fc29.x86_64.rpm running now with drm-tip drm/i915 kernel modules as of 2018-05-30 running. So far so good, but then again I always say that.


      • venemo says:

        How is it going since then? Still OK? If yes, I might give drm-tip a try myself. How did you patch the Fedora kernel up to drm-tip?

        On my end, I’ve hooked up a serial port to see the messages from the kernel on another machine, hoping that something would turn up that points to the reasons for the random freezes. While this does yield useful info on the ath10k crashes it doesn’t show anything when the random freeze happens.

        At this point I suspect that I’ve simply got a faulty motherboard. But drm-tip could be still worth a try if it works for you. :)


      • Will Foster says:

        Hey Venemo,

        3 days and counting so far of stability, mostly my laptop has been suspended (I’m using hybrid-suspend). In the next few days I’ll use it more often and report back.


      • venemo says:

        What did you do to get drm-tip on top of the Fedora kernel? When I tried, git produced a patch file that wouldn’t apply.


      • Will Foster says:

        See the updated post, I had to comment out some lines in the Makefile because I got asm-goto errors:

        e.g. in


        #ifndef CC_HAVE_ASM_GOTO
        # $(error Compiler lacks asm-goto support.)

        I also ensured anything related to i915 was compiled as ‘m’ or module for the subsequent cp operation into the existing 4.17.0 Rawhide kernel modules tree (I think I covered it all with sed at least in the post).

        So far things are stable, I’ve suspended and resumed about 10-15 times over 4 days and played some intensive wine / d3d games. I’m crossing my fingers but still keeping an eye on things.

        up 3 days, 23:23, 1 user, load average: 0.82, 0.84, 0.86


      • venemo says:

        Okay, I managed to do it: produced a patch using ‘git diff’ between 4.17-rc7 and latest drm-tip and then added the resulting patch file to the .spec file. The freeze is still there. I believe at this point I’ve exhausted all my options and should just accept that this is just a hardware defect.


      • Will Foster says:

        4.17 kernel is now stable/released, the only other changes I saw mentioned here besides the slew of i915 fixes in the various rc changelogs:

        drm/i915/lvds: Move acpi lid notification registration to
        registration phase
        drm/i915/query: Protect tainted function pointer lookup
        drm/i915/query: nospec expects no more than an unsigned long
        drm/i915: Disable LVDS on Radiant P845

        It’s discouraging that you still have the issue, I don’t want to return my work laptop for another (Lenovo?) model but if it is indeed a hardware defect perhaps they make one with an Nvidia card instead which honestly I’ve had no problems with on Linux. I really dig the x270 otherwise but this pretty much makes it unusable. I wonder if the same problem can be reproduced on Windows which would make it seem like it is for sure a hardware defect.

        What model / generation laptop do you have again? Just trying to correlate what other people are experiencing at work.


      • venemo says:

        This is a Dell XPS 13 9370. And I’m 99% sure this is just a random hardware defect.


      • Will Foster says:

        This is a Dell XPS 13 9370. And I’m 99% sure this is just a random hardware defect.

        This might sound crazy, but have you ever noticed if you pick up the laptop or move it (particularly pinch or hold one side of the bottom) that it freezes/crashes faster?


      • Will Foster says:

        Interesting aside here, I can replicate this issue by lightly squeezing the laptop base by the left wrist rest (below keyboard) where I believe the embedded Intel GPU or wiring may be. I was also able to get the same GPU freezes in a bootable Windows 10 USB stick just shaking things around a bit physically. Same thing in just the BIOS, though no freeze only artifacts.

        I believe I am also experiencing a hardware defect or faulty wiring – I’ve opened a support ticket with Lenovo and my x270 will be sent in for repair/replacement.


      • venemo says:

        There is only so much you can do about it. Since you can reproduce the problem in a straightforward way, you should have no trouble getting a warranty repair, possibly a motherboard replacement.

        The Intel GPU is actually integrated into the CPU (along with the chipset, voltage regulators and everything else these days), so it is very unlikely that you can squeeze the GPU itself. Besides, it is already being sqeezed by the heatsink. :)

        My guess would be that this kind of issue has to do with either damaged silicon (again, unlikely), or some sort of defect in the circuitry around it (eg. soldering error), or just damage to the motherboard PCB traces. When you squeeze it, it probably causes a short-circuit or a loose contact… or just could be that one of the ribbon cables half fell out of its connector.


  3. venemo says:

    Hey Will, I’m just writing to let you know that I finally took the XPS back to the store and asked for a replacement. The new unit doesn’t exhibit any of the symptoms that the previous one had. I hope you will have similary good luck with your machine. :)


  4. ole says:


    i have a Thinkpad E580 (i8250 CPU, UHD Graphics 820) and similar problems: The system freezes, especially under graphics load (scrolling in Firefox), but sometimes even at the login screen.

    I tried to downgrade to kernel 4.9 – didn’t help.

    To me it doesn’t like a hardware defect as Windows 10 runs without any problems for some months of daily use now.


Have a Squat, Leave a Reply ..

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.