Skip to contentSkip to conversation

GPU hung with Linux-3.2-rc6

PATCH New Udo Steinberg 4 participants 13 messages Dec 21, 2011 – Jan 2, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

With Linux-3.2-rc6 I'm frequently seeing GPU hangs when large amounts of text scroll in an xterm, such as when extracting a tar archive. Such as this one (note the timestamps):

[22865.157750] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[22865.157763] [drm:kick_ring] *ERROR* Kicking stuck semaphore on render ring
[22871.165992] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[22871.166008] [drm:kick_ring] *ERROR* Kicking stuck semaphore on render ring
[22877.417902] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[22877.417915] [drm:kick_ring] *ERROR* Kicking stuck semaphore on render ring
[22883.426132] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[22883.426146] [drm:kick_ring] *ERROR* Kicking stuck semaphore on render ring

These hangs did not occur with Linux 3.1 or they were so infrequent that I didn't notice them. The machine is an x220 laptop with SNB CPU. The kernel command line contains:

i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1

Note that VT-d is enabled in the BIOS, but the kernel is compiled without IOMMU support. Because the IOMMU is not enabled, I'm inclined to think that this problem is not VT-d related.

Cheers,

- Udo

#1 lore raw
Quoted 5 lines · Udo Steinberg

Hi,

With Linux-3.2-rc6 I'm frequently seeing GPU hangs when large amounts of text scroll in an xterm, such as when extracting a tar archive. Such as this one (note the timestamps):

Can you try with semaphores disabled?

i915.semaphores=0

And, you should be able to remove the explicit rc6 argument now; if it will work, the kernel should turn it on automatically.

Signature · 1 line
[email protected]
#2 lore raw

On Wed, 21 Dec 2011 12:00:37 -0800 Keith Packard (KP) wrote:

KP> On Wed, 21 Dec 2011 19:54:10 +0100, Udo Steinberg <[email protected]> wrote:
KP> > Hi,
KP> >
KP> > With Linux-3.2-rc6 I'm frequently seeing GPU hangs when large amounts of KP> > text scroll in an xterm, such as when extracting a tar archive. Such as this KP> > one (note the timestamps):
KP>
KP> Can you try with semaphores disabled?
KP>
KP> i915.semaphores=0

That makes the problem go away. If you need more help tracking down the problem, then let me know. I can reproduce it fairly easily with something as simple as:

while true; do dmesg; done

KP> And, you should be able to remove the explicit rc6 argument now; if it KP> will work, the kernel should turn it on automatically.

Ok.

Cheers,

- Udo

#3 lore raw
Quoted 5 lines · Udo Steinberg

That makes the problem go away. If you need more help tracking down the problem, then let me know. I can reproduce it fairly easily with something as simple as:

while true; do dmesg; done

Are you using SNA?

Signature · 1 line
[email protected]
#4 lore raw

On Wed, 21 Dec 2011 14:55:07 -0800 Keith Packard (KP) wrote:

KP> On Wed, 21 Dec 2011 22:26:26 +0100, Udo Steinberg <[email protected]> wrote:
KP>
KP> > That makes the problem go away. If you need more help tracking down the KP> > problem, then let me know. I can reproduce it fairly easily with something KP> > as simple as:
KP> >
KP> > while true; do dmesg; done
KP>
KP> Are you using SNA?

I don't think so. I'm using the following packages:

xorg-server-1.9.5
xf86-video-intel-2.15.0
libdrm-2.4.25
mesa-7.10.2

I quick google search suggests that at least some of them are too old to support SNA.

Cheers,

- Udo

#5 lore raw
Quoted 14 lines · Udo Steinberg

On Wed, 21 Dec 2011 14:55:07 -0800 Keith Packard (KP) wrote:

KP> On Wed, 21 Dec 2011 22:26:26 +0100, Udo Steinberg <[email protected]> wrote:
KP>
KP> > That makes the problem go away. If you need more help tracking down the KP> > problem, then let me know. I can reproduce it fairly easily with something KP> > as simple as:
KP> >
KP> > while true; do dmesg; done
KP>
KP> Are you using SNA?

I don't think so. I'm using the following packages:

Quoted 7 lines

xorg-server-1.9.5
xf86-video-intel-2.15.0
libdrm-2.4.25
mesa-7.10.2

I quick google search suggests that at least some of them are too old to support SNA.

Can you please apply the patch available at

http://cgit.freedesktop.org/~danvet/drm/patch/?id=0b3ecfa8c9b00f50d514fbcc12e34882b0fa695a

This one will let your gpu keep hanging in the "stuck on semphore wait" condition. Later on the hangcheck should kick in and grab a gpu error state (in the file i915_error_state in debugfs). Can you please attach that one?

Thanks, Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#8 lore raw
In reply to Udo Steinberg
Quoted 2 lines · Udo Steinberg

I quick google search suggests that at least some of them are too old to support SNA.

Sounds good. If you can capture the error as Daniel suggests, that would be great. In any case, I'll post a revert of the semaphore enable patch as it looks like that's still not working right...

Signature · 1 line
[email protected]
#9 lore raw
Quoted 10 lines · Keith Packard
Quoted 2 lines · Udo Steinberg

I quick google search suggests that at least some of them are too old to support SNA.

Sounds good. If you can capture the error as Daniel suggests, that would be great. In any case, I'll post a revert of the semaphore enable patch as it looks like that's still not working right...

Could we revert it for SNB, and leave it enabled for IVB?

It would be just the chunk which checks for intel_iommu status in the patch.

Signature · 2 lines
Eugeni Dodonov
<http://eugeni.dodonov.net/>

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

PATCH 1/1 drm/i915: re-disable semaphores on sandy bridge

From: Eugeni Dodonov <[email protected]>

Per report from Udo Steinberg, enablement of semaphores causes issues on his Sandy Bridge. So disabling them again for this platform.

Note that they are still enabled by default for Ivy Bridge.

---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_execbuffer.c +2 -2
index c681dc1..d108ba2 100644
@@ -756,9 +756,9 @@ intel_enable_semaphores(struct drm_device *dev)
 	if (i915_semaphores >= 0)
 		return i915_semaphores;
 
-	/* Enable semaphores on SNB when IO remapping is off */
+	/* Semaphores are disabled on Sandy Bridge and earlier platforms for now */
 	if (INTEL_INFO(dev)->gen == 6)
-		return !intel_iommu_enabled;
+		return 0;
 
 	return 1;
 }
Signature · 1 line
1.7.8
#12 lore raw
In reply to Udo Steinberg

It would also be nice to know if disabling VT-d in the BIOS resolves this issue, or if building the kernel with IOMMU support and then forcibly disabling it with 'intel_iommu=off' fixes the problem. Given that you can easily reproduce this, it would be good to know how your machine differs from dozens of others which work fine with semaphores turned on...

Oh, and the output of 'lspci -nn -vv' would be nice to see in case you've got older (or newer) chips...

Signature · 1 line
[email protected]
#6 lore raw
In reply to Daniel Vetter

On Thu, 22 Dec 2011 09:22:33 +0100 Daniel Vetter (DV) wrote:

DV> Can you please apply the patch available at
DV>
DV> http://cgit.freedesktop.org/~danvet/drm/patch/?id=0b3ecfa8c9b00f50d514fbcc12e34882b0fa695a
DV>
DV> This one will let your gpu keep hanging in the "stuck on semphore wait"
DV> condition. Later on the hangcheck should kick in and grab a gpu error
DV> state (in the file i915_error_state in debugfs). Can you please attach
DV> that one?

Hi,

i915_error_state and dmesg are attached. This was with Linux 3.2.0-rc6 and the aforementioned patch applied.

Cheers,

- Udo

#7 lore raw
Quoted 11 lines · Udo Steinberg

On Thu, 22 Dec 2011 09:22:33 +0100 Daniel Vetter (DV) wrote:

DV> Can you please apply the patch available at
DV>
DV> http://cgit.freedesktop.org/~danvet/drm/patch/?id=0b3ecfa8c9b00f50d514fbcc12e34882b0fa695a
DV>
DV> This one will let your gpu keep hanging in the "stuck on semphore wait"
DV> condition. Later on the hangcheck should kick in and grab a gpu error
DV> state (in the file i915_error_state in debugfs). Can you please attach
DV> that one?

Quoted 4 lines

Hi,

i915_error_state and dmesg are attached. This was with Linux 3.2.0-rc6 and the aforementioned patch applied.

Thanks a lot for gathering the error state. It looks like the semaphore code deadlocked, which should not have happened. Can you please test with the my-next branch available at:

http://cgit.freedesktop.org/~danvet/drm/log/?h=my-next

It contains a few fixes for races (that might cause your issue) and dumps some additional information into the error state. You need to boot with i915.semaphores=1 because they're not enabled by default in that tree.

Again, please attach the error state if the gpu hangs.

Yours, Daniel

Signature · 2 lines
Daniel Vetter
[email protected] - +41 (0) 79 364 57 48 - http://blog.ffwll.ch