i915 GPU hang on FreeBSD 13

nickednamed

Active Member

Reaction score: 44
Messages: 200

Hi all,

My computer freezes during graphical sessions with a "GPU hang" message at least once a day:
Code:
drmn0: Resetting chip for hang on rcs0


First my graphical application freezes, then the mouse freezes, then I get a black screen with a cursor in the middle, and so far have been unable to kill X, run any commands (blindly), get back to TTY, etc. I must press the reset button and reboot.

I'm using:

uname -a
Code:
FreeBSD 13.0-RELEASE-p4 GENERIC


dmesg | grep Intel
Code:
Intel i7-2620M with built-in GPU

I installed via graphics/drm-kmod (tried both quarterly packages and from ports, nothing changed)


pkg which /boot/modules/i915kms.ko:
Code:
/boot/modules/i915kms.ko was installed by package drm-fbsd13-kmod-5.4.144.g20210908


My /etc/rc.conf contains the following:
Code:
kld_list="i915kms"


kldstat shows the following are loaded:
Code:
i915kms.ko
drm.ko


kldstat -h -v -n i915kms shows that I am loading the following:
Code:
/boot/modules/i915kms.ko


I have tried the advice here: https://lists.freebsd.org/pipermail/freebsd-questions/2021-May/294002.html
I.E. I tried changing kld_list="i915kms" to kld_list="drm" but this left me with a low-resolution console and desktop which I was unable to change with x11/xrandr, for example.


My /boot/loader.conf contains the following, but commenting them out in various combinations made no difference.:
Code:
drm.i915.enable_rc6=7
compat.linuxkpi.enable_dc=2
compat.linuxkpi.enable_fbc=1


The Xorg.0.log doesn't show any helpful entries after restarting, but just in case:

I believe I am using the "modesetting" driver.
cat /var/log/Xorg.0.log | grep -i modesetting:
Code:
[ 32.807] (==) Matched modesetting as autoconfigured driver 1
[ 32.808] (II) LoadModule: "modesetting"
[ 32.808] (II) Loading /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
[ 32.808] (II) Module modesetting: vendor="X.Org Foundation"
[ 32.810] (II) modesetting: Driver for Modesetting Kernel Drivers: kms


Messages show the following:
cat /var/log/messages | grep -i "Oct 11 15:08:":
Code:
Oct 11 15:08:57 laptop devd[56925]: notify_clients: send() failed; dropping unresponsive client
Oct 11 15:08:57 laptop kernel: drmn0: GPU HANG: ecode 6:1:0xc3c3c3c3, in MainThread [100526], hang on rcs0
Oct 11 15:08:57 laptop kernel: drmn0: Resetting chip for hang on rcs0
Oct 11 15:08:57 laptop syslogd: last message repeated 2 times


I have read the following but it didn't help me:

I have nothing in /usr/local/etc/Xorg/xorg.conf.d/ apart from loading some fonts.

I start my graphical session with startx, and the problem persists with multiple window managers.

I have run out of ideas.
Any suggestions?
 

bsduck

Active Member

Reaction score: 198
Messages: 243

No idea how to solve this, but as a workaround you can try using xf86-video-intel instead of modesetting. That's what I use at the moment because of an other bug affecting drm-kmod.
 

eternal_noob

Aspiring Daemon

Reaction score: 508
Messages: 739

As a workaround to get reliable sleep/resume I use xf86-video-intel instead of drm-kmod.
I think you confuse things a bit here. drm-kmod is the kernel driver while xf86-video-intel is an X.Org driver.
You can't use one or the other. It's drm-kmod AND (xf86-video-intel OR modesetting).
 

bsduck

Active Member

Reaction score: 198
Messages: 243

You're right, sorry. I don't know if those bugs (the hang mentioned here as well as the suspend/resume one) are imputable to modesetting or rather to drm-kmod, but at least in my case using xf86-video-intel instead of modesetting solved it.
 
OP
N

nickednamed

Active Member

Reaction score: 44
Messages: 200

eternal_noob

Aspiring Daemon

Reaction score: 508
Messages: 739

I never tried this but i believe this is a device option:
Code:
Section "Device"
    Identifier  "Intel Graphics"
    Driver      "modesetting"
    Option      "DRI"  "1"
EndSection
 

Alexander88207

Aspiring Daemon

Reaction score: 492
Messages: 707

I would first try it with DRI 2 since the standard is DRI 3.

If it still does not work, i would create a PR in your place, after all, this problem should be solved because simply switch to older or other things is not the right solution in a long term.

Back when DXVK really was going on we had often gpu hangs which we all have reported fastly.
 
OP
N

nickednamed

Active Member

Reaction score: 44
Messages: 200

I never tried this but i believe this is a device option:
Code:
Section "Device"
    Identifier  "Intel Graphics"
    Driver      "modesetting"
    Option      "DRI"  "1"
EndSection
OK - I will try this (first with "DRI 2" and then "DRI 1") soon and report back.

However, a new version of graphics/drm-kmod (specifically, in my case graphics/drm-fbsd13-kmod and graphics/gpu-firmware-kmod) has recently landed in the quarterly repo, so I will try this for a few days and see how that goes first.

If neither works, I will install x11-drivers/xf86-video-intel and see how that goes and then report back.
 
Top