Skip to content

drm/i915: Get meteorlake graphics working#418

Merged
dumbbell merged 2 commits into
freebsd:masterfrom
amshafer:mtl
May 11, 2026
Merged

drm/i915: Get meteorlake graphics working#418
dumbbell merged 2 commits into
freebsd:masterfrom
amshafer:mtl

Conversation

@amshafer

@amshafer amshafer commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

These are a few fixes which get GuC based graphics working on meteorlake (and hopefully newer). This finally makes my dell precision 5690 laptop with Arc graphics usable. Details on each fix are in the commit descriptions. Tested with sway, plasma6 (x11), and xfce4.

You'll also want D55525 D55536 in order to prevent panics once we bump the GTT version to 4, which was an existing problem that mtl runs into. On mtl we must have GTT version 4 or else it falls back to the legacy mapping path which mtl does not support.

This should fix #373

GuC is disabled by default for now, add hw.i915kms.enable_guc="2" to loader.conf to enable it.

@colfrog

colfrog commented Feb 26, 2026

Copy link
Copy Markdown

This patch allows me to use DRI in X and I've also successfully started sway on meteorlake. However, on my first try plasma became unresponsive not long after I started firefox. I can repeat the issue.

Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Unsolicited response message: len 1, data 0xe
0000104 (fence 10876, last 10876)
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to handle HXG message (0xfffffffffffff
f82e) fffff80004628358h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to process CT message (0xfffffffffffff
f82e) fffff80004628354h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Unsolicited response message: len 1, data 0xe
0000104 (fence 10985, last 10985)
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to handle HXG message (0xfffffffffffff
f82e) fffff80640f93678h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to process CT message (0xfffffffffffff
f82e) fffff80640f93674h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Unsolicited response message: len 1, data 0xe
0000104 (fence 10986, last 10986)
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to handle HXG message (0xfffffffffffff
f82e) fffff80640f93678h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to process CT message (0xfffffffffffff
f82e) fffff80640f93674h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Unsolicited response message: len 1, data 0xe0000104 (fence 10997, last 10997)
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to handle HXG message (0xffffffffffffff82e) fffff80640f93678h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to process CT message (0xffffffffffffff82e) fffff80640f93674h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Unsolicited response message: len 1, data 0xe0000104 (fence 10999, last 10999)
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to handle HXG message (0xffffffffffffff82e) fffff80640f93678h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to process CT message (0xffffffffffffff82e) fffff80640f93674h
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: Bad context sched_state 0x6, ctx_id 4128
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to process request 1002 (0xffffffffffffffa4e)
Feb 26 08:54:25 GAUSS kernel: drmn0: [drm] *ERROR* GT0: GUC: CT: Failed to process CT message (0xffffffffffffffa4e) fffff8061fcdd1d4h

@amshafer

Copy link
Copy Markdown
Contributor Author

@colfrog Did you try with the freebsd fix mentioned in the description? (You'll want D55536 actually, that's the latest fix). I reproduced the messages you described only once and it was when I was running without that fix.

@colfrog

colfrog commented Feb 27, 2026

Copy link
Copy Markdown

@colfrog Did you try with the freebsd fix mentioned in the description? (You'll want D55536 actually, that's the latest fix). I reproduced the messages you described only once and it was when I was running without that fix.

I did apply that patch. I've also just now tried the other one, same issue. I've also had a panic which I couldn't read because of the DRM screen, and for some reason it didn't write to /var/crash. I know it's a panic though because instead of forcing the power off I just typed reboot and it did it, this implies the debugger prompt.

@amshafer

Copy link
Copy Markdown
Contributor Author

You should be able to get auto crash dumps with

# auto crashdump
kern.coredump=1
debug.minidump=1
debug.debugger_on_panic=0
debug.kdb.break_to_debugger=0

if that helps capture the panic.

As for the GuC communication messages, does that happen every time you use plasma? I've only managed to see it the one time. Are any other desktops impacted?

@wulf7

wulf7 commented Mar 2, 2026

Copy link
Copy Markdown
Contributor

IIRC it is not enough to set PG_M. There was "lkpi_vmf_insert_pfn_prot_locked: page rename failed: page is mapped" console mesage appeared too often to lock OS in some cases.

@amshafer

amshafer commented Mar 2, 2026

Copy link
Copy Markdown
Contributor Author

I haven't observed that one myself so will be interesting if anyone else runs into it

@kyoshiro

kyoshiro commented Mar 3, 2026

Copy link
Copy Markdown

That looks quite interesting! As I am very new to FreeBSD but managed to compile the driver already I will give it a try, too. But I am unsure about compiling against R15. I wasn't able to compile the master nor drm_v6.10 branch due to missing dependencies in the system sources. Will try with tag drm_v6.9_1 then which compiled successful before and apply this pull request. Also https://reviews.freebsd.org/D55536 has been mentioned necessary to apply. So, I guess this will require to rebuild FreeBSD and to build the drm driver, right? Anything else I need to take care about?

@kyoshiro

kyoshiro commented Mar 8, 2026

Copy link
Copy Markdown

I had the chance to get closer to this. I built the kernel from freebsd-src main with applied patch D55536. Then I built the drm-kmod from this branch mtl. But, I couldn't get neither sway (wayland) nor xfce4 (Xorg) to run. Wayland still complained missing intel_device_info and in Xorg it gave following error:

intel(0): intel_uxa_set_pixmap_bo: size of buffer object does not match constraints: size=20971520, must be greater than 20736000, but less than 4194304. That's kind of strange mathematics as upper limit is lower than lower limit.

See full Xorg.0.log attached.

Anyway, system kept stable and no buggy output in tty anymore after loading the module.

System info: ThinkPad T14 G5:

$ sysctl -a | egrep -i 'hw.machine|hw.model|hw.ncpu'
hw.machine: amd64
hw.model: Intel(R) Core(TM) Ultra 7 155U
hw.ncpu: 14
hw.machine_arch: amd64

@amshafer

amshafer commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Do you have hw.i915kms.enable_guc="2" in loader.conf? You'll need that. GuC is disabled by default since it hasn't been working before this MR, maybe we should enable it again.

@kyoshiro

kyoshiro commented Mar 9, 2026

Copy link
Copy Markdown

Do you have hw.i915kms.enable_guc="2" in loader.conf? You'll need that. GuC is disabled by default since it hasn't been working before this MR, maybe we should enable it again.

Thx, I missed that one. But, I'm afraid to say, it didn't do the trick. Behavior is still the same. Neither wayland nor Xorg are able to start. Error messages are also still the same.

Maybe I have missed something else. I will start over applying your changes to the latest drm-kmod. Some other changes have been there in the meantime. Keeping you updated.

@wulf7

wulf7 commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

intel(0): intel_uxa_set_pixmap_bo: size of buffer object does not match constraints: size=20971520, must be greater than 20736000, but less than 4194304. That's kind of strange mathematics as upper limit is lower than lower limit.

Do not use Intel driver with modern devices. It does not work. Use modesetting

@kyoshiro

kyoshiro commented Mar 13, 2026

Copy link
Copy Markdown

I could have seen this earlier. So not loading the module on boot but via kldload gave me the output, when loading the module manually later. See log attached. Seems firmware doesn't match kernel. I tried by updating gpu-firmware-kmod-intel-meteorlake but there wasn't any newer.

kld_load.log

@amshafer

amshafer commented Mar 16, 2026

Copy link
Copy Markdown
Contributor Author

We will need logs to see what's going wrong with your system. If you have gotten this MR to run properly then you definitely should not be seeing the intel_device_info error. I'd make sure you're installing things properly and the firmware pkg is installed as well, check for any dmesg errors about firmware failing to load, etc.

Looks like you need to build your gpu-firmware-kmod for your new kernel:

 KLD i915_mtl_guc_70_bin.ko: depends on kernel - not available or version mismatch

@JustAnotherHumanBeing

Copy link
Copy Markdown

Will the fixes mentioned here allow me to do this: mpv --vo=gpu-next --gpu-api=opengl --hwdec=no video.mkv ? Will gpu-next be usable on a Meteor Lake iGPU if these fixes are applied?

@aokblast

aokblast commented Apr 7, 2026

Copy link
Copy Markdown

It works on my Framework Laptop. Thanks!

@kyoshiro

kyoshiro commented Apr 7, 2026

Copy link
Copy Markdown

I don't get it. I did also build the drm-kmod-firmware to match the installed kernel. Now, loading the firmware by the driver succeeded, but the module instantly traces with:

panic: mtx_lock() of spin mutex (null) @ /usr/home/kyoshiro/dev/git/foreign/freebsd-src/sys/compat/linuxkpi/common/src/linux_xarray.c:242

So what are the steps to get this to work? I assumed:

  1. Building the latest kernel from freebsd-src, patched with https://reviews.freebsd.org/D55536
  2. Building drm-kmod-firmware against freebsd-src (from Step 1)
  3. Building drm-kmod branch mtl against freebsd-src (from Step 1)

What am I missing?

@amshafer

amshafer commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

What freebsd kernel are you building? You should run the latest CURRENT and it will have everything already. Your panic sounds like you are missing commit "linuxkpi: Don't destroy the mutex in xa_destroy()" or something. The steps you listed seem correct though.

@amshafer

amshafer commented Apr 8, 2026

Copy link
Copy Markdown
Contributor Author

cc: @dumbbell

@dasTor

dasTor commented Apr 17, 2026

Copy link
Copy Markdown

i am currently running 16-Current (PkgBase from today), have build drm-kmod (master) and the corresponding:
drm-kmod-firmware branch: update-firmwares-to-20260309
set hw.i915kms.enable_guc="2" in loader.conf
and get the same:
panic: mtx_lock() of spin mutex (null) @ /src/sys/compat/linuxkpi/common/src/linux_xarray.c:242

i tried applying the patch from @amshafer on top of drm-kmod master,
but the panic still persists, see attached semi professional screenshot
this is drm-kmod iuncluding https://github.com/freebsd/drm-kmod/pull/418.patch
bt

@dumbbell

Copy link
Copy Markdown
Member

@dasTor: The panic you shared should be fixed in my drm-related-linuxkpi-changes branch of freebsd-src. Could you please try again?

@dasTor

dasTor commented Apr 27, 2026

Copy link
Copy Markdown

@dumbbell i did build the kernel from your drm-related-linuxkpi-changes which was 6 commits ahead of -master,
same panic - in combination with drm-kmod master.
If i can get more useful output somehow, i'm happy to provide it. I only have:
Apr 27 13:56:42 bsdell savecore[6197]: reboot after panic: mtx_lock() of spin mutex (null) @ /usr/freebsd-src/sys/compat/linuxkpi/common/src/linux_xarray.c:237 Apr 27 13:56:42 bsdell savecore[6197]: writing core to /var/crash/vmcore.0

@dumbbell

dumbbell commented Apr 30, 2026

Copy link
Copy Markdown
Member

@dasTor: I’m surprised. This code is not hardware dependent and will behave the same everywhere. The only similar report was because of an unclean build. Can you try to refresh freebsd-src and drm-kmod branches and try to compile both from scratch?

For the record, all DRM-6.12-related linuxkpi patches were pushed to both freebsd-src main and stable/15 branches.

ocochard added a commit to ocochard/freebsd-ports that referenced this pull request May 1, 2026
Bump from drm_v6.9_1 to master HEAD a72c05b22dc21e to pick up
Linux 6.12-based DRM drivers and Meteor Lake / Arrow Lake support.

Includes:
- Reorder kconfig.mk / bsd.kmod.mk includes in drm/Makefile and
  i915/Makefile so generated headers (device_if.h, vnode_if.h, ...)
  resolve and so MKCONFIG-gated SRCS+= blocks (drm_debugfs.c, etc.)
  are not silently dropped. Without this, drm.ko links but is missing
  symbols like drm_debugfs_add_files at load time.
- Suppress -Waddress-of-packed-member globally in i915 build.
- Cherry-pick two commits from amshafer:mtl (PR freebsd/drm-kmod#418):
  initialize GMADR on Meteor Lake (a2ca1d5) and skip GT1 standalone
  media GT (0872ce4), without which i915 fails with
  "Enabling uc failed (-5)" / "declaring it wedged" on MTL.

Tested on Lenovo X1 Carbon (Meteor Lake-P, PCI ID 0x7d45) with
hw.i915kms.enable_guc=2: GuC firmware loads (mtl_guc_70.bin v70.53.0),
GT0 initializes, /dev/dri/{card0,renderD128} are created.
@kyoshiro

kyoshiro commented May 4, 2026

Copy link
Copy Markdown

i am currently running 16-Current (PkgBase from today), have build drm-kmod (master) and the corresponding: drm-kmod-firmware branch: update-firmwares-to-20260309 set hw.i915kms.enable_guc="2" in loader.conf and get the same: panic: mtx_lock() of spin mutex (null) @ /src/sys/compat/linuxkpi/common/src/linux_xarray.c:242

i tried applying the patch from @amshafer on top of drm-kmod master, but the panic still persists, see attached semi professional screenshot this is drm-kmod iuncluding https://github.com/freebsd/drm-kmod/pull/418.patch

That's the same trace I got, too. So, I am not alone anymore 😀
Just guessing: Are there differences in Meteorlake CPUs? In my case it's an Ultra 7 155U.

@dasTor

dasTor commented May 5, 2026

Copy link
Copy Markdown

@dumbbell i updated current from pkgbase yesterday and did a clean rebuild of drm-kmod (master)
drm-kmod-firmware is still your 6.12.81 version. I got a core, if that helps:
core.txt.1.gz

@kyoshiro

kyoshiro commented May 5, 2026

Copy link
Copy Markdown

@dumbbell i updated current from pkgbase yesterday and did a clean rebuild of drm-kmod (master) drm-kmod-firmware is still your 6.12.81 version. I got a core, if that helps: core.txt.1.gz

Same here. Panic the same, just different line. Before updating the sources it's been 242, now 237:

panic: mtx_lock() of spin mutex (null) @ /usr/home/kyoshiro/dev/git/foreign/freebsd-src/sys/compat/linuxkpi/common/src/linux_xarray.c:237

@dumbbell

dumbbell commented May 5, 2026

Copy link
Copy Markdown
Member

Thank you @dasTor and @kyoshiro, I will take a look at the core @dasTor shared!

@dumbbell

dumbbell commented May 5, 2026

Copy link
Copy Markdown
Member

@dasTor, @kyoshiro: Could you please try to set enable_guc=3 instead of 2?

The GuC submission is disabled in your case (enable_guc=2) according to the dmesg in the shared core.txt. When I look at the code, the initialisation of the xarray (and its lock) that triggers the panic is skipped if GuC submission is disabled.

I didn't read the code enough yet, but so far, I don't see where it would skip intel_guc_invalidate_tlb_engines() as well if the GuC submission was disabled. I tried to reproduce and set enable_guc=2 but the driver still loaded successfully. I have an old Intel 12th gen GPU, so it's possible this code is not executed in my case anyway. Also, the code clearly states that the whole GuC is broken for 12th gen...

@dumbbell dumbbell self-assigned this May 9, 2026
@dumbbell dumbbell added the i915 i915 related problems label May 9, 2026
@aokblast

aokblast commented May 9, 2026

Copy link
Copy Markdown

The patch looks good to me. Could you please rebase it onto the latest master? This way, CI will run.

I don’t have a way to test this however. @dasTor, @kyoshiro or @aokblast, does this version of the patch still makes your GPU work?

Also works with enable_guc=2 on Framework Laptop Intel Core Ultra.

@dasTor

dasTor commented May 11, 2026

Copy link
Copy Markdown

i am currently seeing the crashes again with drm-kmod master, this pull request and -current from saturday:
master_guc_2_ashafer.txt.gz
i also tried the 6.12-lts branch, but it's the same:
drm_6.12-lts_guc2_ashafer_patch.txt.gz

does it makes sense to test with 15.1-rc and 6.12-lts branch? or are there linuxkpi patches missing in the
15.1 branch?

thanks for all your efforts @dumbbell and @amshafer

@amshafer

Copy link
Copy Markdown
Contributor Author

Hmm ok, so do you think it’s one of the changes I requested? The use of enable_guc=3? Or something external, like a newer src?

I think it's something external but I'm trying to narrow down what. The changes in this MR seem sane

@dumbbell

Copy link
Copy Markdown
Member

@dasTor: There are no new linuxkpi changes from me in freebsd-src main branch that stable/15 doesn’t have. There could be changes from others however, I didn’t pay attention to that.

I’m building this branch again, after updating freebsd-src to today’s main branch. I will set enabled_guc=2 too.

@amshafer

Copy link
Copy Markdown
Contributor Author
May  8 21:34:34 token kernel: drmn1: [drm] *ERROR* GT0: GUC: Bad context sched_state 0x6, ctx_id 4149

Okay testing again with everything properly updated to the latest and I don't see this anymore, KDE working fine. I think the problem was an outdated gpu-firmware packages which I hadn't updated to match my new src checkout. I think this MR is in good shape to land at this point

@dumbbell

Copy link
Copy Markdown
Member

I think this MR is in good shape to land at this point

I think so too. I'm replying from my laptop running this branch. I'm going to merge it and we can continue to work on issues like the panic @dasTor gets or the computer not powering off with enable_guc=3.

@dasTor: Quick question, how do you load i915kms?

@dumbbell
dumbbell merged commit b99c80e into freebsd:master May 11, 2026
4 checks passed
@dasTor

dasTor commented May 11, 2026

Copy link
Copy Markdown

kldloading after boot

dumbbell added a commit to dumbbell/drm-kmod that referenced this pull request May 11, 2026
Some recent GPUs require this to work (see freebsd#418). If we need to disable
GuC for some GPUs, we can add them in `uc_expand_default_options()` in
`drivers/gpu/drm/i915/gt/uc/intel_uc.c`. It will be better than
disabling it for everyone, requiring some user to mess with an obscure
setting in `/boot/loader.conf`.

Sponsored by:	The FreeBSD Foundation
@dumbbell dumbbell changed the title Get meteorlake graphics working drm/i915: Get meteorlake graphics working May 11, 2026
dumbbell added a commit to dumbbell/drm-kmod that referenced this pull request May 11, 2026
... except that GuC submission is still disabled on FreeBSD by default.

Some recent GPUs require this to work (see freebsd#418). If we need to disable
GuC for some GPUs, we can add them in `uc_expand_default_options()` in
`drivers/gpu/drm/i915/gt/uc/intel_uc.c`. It will be better than
disabling it for everyone, requiring some user to mess with an obscure
setting in `/boot/loader.conf`.

As said at the beginning however, we still disable GuC submission by
default on FreeBSD. The reason is that is often prevents a computer from
powering off: the kernel stops everything, the display is turned off,
but the power LED is on and the fans are audible.

Sponsored by:	The FreeBSD Foundation
@dumbbell

Copy link
Copy Markdown
Member

@amshafer: Thank you very much for the patch :-)

@dasTor: Ok, thank you. I will continue to study the code.

@dasTor

dasTor commented May 11, 2026

Copy link
Copy Markdown

kldload_master_current.txt.gz
i build the master a few seconds ago, updated my -current from pkgbase and the module loads,
but i get the "declaring gpu wedged" message and my wm does not load. i have enabled hw.dri.debug and attached the output.

i really wish, modern gpus wouldn't consist of multiple separate chips that need some stupid binary blobs to work.

@dasTor

dasTor commented May 13, 2026

Copy link
Copy Markdown

Quick feedback, i went to 15.1-rc2 and drm-kmod branch 6.12-lts is loading and working, thx guys

ocochard added a commit to ocochard/freebsd-ports that referenced this pull request May 20, 2026
Bump from drm_v6.9_1 to master HEAD a72c05b22dc21e to pick up
Linux 6.12-based DRM drivers and Meteor Lake / Arrow Lake support.

Includes:
- Reorder kconfig.mk / bsd.kmod.mk includes in drm/Makefile and
  i915/Makefile so generated headers (device_if.h, vnode_if.h, ...)
  resolve and so MKCONFIG-gated SRCS+= blocks (drm_debugfs.c, etc.)
  are not silently dropped. Without this, drm.ko links but is missing
  symbols like drm_debugfs_add_files at load time.
- Suppress -Waddress-of-packed-member globally in i915 build.
- Cherry-pick two commits from amshafer:mtl (PR freebsd/drm-kmod#418):
  initialize GMADR on Meteor Lake (a2ca1d5) and skip GT1 standalone
  media GT (0872ce4), without which i915 fails with
  "Enabling uc failed (-5)" / "declaring it wedged" on MTL.

Tested on Lenovo X1 Carbon (Meteor Lake-P, PCI ID 0x7d45) with
hw.i915kms.enable_guc=2: GuC firmware loads (mtl_guc_70.bin v70.53.0),
GT0 initializes, /dev/dri/{card0,renderD128} are created.
@JustAnotherHumanBeing

Copy link
Copy Markdown

With enable_guc=3, current drm-kmod master and drm-kmod-firmware master, Sway starts and mpv works, but after some use the system wedges with:
GUC: CT: Unsolicited response message
GUC: CT: Failed to handle HXG message
GUC: CT: Failed to process CT message
GUC: Bad context sched_state

This still happens with enable_psr=0, enable_dc=0, enable_fbc=0.
enable_guc=2 crashes during boot.
enable_guc=0 allows kwin_wayland but leaves Sway/mpv unusable. I run 16-CURRENT from June 15.

@JustAnotherHumanBeing

Copy link
Copy Markdown

I was surprised I didn't experience a kernel panic after setting the guc value to 1. I didn't yet experience a freeze or a hang after setting the value of 1, so, hopefully, this is a real solution to the problem.

@JustAnotherHumanBeing

Copy link
Copy Markdown

It turned out it wasn't a solution. I still experienced a hang.

@amshafer

Copy link
Copy Markdown
Contributor Author

@JustAnotherHumanBeing kind of a long shot but can you apply the following and see if that helps?

commit 74d460b38b0aa928bedad295d9e53f0d573ed692 (HEAD -> mtl, origin/mtl)
Author: Austin Shafer <ashafer@badland.io>
Date:   Mon Jun 22 13:16:04 2026 -0400

    drm: drm_can_sleep check td_pinned to better test if we can sleep

diff --git a/include/drm/drm_util.h b/include/drm/drm_util.h
index c139e97bff67..91430ba004f1 100644
--- a/include/drm/drm_util.h
+++ b/include/drm/drm_util.h
@@ -84,7 +84,7 @@ static inline bool drm_can_sleep(void)
        if (in_atomic() || in_dbg_master() || irqs_disabled())
 #elif defined (__FreeBSD__)
        if (in_atomic() || in_dbg_master() || curthread->td_critnest != 0 ||
-           curthread->td_intr_nesting_level != 0)
+           curthread->td_intr_nesting_level != 0 || curthread->td_pinned > 0)
 #endif
                return false;
        return true;

@JustAnotherHumanBeing

JustAnotherHumanBeing commented Jun 22, 2026

Copy link
Copy Markdown

I didn't try your approach yet because two days ago, ChatGPT wrote a patch for me in an attempt to fix this issue. I rebooted after applying that patch and haven't yet experienced any GPU-related hangs or crashes. So maybe that patch did fix the issue. Here it is:

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
old mode 100644
new mode 100755
index 5cf3a516cc..7cee95d36b
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
@@ -44,6 +44,8 @@ static inline struct intel_guc *ct_to_guc(struct intel_guc_ct *ct)
 
 #define CT_ERROR(_ct, _fmt, ...) \
 	guc_err(ct_to_guc(_ct), "CT: " _fmt, ##__VA_ARGS__)
+#define CT_ERROR_RATELIMITED(_ct, _fmt, ...) \
+	guc_err_ratelimited(ct_to_guc(_ct), "CT: " _fmt, ##__VA_ARGS__)
 #ifdef CONFIG_DRM_I915_DEBUG_GUC
 #define CT_DEBUG(_ct, _fmt, ...) \
 	guc_dbg(ct_to_guc(_ct), "CT: " _fmt, ##__VA_ARGS__)
@@ -53,6 +55,13 @@ static inline struct intel_guc *ct_to_guc(struct intel_guc_ct *ct)
 #define CT_PROBE_ERROR(_ct, _fmt, ...) \
 	guc_probe_error(ct_to_guc(ct), "CT: " _fmt, ##__VA_ARGS__)
 
+#define G2H_LEN_DW(f) ({ \
+	typeof(f) f_ = (f); \
+	FIELD_GET(INTEL_GUC_CT_SEND_G2H_DW_MASK, f_) ? \
+	FIELD_GET(INTEL_GUC_CT_SEND_G2H_DW_MASK, f_) + \
+	GUC_CTB_HXG_MSG_MIN_LEN : 0; \
+})
+
 /**
  * DOC: CTB Blob
  *
@@ -132,6 +141,7 @@ long intel_guc_ct_max_queue_time_jiffies(void)
 
 static void ct_receive_tasklet_func(struct tasklet_struct *t);
 static void ct_incoming_request_worker_func(struct work_struct *w);
+static inline void g2h_release_space(struct intel_guc_ct *ct, u32 g2h_len_dw);
 
 /**
  * intel_guc_ct_init_early - Initialize CT state without requiring device access
@@ -348,6 +358,7 @@ int intel_guc_ct_enable(struct intel_guc_ct *ct)
 	/* (re)initialize descriptors */
 	guc_ct_buffer_reset(&ct->ctbs.send);
 	guc_ct_buffer_reset(&ct->ctbs.recv);
+	memset(ct->requests.async, 0, sizeof(ct->requests.async));
 
 	/*
 	 * Register both CT buffers starting with RECV buffer.
@@ -421,6 +432,78 @@ static void ct_track_lost_and_found(struct intel_guc_ct *ct, u32 fence, u32 acti
 }
 #endif
 
+static void ct_track_async_request(struct intel_guc_ct *ct,
+				   u32 fence, const u32 *action,
+				   u32 len, u32 flags)
+{
+	unsigned int n = fence % ARRAY_SIZE(ct->requests.async);
+	unsigned long irqflags;
+
+	if (!(flags & INTEL_GUC_CT_SEND_NB))
+		return;
+
+	spin_lock_irqsave(&ct->requests.lock, irqflags);
+	ct->requests.async[n].fence = fence;
+	ct->requests.async[n].action = action[0];
+	ct->requests.async[n].data0 = len > 1 ? action[1] : 0;
+	ct->requests.async[n].g2h_len_dw = G2H_LEN_DW(flags);
+	ct->requests.async[n].valid = true;
+	spin_unlock_irqrestore(&ct->requests.lock, irqflags);
+}
+
+static void ct_forget_async_request(struct intel_guc_ct *ct, u32 fence,
+				    u32 g2h_len_dw)
+{
+	unsigned int n = fence % ARRAY_SIZE(ct->requests.async);
+	unsigned long flags;
+
+	spin_lock_irqsave(&ct->requests.lock, flags);
+	if (ct->requests.async[n].valid &&
+	    ct->requests.async[n].fence == fence &&
+	    ct->requests.async[n].g2h_len_dw == g2h_len_dw)
+		ct->requests.async[n].valid = false;
+	spin_unlock_irqrestore(&ct->requests.lock, flags);
+}
+
+static bool ct_consume_async_response(struct intel_guc_ct *ct, u32 fence,
+				      u32 hxg)
+{
+	unsigned int n = fence % ARRAY_SIZE(ct->requests.async);
+	u32 type = FIELD_GET(GUC_HXG_MSG_0_TYPE, hxg);
+	u16 action;
+	u16 g2h_len_dw;
+	u32 data0;
+
+	lockdep_assert_held(&ct->requests.lock);
+
+	if (!ct->requests.async[n].valid ||
+	    ct->requests.async[n].fence != fence)
+		return false;
+
+	action = ct->requests.async[n].action;
+	data0 = ct->requests.async[n].data0;
+	g2h_len_dw = ct->requests.async[n].g2h_len_dw;
+	ct->requests.async[n].valid = false;
+
+	if (g2h_len_dw)
+		g2h_release_space(ct, g2h_len_dw);
+
+	if (type == GUC_HXG_TYPE_RESPONSE_FAILURE) {
+		u32 hint = FIELD_GET(GUC_HXG_FAILURE_MSG_0_HINT, hxg);
+		u32 error = FIELD_GET(GUC_HXG_FAILURE_MSG_0_ERROR, hxg);
+
+		CT_ERROR_RATELIMITED(ct,
+				     "Fast request %#04x data0 %#x failed: error %#x hint %u (fence %u, released %u G2H dw)\n",
+				     action, data0, error, hint, fence, g2h_len_dw);
+	} else {
+		CT_ERROR_RATELIMITED(ct,
+				     "Fast request %#04x data0 %#x returned unexpected response %#x (fence %u, released %u G2H dw)\n",
+				     action, data0, hxg, fence, g2h_len_dw);
+	}
+
+	return true;
+}
+
 static u32 ct_get_next_fence(struct intel_guc_ct *ct)
 {
 	/* For now it's trivial */
@@ -496,6 +579,7 @@ static int ct_write(struct intel_guc_ct *ct,
 	ct_track_lost_and_found(ct, fence,
 				FIELD_GET(GUC_HXG_EVENT_MSG_0_ACTION, action[0]));
 #endif
+	ct_track_async_request(ct, fence, action, len, flags);
 
 	/*
 	 * make sure H2G buffer update and LRC tail update (if this triggering a
@@ -671,12 +755,6 @@ static int has_room_nb(struct intel_guc_ct *ct, u32 h2g_dw, u32 g2h_dw)
 	return 0;
 }
 
-#define G2H_LEN_DW(f) ({ \
-	typeof(f) f_ = (f); \
-	FIELD_GET(INTEL_GUC_CT_SEND_G2H_DW_MASK, f_) ? \
-	FIELD_GET(INTEL_GUC_CT_SEND_G2H_DW_MASK, f_) + \
-	GUC_CTB_HXG_MSG_MIN_LEN : 0; \
-})
 static int ct_send_nb(struct intel_guc_ct *ct,
 		      const u32 *action,
 		      u32 len,
@@ -1085,6 +1163,9 @@ static int ct_handle_response(struct intel_guc_ct *ct, struct ct_incoming_msg *r
 	}
 #endif
 
+	if (!found && ct_consume_async_response(ct, fence, hxg[0]))
+		found = true;
+
 	if (!found) {
 		CT_ERROR(ct, "Unsolicited response message: len %u, data %#x (fence %u, last %u)\n",
 			 len, hxg[0], fence, ct->requests.last_fence);
@@ -1212,6 +1293,7 @@ static void ct_incoming_request_worker_func(struct work_struct *w)
 static int ct_handle_event(struct intel_guc_ct *ct, struct ct_incoming_msg *request)
 {
 	const u32 *hxg = &request->msg[GUC_CTB_MSG_MIN_LEN];
+	u32 fence = FIELD_GET(GUC_CTB_MSG_0_FENCE, request->msg[0]);
 	u32 action = FIELD_GET(GUC_HXG_EVENT_MSG_0_ACTION, hxg[0]);
 	unsigned long flags;
 
@@ -1227,6 +1309,7 @@ static int ct_handle_event(struct intel_guc_ct *ct, struct ct_incoming_msg *requ
 	case INTEL_GUC_ACTION_DEREGISTER_CONTEXT_DONE:
 	case INTEL_GUC_ACTION_TLB_INVALIDATION_DONE:
 		g2h_release_space(ct, request->size);
+		ct_forget_async_request(ct, fence, request->size);
 	}
 
 	/*
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h
old mode 100644
new mode 100755
index 2c4bb9a941..193dd60e7a
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h
@@ -83,6 +83,14 @@ struct intel_guc_ct {
 		struct list_head incoming; /* incoming requests */
 		struct work_struct worker; /* handler for incoming requests */
 
+		struct {
+			u16 fence;
+			u16 action;
+			u16 g2h_len_dw;
+			u32 data0;
+			bool valid;
+		} async[SZ_256];
+
 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)
 		struct {
 			u16 fence;
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c
old mode 100644
new mode 100755
index 9df7927304..692f3e5c46
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.c
@@ -22,6 +22,9 @@ static bool __guc_rc_selected(struct intel_guc *guc)
 	if (!intel_guc_rc_is_supported(guc))
 		return false;
 
+	if (IS_METEORLAKE(guc_to_i915(guc)))
+		return false;
+
 	return guc->submission_selected;
 }
 
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.h b/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.h
old mode 100644
new mode 100755
index 57e86c3378..834d9b8801
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_rc.h
@@ -17,7 +17,7 @@ static inline bool intel_guc_rc_is_supported(struct intel_guc *guc)
 
 static inline bool intel_guc_rc_is_wanted(struct intel_guc *guc)
 {
-	return guc->submission_selected && intel_guc_rc_is_supported(guc);
+	return guc->rc_selected;
 }
 
 static inline bool intel_guc_rc_is_used(struct intel_guc *guc)
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
old mode 100644
new mode 100755
index 706fffca69..49101e4138
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
@@ -42,6 +42,9 @@ static bool __guc_slpc_selected(struct intel_guc *guc)
 	if (!intel_guc_slpc_is_supported(guc))
 		return false;
 
+	if (IS_METEORLAKE(guc_to_i915(guc)))
+		return false;
+
 	return guc->submission_selected;
 }
 
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
old mode 100644
new mode 100755
index 355a21eb48..8e611178fe
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -5114,6 +5114,37 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
 	if (unlikely(!ce))
 		return -EPROTO;
 
+	if (unlikely(context_destroyed(ce) && context_pending_disable(ce))) {
+		bool banned;
+
+		trace_intel_context_sched_done(ce);
+
+		/*
+		 * The context is already being destroyed, so consume this late
+		 * schedule-disable completion without unblocking new work on the
+		 * context. Waking ce->guc_state.fences here can let requests run
+		 * against a context that is no longer reusable.
+		 */
+		intel_context_sched_disable_unpin(ce);
+
+		spin_lock_irqsave(&ce->guc_state.lock, flags);
+		banned = context_banned(ce);
+		clr_context_banned(ce);
+		clr_context_pending_disable(ce);
+		guc_blocked_fence_complete(ce);
+		spin_unlock_irqrestore(&ce->guc_state.lock, flags);
+
+		if (banned) {
+			guc_cancel_context_requests(ce);
+			intel_engine_signal_breadcrumbs(ce->engine);
+		}
+
+		decr_outstanding_submission_g2h(guc);
+		intel_context_put(ce);
+
+		return 0;
+	}
+
 	if (unlikely(context_destroyed(ce) ||
 		     (!context_pending_enable(ce) &&
 		     !context_pending_disable(ce)))) {

@amshafer

Copy link
Copy Markdown
Contributor Author

The formatting has made that illegible and without any details as to what it does it's hard to draw conclusions from this.

Can you please revert that and try what I sent? I believe what could be happening is we don't properly detect if we can sleep or not so we sleep when we shouldn't, and that causes issues with replies from the GuC properly arriving.

@JustAnotherHumanBeing

Copy link
Copy Markdown

I was wrong when I was thinking that ChatGPT-generated patch got rid of the problem. Even though, after installing the patch, I didn't experience issues for two days, a kernel panic occurred today, which is day 3. I have no idea why it didn't occur earlier than today. I wish I were not as much of a n00b as I actually am... Anyway... I got rid of this patch and tested your patch, amshafer. It didn't fix the issue. The plasma 6 GUI froze when I was running it and I saw these messages when I switched to the text console: "login: drmn0: [drm] ERROR GT0: GUC: CT: Unsolicited response message: len 1, data 0xe000
0104 (fence 39907, last 39907)
drmn0: [drm] ERROR GT0: GUC: CT: Failed to handle HXG message (0xffffffffffffff82e) ffff
f8003446d998h
drmn0: [drm] ERROR GT0: GUC: CT: Failed to process CT message (0xffffffffffffff82e) ffff
f8003446d994h
drmn0: [drm] ERROR GT0: GUC: CT: Unsolicited response message: len 1, data 0xe0000104 (f
ence 39908, last 39909)
drmn0: [drm] ERROR GT0: GUC: CT: Failed to handle HXG message (0xffffffffffffff82e) ffff
f8003446d998h
drmn0: [drm] ERROR GT0: GUC: CT: Failed to process CT message (0xffffffffffffff82e) ffff
f8003446d994h
drmn0: [drm] ERROR GT0: GUC: Bad context sched_state 0x6, ctx_id 4119
drmn0: [drm] ERROR GT0: GUC: CT: Failed to process request 1002 (0xffffffffffffffa4e)
drmn0: [drm] ERROR GT0: GUC: CT: Failed to process CT message (0xffffffffffffffa4e) ffff
f80466aee6d4h
Pdrmn0: [drm] Got hung context on ccs0 with active request 119:2 [0x101F] not yet started
drmn0: [drm] GPU HANG: ecode 12:10:71bdafef, in kwin_wayland [101390]". I am lucky a kernel panic didn't occur and I was able to switch to the text console and read those GUC-related messages. Sigh... I am really lost and confused now... Maybe I need to ask ChatGPT to write another patch for me... The problem is that this bug is really confusing: things might run normally for a few days and only after those few days this GUC-related hang will occur.

@JustAnotherHumanBeing

Copy link
Copy Markdown

Now I am testing another ChatGPT-generated patch; hopefully, it's good:

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
index ed97984718..fc4ae43c1b 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
@@ -396,6 +396,49 @@ static inline void set_context_guc_id_invalid(struct intel_context *ce)
 	ce->guc_id.id = GUC_INVALID_CONTEXT_ID;
 }
 
+static void guc_log_context_sched_state(struct intel_guc *guc,
+					struct intel_context *ce,
+					u32 msg_ctx_id,
+					const char *reason)
+{
+	unsigned long flags;
+	u32 sched_state;
+	u8 prio;
+
+	spin_lock_irqsave(&ce->guc_state.lock, flags);
+	sched_state = ce->guc_state.sched_state;
+	prio = ce->guc_state.prio;
+	spin_unlock_irqrestore(&ce->guc_state.lock, flags);
+
+	guc_err(guc,
+		"%s: msg_ctx_id=%u ce=%p ce_guc_id=%u guc_id_ref=%d sched_state=0x%x "
+		"destroyed=%u pending_enable=%u pending_disable=%u enabled=%u "
+		"registered=%u banned=%u closed=%u blocked=%u prio=%u "
+		"pin_count=%d active_count=%u flags=0x%lx engine=%s ring=%p "
+		"state=%p timeline=%p lrc_reg_state=%p ops=%p\n",
+		reason,
+		msg_ctx_id,
+		ce,
+		ce->guc_id.id,
+		atomic_read(&ce->guc_id.ref),
+		sched_state,
+		!!(sched_state & SCHED_STATE_DESTROYED),
+		!!(sched_state & SCHED_STATE_PENDING_ENABLE),
+		!!(sched_state & SCHED_STATE_PENDING_DISABLE),
+		!!(sched_state & SCHED_STATE_ENABLED),
+		!!(sched_state & SCHED_STATE_REGISTERED),
+		!!(sched_state & SCHED_STATE_BANNED),
+		!!(sched_state & SCHED_STATE_CLOSED),
+		(sched_state & SCHED_STATE_BLOCKED_MASK) >>
+			SCHED_STATE_BLOCKED_SHIFT,
+		prio,
+		atomic_read(&ce->pin_count),
+		ce->active_count,
+		ce->flags,
+		ce->engine ? ce->engine->name : "(null)",
+		ce->ring, ce->state, ce->timeline, ce->lrc_reg_state, ce->ops);
+}
+
 static inline struct intel_guc *ce_to_guc(struct intel_context *ce)
 {
 	return gt_to_guc(ce->engine->gt);
@@ -2981,7 +3024,8 @@ static void guc_context_unpin(struct intel_context *ce)
 	unpin_guc_id(guc, ce);
 	lrc_unpin(ce);
 
-	if (likely(!intel_context_is_barrier(ce)))
+	if (likely(!intel_context_is_barrier(ce)) &&
+	    intel_engine_pm_is_awake(ce->engine))
 		intel_engine_pm_put_async(ce->engine);
 }
 
@@ -3952,7 +3996,8 @@ static void guc_virtual_context_unpin(struct intel_context *ce)
 	lrc_unpin(ce);
 
 	for_each_engine_masked(engine, ce->engine->gt, mask, tmp)
-		intel_engine_pm_put_async(engine);
+		if (intel_engine_pm_is_awake(engine))
+			intel_engine_pm_put_async(engine);
 }
 
 static void guc_virtual_context_enter(struct intel_context *ce)
@@ -4776,7 +4821,7 @@ int intel_guc_sched_disable_gucid_threshold_max(struct intel_guc *guc)
  * operation. This matches the 30fps game-render + encode (real world) workload this
  * knob was tested against.
  */
-#define SCHED_DISABLE_DELAY_MS	34
+#define SCHED_DISABLE_DELAY_MS	0
 
 /*
  * A threshold of 75% is a reasonable starting point considering that real world apps
@@ -5053,8 +5098,8 @@ int intel_guc_sched_done_process_msg(struct intel_guc *guc,
 	if (unlikely(context_destroyed(ce) ||
 		     (!context_pending_enable(ce) &&
 		     !context_pending_disable(ce)))) {
-		guc_err(guc, "Bad context sched_state 0x%x, ctx_id %u\n",
-			ce->guc_state.sched_state, ctx_id);
+		guc_log_context_sched_state(guc, ce, ctx_id,
+					    "Bad schedule-done context state");
 		return -EPROTO;
 	}
 
diff --git a/kconfig.mk b/kconfig.mk
index d4aa682536..9f16b640f5 100644
--- a/kconfig.mk
+++ b/kconfig.mk
@@ -14,6 +14,9 @@ KCONFIG=	DRM_AMDGPU_CIK \
 		DRM_I915_FORCE_PROBE='"*"' \
 		DRM_I915_REQUEST_TIMEOUT=20000 \
 		DRM_I915_CAPTURE_ERROR \
+		DRM_I915_DEBUG \
+		DRM_I915_DEBUG_MMIO \
+		DRM_I915_DEBUG_WAKEREF \
 		DRM_I915_USERFAULT_AUTOSUSPEND=250 \
 		DRM_I915_STOP_TIMEOUT=100 \
 		DRM_I915_PREEMPT_TIMEOUT=640 \

@JustAnotherHumanBeing

Copy link
Copy Markdown

Now, a couple of hours later, with the patch I posted above, I still haven't run into the GUC-related 0x6 bug. In my loader.conf, I now have the line hw.i915kms.disable_power_well=0 . Hopefully, this combination is the "cure" for the bug.

@JustAnotherHumanBeing

Copy link
Copy Markdown

Because I continued not experiencing any problems, I started testing the patch that is almost the same as the original one, except that it doesn't have the diagnostics/debugging features. Here it is:

--- drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c.orig	2026-06-23 18:59:54.781024000 -0400
+++ drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c	2026-06-23 19:29:58.894820000 -0400
@@ -2981,7 +2981,7 @@
 	unpin_guc_id(guc, ce);
 	lrc_unpin(ce);
 
-	if (likely(!intel_context_is_barrier(ce)))
+	if (likely(!intel_context_is_barrier(ce)) && intel_engine_pm_is_awake(ce->engine))
 		intel_engine_pm_put_async(ce->engine);
 }
 
@@ -3952,6 +3952,7 @@
 	lrc_unpin(ce);
 
 	for_each_engine_masked(engine, ce->engine->gt, mask, tmp)
+	    if (intel_engine_pm_is_awake(engine))		
 		intel_engine_pm_put_async(engine);
 }
 
@@ -4776,7 +4777,7 @@
  * operation. This matches the 30fps game-render + encode (real world) workload this
  * knob was tested against.
  */
-#define SCHED_DISABLE_DELAY_MS	34
+#define SCHED_DISABLE_DELAY_MS	0
 
 /*
  * A threshold of 75% is a reasonable starting point considering that real world apps

GPU hangs came back after I started testing it, though they were not the "0x6" GUC errors. This result seems to suggest that the diagnostics/debugging thing of the original patch prevented some type of race issue, even though it was strictly a diagnostics/debugging thing. I added hw.i915kms.enable_dc=0 to loader.conf (while the hw.i915kms.disable_power_well=0 thing was still there), and after I did that, I haven't yet experienced any GPU hangs. I just have to repeat now what I said earlier: I hope neither the GPU hangs nor the 0x6 GUC error will return.

@JustAnotherHumanBeing

Copy link
Copy Markdown

I’m incredibly puzzled now. Yet another GPU hang occurred, but as soon as I added a diagnostic log that would record what happens during such hangs from now on, the hangs simply stopped occurring! This is so strange; it’s as if the logging capability itself stopped the hangs from happening.

@JustAnotherHumanBeing

Copy link
Copy Markdown

I finally figured out the cause of this intermittent GPU hang problem. It was triggered by ZFS ARC pressure. The reliable reproducer on my machine was:

  1. boot to a bare tty with i915kms loaded
  2. transfer several large video files over LAN/SFTP
  3. stop the transfer
  4. start Plasma 6 Wayland

With the default auto-sized ARC, launching Plasma after that would reliably produce a GPU hang. After capping ARC with
vfs.zfs.arc.max=4294967296, the same LAN-transfer-then-Plasma test stopped hanging. So, slightly to my surprise, ZFS was the villain in this part of the story. :) This also explains why the bug looked random before: ordinary GPU stress tests could pass, and the machine could sometimes run for hours, but the bad condition was really “large file transfer filled ARC, then start a graphics workload”. However, this is separate from the 0x6 GuC bug. I tested that too: with stock drm-kmod and the ARC cap still in place, the Bad context sched_state 0x6 bug returned and made Plasma inaccessible again. Reapplying the SCHED_DISABLE_DELAY_MS 34 -> 0 patch made that issue go away again. Also, the drm_can_sleep() / curthread->td_pinned > 0 patch suggested earlier in #418 (comment) did not fix the 0x6 bug on my machine. The patch that actually fixed the 0x6 issue for me was the SCHED_DISABLE_DELAY_MS change from 34 to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i915 i915 related problems

Projects

None yet

Development

Successfully merging this pull request may close these issues.

i915: Unable to start Sway

8 participants