Bug 51061 - GPU Hang using VAAPI
Summary: GPU Hang using VAAPI
Status: RESOLVED NOTABUG
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: Chris Wilson
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-13 23:02 UTC by angela.schmid
Modified: 2012-08-08 08:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg, Xorg.log (49.58 KB, application/x-zip-compressed)
2012-06-13 23:02 UTC, angela.schmid
no flags Details

Description angela.schmid 2012-06-13 23:02:57 UTC
Created attachment 63007 [details]
dmesg, Xorg.log

The GPU hangs when playing a MythTV recording. For 0.05 sec I hear sound but no display. This problem is reproducable.
Using the normal MythTV display driver plays upto 720p fine, but 1080i content is not smooth, therefor trying VAAPI.

Using Sandybridge 2600K over HDMI to a 1080i television. Using mythtv git 0.25-fixes with a dedicated X Server, no Desktop, on Ubuntu Server 12.04 LTS.
Git kernel (>3.5-rc2), updated xorg-edgers.

Immediately after:
# cat /sys/kernel/debug/dri/0/i915_error_state
no error state collected

See attachments.

Below error is with a 720p recording, which behaves and looks different

cat  /sys/kernel/debug/dri/0/i915_error_state, blocks

Jun 13 17:35:39 minerva11 kernel: [68682.433743] [drm:i915_driver_open],
Jun 13 17:35:39 minerva11 kernel: [68682.691256] [drm:i915_driver_open],
Jun 13 17:35:39 minerva11 kernel: [68682.860834] [drm:i915_driver_open],
Jun 13 17:35:40 minerva11 kernel: [68683.185483] [drm:drm_mode_addfb], [FB:27]
Jun 13 17:35:46 minerva11 kernel: [68689.196485] [drm:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung
Jun 13 17:35:46 minerva11 kernel: [68689.196946] [drm] capturing error event; look for more information in /debug/dri/0/i915_error_state
Jun 13 17:35:46 minerva11 kernel: [68689.199780] [drm:i915_error_work_func], resetting chip
Jun 13 17:35:46 minerva11 kernel: [68689.199843] [drm:drm_crtc_helper_set_config],
Jun 13 17:35:46 minerva11 kernel: [68689.199845] [drm:drm_crtc_helper_set_config], [CRTC:3] [NOFB]
Jun 13 17:35:46 minerva11 kernel: [68689.199867] [drm:ironlake_crtc_dpms], crtc 0/0 dpms off
Jun 13 17:35:46 minerva11 kernel: [68689.199869] [drm:i915_get_vblank_timestamp], crtc 0 is disabled
Jun 13 17:35:46 minerva11 kernel: [68689.205723] [drm:intel_prepare_page_flip], preparing flip with no unpin work?
Jun 13 17:35:46 minerva11 udevd[19509]: failed to execute '/usr/share/apport/apport-gpu-error-intel.py' '/usr/share/apport/apport-gpu-error-intel.py': No such file or directory
Jun 13 17:36:46  dhclient: last message repeated 4 times
Jun 13 17:36:46 minerva11 kernel: [68689.252474] [drm:intel_disable_pch_pll], disable PCH PLL c6014 (active 1, on? 1) for crtc 3
Jun 13 17:36:46 minerva11 kernel: [68689.252476] [drm:intel_disable_pch_pll], disabling PCH PLL c6014
Jun 13 17:36:46 minerva11 kernel: [68689.252882] [drm:intel_update_fbc],
Jun 13 17:36:46 minerva11 kernel: [68689.252906] ------------[ cut here ]------------
Jun 13 17:36:46 minerva11 kernel: [68689.253355] kernel BUG at drivers/gpu/drm/i915/i915_gem.c:3084!
Jun 13 17:36:46 minerva11 kernel: [68689.253795] invalid opcode: 0000 [#1] SMP
Jun 13 17:36:46 minerva11 kernel: [68689.254227] CPU 3
Jun 13 17:36:46 minerva11 kernel: [68689.254672] Modules linked in: des_generic md4 nls_utf8 cifs xts gf128mul autofs4 dm_crypt binfmt_misc ipt_MASQUERADE xt_conntrack snd_hda_codec_hdmi snd_hda_codec_realtek iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 iptable_filter ip_tables x_tables tda18271c2dd(O) snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event drxk(O) snd_seq arc4 ath9k mac80211 ath9k_common ath9k_hw eeepc_wmi ddbridge(O) snd_timer snd_seq_device dvb_core(O) asus_wmi cxd2099(O) coretemp hid_generic ath btusb snd mei bluetooth psmouse serio_raw lpc_ich sparse_keymap soundcore cfg80211 snd_page_alloc microcode lp parport usbhid hid usb_storage uas 8139too mxm_wmi 8139cp ghash_clmulni_intel aesni_intel cryptd firewire_ohci aes_x86_64 firewire_core crc_itu_t i915 drm_kms_helper drm ahci e1000e libahci i2c_algo_bit xhci_hcd video wmi [last unloaded: kvm]
Jun 13 17:36:46 minerva11 kernel: [68689.256832]
Jun 13 17:36:46 miJun 13 17:44:59 minerva11 kernel: imklog 5.8.6, log source = /proc/kmsg started.

Again with 1080i, I also noticed the stacktrace is not always the same, however ends always at the same point (intel_unpin_fb_obj):

Jun 13 18:13:36 minerva11 kernel: [ 1737.267614] ------------[ cut here ]------------
Jun 13 18:13:36 minerva11 kernel: [ 1737.267630] kernel BUG at drivers/gpu/drm/i915/i915_gem.c:3084!
Jun 13 18:13:36 minerva11 kernel: [ 1737.267646] invalid opcode: 0000 [#1] SMP
Jun 13 18:13:36 minerva11 kernel: [ 1737.267657] CPU 2
Jun 13 18:13:36 minerva11 kernel: [ 1737.267683] Modules linked in: xts gf128mul autofs4 binfmt_misc dm_crypt btusb ipt_MASQUERADE xt_conntrack iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack nf_defrag_ipv4 iptable_filter ip_tables x_tables snd_hda_codec_hdmi snd_hda_codec_realtek tda18271c2dd(O) arc4 ath9k mac80211 snd_hda_intel ath9k_common snd_hda_codec snd_hwdep snd_pcm snd_seq_midi ath9k_hw snd_rawmidi snd_seq_midi_event drxk(O) snd_seq psmouse eeepc_wmi asus_wmi ddbridge(O) ath sparse_keymap serio_raw dvb_core(O) cxd2099(O) coretemp hid_generic snd_timer snd_seq_device ath3k mei lpc_ich snd bluetooth soundcore snd_page_alloc microcode cfg80211 lp parport usbhid hid usb_storage uas firewire_ohci firewire_core crc_itu_t 8139too 8139cp ghash_clmulni_intel xhci_hcd aesni_intel cryptd aes_x86_64 i915 mxm_wmi drm_kms_helper drm ahci libahci i2c_algo_bit e1000e video wmi [last unloaded: kvm]
Jun 13 18:13:36 minerva11 kernel: [ 1737.267849]
Jun 13 18:13:36 minerva11 kernel: [ 1737.267856] Pid: 4612, comm: Xorg Tainted: G        W  O 3.5.0-rc2-mine5+ #1 System manufacturer System Product Name/P8Z68-V PRO
Jun 13 18:13:36 minerva11 kernel: [ 1737.267891] RIP: 0010:[<ffffffffa00f4aff>]  [<ffffffffa00f4aff>] i915_gem_object_unpin+0x4f/0x60 [i915]
Jun 13 18:13:36 minerva11 kernel: [ 1737.267913] RSP: 0018:ffff8801d2b9fb48  EFLAGS: 00010246
Jun 13 18:13:36 minerva11 kernel: [ 1737.267926] RAX: ffff88020edb4000 RBX: ffff880213d3b000 RCX: 0000000000000000
Jun 13 18:13:36 minerva11 kernel: [ 1737.267942] RDX: 0000000003020402 RSI: 0000000000070008 RDI: ffff88021147f000
Jun 13 18:13:36 minerva11 kernel: [ 1737.267959] RBP: ffff8801d2b9fb48 R08: 000000000000000a R09: 0000000000000000
Jun 13 18:13:36 minerva11 kernel: [ 1737.267976] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880214139820
Jun 13 18:13:36 minerva11 kernel: [ 1737.267992] R13: ffff88020edb4000 R14: ffff880214139800 R15: ffff8801d2b9fc98
Jun 13 18:13:36 minerva11 kernel: [ 1737.268009] FS:  00007fd0bc238880(0000) GS:ffff88021f280000(0000) knlGS:0000000000000000
Jun 13 18:13:36 minerva11 kernel: [ 1737.268028] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
Jun 13 18:13:36 minerva11 kernel: [ 1737.268052] CR2: 00007f2ce2f453d0 CR3: 00000002128a6000 CR4: 00000000000407e0
Jun 13 18:13:36 minerva11 kernel: [ 1737.268069] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
Jun 13 18:13:36 minerva11 kernel: [ 1737.268096] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Jun 13 18:13:36 minerva11 kernel: [ 1737.268113] Process Xorg (pid: 4612, threadinfo ffff8801d2b9e000, task ffff8801d2addbc0)
Jun 13 18:13:36 minerva11 kernel: [ 1737.268131] Stack:
Jun 13 18:13:36 minerva11 kernel: [ 1737.268138]  ffff8801d2b9fb58 ffffffffa010567c ffff8801d2b9fb88 ffffffffa0108abc
Jun 13 18:13:36 minerva11 kernel: [ 1737.268156]  ffff880214139c38 ffff880213d3b000 ffffffffa01474c0 ffff880214139c68
Jun 13 18:13:36 minerva11 kernel: [ 1737.268173]  ffff8801d2b9fbb8 ffffffffa00d56a5 ffff8801d2b9ffd8 ffff880213d3b000
Jun 13 18:13:36 minerva11 kernel: [ 1737.268190] Call Trace:
Jun 13 18:13:36 minerva11 kernel: [ 1737.268204]  [<ffffffffa010567c>] intel_unpin_fb_obj+0x3c/0x40 [i915]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268224]  [<ffffffffa0108abc>] intel_crtc_disable+0x8c/0xb0 [i915]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268243]  [<ffffffffa00d56a5>] drm_helper_disable_unused_functions+0x115/0x190 [drm_kms_helper]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268266]  [<ffffffffa00d70ce>] drm_crtc_helper_set_config+0xa5e/0xaf0 [drm_kms_helper]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268288]  [<ffffffff8111d095>] ? __generic_file_aio_write+0x235/0x440
Jun 13 18:13:36 minerva11 kernel: [ 1737.268308]  [<ffffffffa010567c>] ? intel_unpin_fb_obj+0x3c/0x40 [i915]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268331]  [<ffffffffa006d35e>] drm_framebuffer_cleanup+0xfe/0x180 [drm]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268352]  [<ffffffffa01024b1>] intel_user_framebuffer_destroy+0x21/0x80 [i915]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268374]  [<ffffffffa0070d4b>] drm_mode_rmfb+0xfb/0x100 [drm]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268393]  [<ffffffffa00604cc>] drm_ioctl+0x47c/0x540 [drm]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268408]  [<ffffffff81063f37>] ? __set_task_blocked+0x37/0x80
Jun 13 18:13:36 minerva11 kernel: [ 1737.268427]  [<ffffffffa0070c50>] ? drm_mode_addfb2+0x690/0x690 [drm]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268444]  [<ffffffff81179912>] ? do_sync_write+0xd2/0x110
Jun 13 18:13:36 minerva11 kernel: [ 1737.268458]  [<ffffffff811b8202>] ? fsnotify+0x1d2/0x2b0
Jun 13 18:13:36 minerva11 kernel: [ 1737.268472]  [<ffffffff8118b988>] do_vfs_ioctl+0x98/0x550
Jun 13 18:13:36 minerva11 kernel: [ 1737.268486]  [<ffffffff8118bed1>] sys_ioctl+0x91/0xa0
Jun 13 18:13:36 minerva11 kernel: [ 1737.268500]  [<ffffffff8162e2e9>] system_call_fastpath+0x16/0x1b
Jun 13 18:13:36 minerva11 kernel: [ 1737.268527] Code: e2 ff 1f fe ff c1 e8 0d 83 c0 0f 83 e0 0f 89 c1 83 e1 0f c1 e1 0d 09 ca 84 c0 89 97 f0 00 00 00 75 07 80 a7 f2 00 00 00 f7 5d c3 <0f> 0b 0f 0b 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5
Jun 13 18:13:36 minerva11 kernel: [ 1737.268573] RIP  [<ffffffffa00f4aff>] i915_gem_object_unpin+0x4f/0x60 [i915]
Jun 13 18:13:36 minerva11 kernel: [ 1737.268590]  RSP <ffff8801d2b9fb48>
Comment 1 Chris Wilson 2012-06-14 00:30:02 UTC
Install the drm-intel-experimental from the mainline kernel ppa and regrab the error state.
Comment 2 angela.schmid 2012-06-16 01:49:45 UTC
Upgraded xorg-edgers.

No console output and no login after booting with http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-experimental/current/linux-extra-3.4.0-994-generic_3.4.0-994.201206150421_amd64.deb
In recovery mode keyboard did not work.

Added http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-experimental/current/linux-image-extra-3.4.0-994-generic_3.4.0-994.201206150421_amd64.deb
Could boot, but got many 
BUG: Soft lockup - CPU#x stuck for 22s!
and after 2 minutes a complete lockup.

What is in "extra" ?
Is there an intel git which I can merge into my git head (>3.5-rc2) kernel ? Or does it not make any sense because you are still based on 3.4 ?
Comment 3 angela.schmid 2012-06-17 22:26:25 UTC
> Subject: [Bug 51061] GPU Hang using VAAPI
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=51061
> 
> Chris Wilson <chris@chris-wilson.co.uk> changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>              Status|NEW                         |NEEDINFO
> 
> --- Comment #1 from Chris Wilson <chris@chris-wilson.co.uk> 2012-06-14
> 00:30:02 PDT --- Install the drm-intel-experimental from the mainline kernel
> ppa and regrab the error state.

Upgraded xorg-edgers.

No console output and no login after booting with
http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-experimental/current/linux-extra-3.4.0-994-generic_3.4.0-994.201206150421_amd64.deb
In recovery mode keyboard did not work.

Added
http://kernel.ubuntu.com/~kernel-ppa/mainline/drm-intel-experimental/current/linux-image-extra-3.4.0-994-generic_3.4.0-994.201206150421_amd64.deb
Could boot, but got many 
BUG: Soft lockup - CPU#x stuck for 22s!
and after 2 minutes a complete lockup.

What is in "extra" ?
Is there an intel git which I can merge into my git head (>3.5-rc2) kernel ? Or
does it not make any sense because you are still based on 3.4 ?

Angela
Comment 4 haihao 2012-06-25 23:12:01 UTC
I tried to reproduce this issue on my Sandybridge but failed to run MythTV  although I built fixes/0.25 branch successfully. Can you try other player, such as mplayer-vaapi ? 

You can fetch mplayer-vaapi via

$> git clone git://gitorious.org/vaapi/mplayer.git -b hwaccel-vaapi

Run mplayer with vaapi

$> ./mplayer -vo vaapi <file>
Comment 5 angela.schmid 2012-06-26 14:33:40 UTC
> PDT --- I tried to reproduce this issue on my Sandybridge but failed to run
> MythTV although I built fixes/0.25 branch successfully. Can you try other
> player, such as mplayer-vaapi ?
> 
> You can fetch mplayer-vaapi via
> 
> $> git clone git://gitorious.org/vaapi/mplayer.git -b hwaccel-vaapi
> 
> Run mplayer with vaapi
> 
> $> ./mplayer -vo vaapi <file>

Hello Haihoa

Playing with mplayer worked. Played the same recording over 20 times. After a random time (10sec - 15min) the picture started shaking.

As mplayer uses a newer ffmpeg as mythtv. Compiling the same checkout version in mythtv failed.

What I noticed with mplayer using -vo x11 (xv and xvmc didn't work), 10% of the tries the picture was OK and started shaking after a while too. 90% of the tries it shaked from the beginning. Not sure if it is similar as the "normal" display settings within mythtv, were I see the same behavior.

I PM a link for the recording, 6GB, 1hrs, maybe you don't need all. Maybe you notice something in the recordings, as all recordings show the same behavior. Would be great to hear your experience.

At the weekend I will install an NVidia Card (GT 9600) and check the behavior with vdpau.

Angela
Comment 6 haihao 2012-06-27 23:43:49 UTC
I can't reproduce the shaking issue on my machine.
Comment 7 angela.schmid 2012-08-08 08:45:58 UTC
I moved to NVidia GT9600, where also shaking existed. As the content is 1080i and my television is 1080i I had always deinterlacing disabled. When activating deinterlacing in Mythtv the problem vanished. I have not checked if enabling deinterlacing solves the issue on Intel GPU.

The problem of the hanging GPU when using VAAPI has only be noticed with Mythtv as it uses an older revision of ffmpeg. Mplayer with VAAPI works (did not further investigate resolving the shaking when enabling deinterlacing).

Thanks for helping me narrowing the problem down and hope to return to Intel/VAAPI as soon as Mythtv has updated ffmpeg.

Angela


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.