Bug 44554

Summary: GPU Hang on SNB when attempting vaapi deinterlace with vaCopySurfaceGLX
Product: libva Reporter: elupus
Component: intelAssignee: haihao <haihao.xiang>
Status: RESOLVED WORKSFORME QA Contact:
Severity: major    
Priority: medium CC: gb.devel, seanvk, v.simankin
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: dmesg dump after hang
dmesg

Description elupus 2012-01-07 05:08:46 UTC
Created attachment 55262 [details]
dmesg dump after hang

When trying to deinterlace video on a SandyBridge using vaapi, GPU hangs, screen goes black and then returns.

To reproduce:
git clone git://gitorious.org/hwdecode-demos/hwdecode-demos.git
cd hwdecode-demos.git
./autogen.sh
make
./src/vaapi_mpeg2 --glx --vaapi-glx-use-copy --vaapi-putsurface-flags top-field

After this ALL GLX is broken.

Following is logged in dmesg:
[  344.188234] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[  344.188246] [drm] capturing error event; look for more information in /debug/dri/0/i915_error_state
[  344.197296] [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 (awaiting 64294 at 64284, next 64297)


cat /sys/kernel/debug/dri/0/i915_error_state yields:
cat: /sys/kernel/debug/dri/0/i915_error_state: Cannot allocate memory

After which following is logged in dmesg:

[  633.350886] ------------[ cut here ]------------
[  633.350895] WARNING: at /build/buildd/linux-3.0.0/mm/page_alloc.c:2106 __alloc_pages_nodemask+0x20d/0x820()
[  633.350897] Hardware name:         
[  633.350898] Modules linked in: des_generic md4 nls_utf8 cifs bnep rfcomm bluetooth parport_pc ppdev binfmt_misc snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device snd psmouse serio_raw i915 soundcore snd_page_alloc mei(C) drm_kms_helper drm i2c_algo_bit video lp parport usbhid hid usb_storage uas ahci libahci e1000e xhci_hcd
[  633.350936] Pid: 6055, comm: cat Tainted: G         C  3.0.0-14-generic #23-Ubuntu
[  633.350938] Call Trace:
[  633.350944]  [<ffffffff8105e7ef>] warn_slowpath_common+0x7f/0xc0
[  633.350947]  [<ffffffff8105e84a>] warn_slowpath_null+0x1a/0x20
[  633.350951]  [<ffffffff811134fd>] __alloc_pages_nodemask+0x20d/0x820
[  633.350958]  [<ffffffff81149913>] alloc_pages_current+0xa3/0x110
[  633.350961]  [<ffffffff8110edae>] __get_free_pages+0xe/0x50
[  633.350965]  [<ffffffff8115443f>] kmalloc_order_trace+0x3f/0xd0
[  633.350968]  [<ffffffff81154650>] __kmalloc+0x180/0x190
[  633.350972]  [<ffffffff81116256>] ? put_page+0x36/0x40
[  633.350976]  [<ffffffff8118a3ad>] seq_read+0x17d/0x3d0
[  633.350981]  [<ffffffff81168270>] vfs_read+0xb0/0x180
[  633.350984]  [<ffffffff8116838a>] sys_read+0x4a/0x90
[  633.350989]  [<ffffffff815f36c2>] system_call_fastpath+0x16/0x1b
[  633.350992] ---[ end trace 65505e0a88ce7f86 ]---
Comment 1 elupus 2012-01-07 05:14:08 UTC
Forgot to mention. This is with:
xorg-edgers on oneric system

xserver-xorg-video-intel: 2:2.17.0+git20120103.777fcc9b-0ubuntu0sarvatt~oneiric
libgl1-mesa-glx: 7.12.0~git20111222.7fd8dc3a-0ubuntu0sarvatt2~oneiric 
libva: eec97214509d2bce77bf9622157505a3b68bc74a
intel-driver: 296653a55206f9394a161f7d7ed59835e1866382
Comment 2 elupus 2012-01-08 15:00:59 UTC
vaapi-ext branch doesn't crash. but currently we only get white screen in xbmc. hwdecode demo seems to give something.
Comment 3 elupus 2012-01-08 15:07:56 UTC
Minor bug fix in xbmc for unused code path and now deinterlacing is working with vaapi-ext branch. Still original api not the new one.
Comment 4 Gwenole Beauchesne 2012-03-13 03:44:37 UTC
Hi, please try the following patch instead, which is the correct way to display either field of a surface: http://lists.freedesktop.org/archives/libva/2012-March/000795.html

This will be pushed to master around tomorrow.
Comment 5 Victor 2012-09-26 06:39:53 UTC
Same problems
x86_64, xf86-video-intel 2.20.8, xorg-server 1.12.4, mesa 8.0.4, libdrm 2.4.39, libva-intel-driver 1.0.18, libva 1.0.16
Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
	Subsystem: Samsung Electronics Co Ltd Device c0d1
	Kernel driver in use: i915

$ vlc
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
...
libva: VA-API version 0.32.1
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib64/va/drivers/i965_drv_video.so

# tail -50 /var/log/Xorg.0.log
[   502.229] [mi] EQ overflow continuing.  400 events have been dropped.
[   502.229] 
[   502.229] Backtrace:
[   502.229] 0: /usr/bin/X (xorg_backtrace+0x36) [0x56eab6]
[   502.229] 1: /usr/bin/X (0x400000+0x4b5de) [0x44b5de]
[   502.229] 2: /usr/lib64/xorg/modules/input/evdev_drv.so (0x7f2d41b56000+0x6141) [0x7f2d41b5c141]
[   502.229] 3: /usr/bin/X (0x400000+0x73727) [0x473727]
[   502.229] 4: /usr/bin/X (0x400000+0x990dd) [0x4990dd]
[   502.229] 5: /lib64/libpthread.so.0 (0x36b8800000+0xfa90) [0x36b880fa90]
[   502.229] 6: /lib64/libc.so.6 (ioctl+0x7) [0x36b7ce1e17]
[   502.229] 7: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x32cec03ac8]
[   502.229] 8: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x1ec82) [0x7f2d426dcc82]
[   502.229] 9: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x55ca5) [0x7f2d42713ca5]
[   502.229] 10: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x2bb7b) [0x7f2d426e9b7b]
[   502.229] 11: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x582c8) [0x7f2d427162c8]
[   502.229] 12: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x58b8c) [0x7f2d42716b8c]
[   502.229] 13: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0xa853b) [0x7f2d4276653b]
[   502.229] 14: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0xad1ca) [0x7f2d4276b1ca]
[   502.229] 15: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x45694) [0x7f2d42703694]
[   502.229] 16: /usr/bin/X (0x400000+0xfb2a3) [0x4fb2a3]
[   502.229] 17: /usr/bin/X (0x400000+0xf14b9) [0x4f14b9]
[   502.229] 18: /usr/bin/X (0x400000+0x37141) [0x437141]
[   502.229] 19: /usr/bin/X (0x400000+0x25e8a) [0x425e8a]
[   502.229] 20: /lib64/libc.so.6 (__libc_start_main+0xfd) [0x36b7c2246d]
[   502.229] 21: /usr/bin/X (0x400000+0x25a29) [0x425a29]
[   502.229] 
[   502.847] [mi] Increasing EQ size to 512 to prevent dropped events.
[   502.847] [mi] EQ processing has resumed after 471 dropped events.
[   502.847] [mi] This may be caused my a misbehaving driver monopolizing the server's resources.
[   502.848] (EE) intel(0): Detected a hung GPU, disabling acceleration.
[   502.848] (EE) intel(0): When reporting this, please include i915_error_state from debugfs and the full dmesg.

# cat /sys/kernel/debug/dri/0/i915_error_state 
cat: /sys/kernel/debug/dri/0/i915_error_state: Cannot allocate memory
Comment 6 Victor 2012-09-26 06:41:22 UTC
Created attachment 67706 [details]
dmesg
Comment 7 Victor 2012-09-26 06:45:02 UTC
Same problems
x86_64, xf86-video-intel 2.20.8, xorg-server 1.12.4, mesa 8.0.4, libdrm 2.4.39, libva-intel-driver 1.0.18, libva 1.0.16
Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
	Subsystem: Samsung Electronics Co Ltd Device c0d1
	Kernel driver in use: i915

$ vlc
VLC media player 2.0.3 Twoflower (revision 2.0.2-93-g77aa89e)
...
libva: VA-API version 0.32.1
libva: va_getDriverName() returns 0
libva: Trying to open /usr/lib64/va/drivers/i965_drv_video.so

# tail -50 /var/log/Xorg.0.log
[   502.229] [mi] EQ overflow continuing.  400 events have been dropped.
[   502.229] 
[   502.229] Backtrace:
[   502.229] 0: /usr/bin/X (xorg_backtrace+0x36) [0x56eab6]
[   502.229] 1: /usr/bin/X (0x400000+0x4b5de) [0x44b5de]
[   502.229] 2: /usr/lib64/xorg/modules/input/evdev_drv.so (0x7f2d41b56000+0x6141) [0x7f2d41b5c141]
[   502.229] 3: /usr/bin/X (0x400000+0x73727) [0x473727]
[   502.229] 4: /usr/bin/X (0x400000+0x990dd) [0x4990dd]
[   502.229] 5: /lib64/libpthread.so.0 (0x36b8800000+0xfa90) [0x36b880fa90]
[   502.229] 6: /lib64/libc.so.6 (ioctl+0x7) [0x36b7ce1e17]
[   502.229] 7: /usr/lib64/libdrm.so.2 (drmIoctl+0x28) [0x32cec03ac8]
[   502.229] 8: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x1ec82) [0x7f2d426dcc82]
[   502.229] 9: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x55ca5) [0x7f2d42713ca5]
[   502.229] 10: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x2bb7b) [0x7f2d426e9b7b]
[   502.229] 11: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x582c8) [0x7f2d427162c8]
[   502.229] 12: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x58b8c) [0x7f2d42716b8c]
[   502.229] 13: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0xa853b) [0x7f2d4276653b]
[   502.229] 14: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0xad1ca) [0x7f2d4276b1ca]
[   502.229] 15: /usr/lib64/xorg/modules/drivers/intel_drv.so (0x7f2d426be000+0x45694) [0x7f2d42703694]
[   502.229] 16: /usr/bin/X (0x400000+0xfb2a3) [0x4fb2a3]
[   502.229] 17: /usr/bin/X (0x400000+0xf14b9) [0x4f14b9]
[   502.229] 18: /usr/bin/X (0x400000+0x37141) [0x437141]
[   502.229] 19: /usr/bin/X (0x400000+0x25e8a) [0x425e8a]
[   502.229] 20: /lib64/libc.so.6 (__libc_start_main+0xfd) [0x36b7c2246d]
[   502.229] 21: /usr/bin/X (0x400000+0x25a29) [0x425a29]
[   502.229] 
[   502.847] [mi] Increasing EQ size to 512 to prevent dropped events.
[   502.847] [mi] EQ processing has resumed after 471 dropped events.
[   502.847] [mi] This may be caused my a misbehaving driver monopolizing the server's resources.
[   502.848] (EE) intel(0): Detected a hung GPU, disabling acceleration.
[   502.848] (EE) intel(0): When reporting this, please include i915_error_state from debugfs and the full dmesg.

# cat /sys/kernel/debug/dri/0/i915_error_state 
cat: /sys/kernel/debug/dri/0/i915_error_state: Cannot allocate memory
Comment 8 ykzhao 2013-11-29 02:41:58 UTC
Will you please try the latest intel-vaapi driver and see whether the issue still exists?
Comment 9 haihao 2015-11-18 07:58:14 UTC
No response from user for a long time so closing as WORKSFORME, Feel free to reopen this bug if you still experience the issue

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.