Solved System resets when /boot/modules/i915kms.ko is loaded

I've installed FreeBSD 12.1-RELEASE on a Lenovo Thinkpad X1 Yoga 1st Gen with an i7-6600U CPU and an Intel HD 520 IGP. I've followed the instructions in this blog post to set up root filesystem encryption with UEFI, though I had to move /etc/loader.conf to /boot/loader.conf after installing to get it to boot.

I'm trying to get graphics to work now, and I've installed graphics/drm-kmod (which installs graphics/drm-fbsd12.0-kmod on this system) with pkg, but when I load /boot/modules/i915kms.ko, the screen goes black for a few seconds, then the Lenovo logo appears and the system boots again. The filesystems are not dismounted properly, and so far I've had to fsck them once in the process of trying to debug this problem. This happens whether I use kldload or put the module in /etc/rc.conf.

Here's what I've tried:
  • Looking for obvious culprits in the BIOS. I've disabled execution prevention and increased the graphics memory setting. Neither one nor both had an effect, and I've undone the changes.
  • Using the built-in legacy i915kms kernel module. It loaded successfully, but of course it didn't do anything, since my IGP is too new.
  • Installing a different drm-kmod from ports. Every alternative that was available in my ports tree refused to install, saying my kernel was too old or too new.
  • Reinstalling with an MBR partitioning scheme and legacy boot instead of using UEFI. This had no effect.
Beyond that, I have nothing. Does anyone have any ideas to help me debug this?
 
I had the same problem today after upgrading from FreeBSD 12.0 to FreeBSD 12.1-p3, and I just would like to add a detailed list of the commands that worked for me to solve the problem. I hope that this could save time to someone arriving here from a forum/google search.

1. boot the system in "Single User" and comment the line kld_list="/boot/modules/i915kms.ko" in /etc/rc.conf (UFS, not ZFS) :
# fsck -y
# mount -u /
# nano /etc/rc.conf
# reboot


2. remove all the installed drivers packages :
# pkg info | grep ^drm
# pkg delete [drm-package-name]

note: you will still have the default old version of the module present under /boot/kernel/i915kms.ko but the newer version of the module should be gone from /boot/modules/i915kms.ko

3. update the ports collection and compile/install the last version of the driver (which have an unusual name, be careful not to use "stable", or "next", etc.) :
# portsnap fetch && portsnap extract && portsnap update
# cd /usr/ports/graphics/drm-fbsd12.0-kmod
# make && make install


4. uncomment the driver line kld_list="/boot/modules/i915kms.ko" in /etc/rc.conf and reboot

My computer now boots correctly to the graphical mode, but still crash sometimes (kernel panic) on specific action in my DE (KDE5) - let's hope that developers will be able to solve everything in the coming months :)

Source: this thread and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241101
 
Back
Top