You are not logged in.

#1 2017-10-08 10:20:07

adesh
Member
Registered: 2016-10-05
Posts: 167

GPU hang when switching video fullscreen

I use mpv with libva-intel-driver-g45-h264 (AUR) to watch videos. Today, I updated my system after a month and now video freezes if I go fullscreen. I get the following error on terminal:

intel_do_flush_locked failed: Input/output errord: 47

I tried downgrading a few packages like mpv, ffmpeg, sdl2, xorg-server and xorg-server-common, but that didn't help. I also installed/uninstalled xf86-video-intel with sna/uxa settings, rebooted computer several times, nothing worked.

GPU hang occurs only when I try to use hardware acceleration for fullscreen video playback im mpv. Non-fullscreen video works without issues. Any idea how this issue can be solved?

Graphics Information:

$ sudo lspci -v -v -s $(lspci | grep ' VGA ' | cut -d" " -f 1)
[sudo] password for addy: 
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07) (prog-if 00 [VGA controller])
	Subsystem: Hewlett-Packard Company Mobile 4 Series Chipset Integrated Graphics Controller
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at 90000000 (64-bit, non-prefetchable) [size=4M]
	Region 2: Memory at 80000000 (64-bit, prefetchable) [size=256M]
	Region 4: I/O ports at 60f0 [size=8]
	[virtual] Expansion ROM at 000c0000 [disabled] [size=128K]
	Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
		Address: 00000000  Data: 0000
	Capabilities: [d0] Power Management version 3
		Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
	Kernel driver in use: i915
	Kernel modules: i915

Xorg.log, dmesg

Last edited by adesh (2017-10-08 11:24:30)

Offline

#2 2017-10-08 10:41:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: GPU hang when switching video fullscreen

https://bbs.archlinux.org/viewtopic.php?id=230115 ? Although your dmesg does contain mention that IOMMU is being disabled for the chipset, it might still be involved in some way.

Offline

#3 2017-10-08 11:51:39

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

I tried "intel_iommu=off" in kernel parameters, didn't help!

$ cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-linux root=UUID=cb83cc0b-67e0-4cb9-8650-bb9b03ea292a rw quiet nowatchdog intel_iommu=off

Offline

#4 2017-10-08 14:20:59

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: GPU hang when switching video fullscreen

Ruling out the obvious: Did you rebuild ibva-intel-driver-g45-h264 after the system upgrade?

Offline

#5 2017-10-08 14:44:56

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

Yes, I remember installing it with pacaur, but just to be sure I uninstalled it just now, rebuilt after deleting cache, but the issue remains.
Meanwhile, I also tried vlc to rule out media player specific issue. VLC hangs up immediately before going fullscreen.

Offline

#6 2017-10-08 14:56:22

seth
Member
Registered: 2012-09-03
Posts: 49,981

Offline

#7 2017-10-09 05:41:06

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

Yes, intel-ucode is installed from a long time and enabled in GRUB.

$ dmesg | grep micro
[    0.000000] microcode: microcode updated early to revision 0xa4, date = 2010-10-02
[    1.732216] microcode: sig=0x6fd, pf=0x80, revision=0xa4
[    1.732270] microcode: Microcode Update Driver: v2.2.
$

Offline

#8 2017-10-09 07:07:19

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: GPU hang when switching video fullscreen

Just wondered because the revision is from 2010 (as is your BIOS, so...)

Tried the lts kernel?

Offline

#9 2017-10-09 10:00:14

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

Yes, this machine is 10 years old. Manufacturer doesn't provide updates anymore.

Tried LTS kernel, rebuild libva driver - the same. Enabling/disabling xfwm compositor also didn't make any difference.

Offline

#10 2017-10-09 13:38:33

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: GPU hang when switching video fullscreen

pass "i915.error_capture=true i915.semaphores=1" to the kernel, this should get you an error dump in /sys/class/drm/card<N>/error where you can dump it and the semaphores *might* actually work around this.

Did you also try the lts kernel against xf86-video-intel (in case this has been your "good" setup before)

Offline

#11 2017-10-09 14:03:38

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

The dump is actually empty and GPU still hangs.

[  576.081062] [drm] GPU crash dump saved to /sys/class/drm/card0/error
$ ls -l /sys/class/drm/card0/error 
-rw------- 1 root root 0 Oct  9 19:24 /sys/class/drm/card0/error

I installed xf86-video-intel. It didn't fix the GPU crash, but now thumbnails on quickdial are correctly generated in my browser smile I'll keep it!

Offline

#12 2017-10-09 14:22:18

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: GPU hang when switching video fullscreen

Desperate last call: "i915.enable_rc6=0 i915.enable_dc=0"

Edit: whatever you test - as long as you test on 4.13, use "intel_iommu=off" to prevent it from tainting the results.

Last edited by seth (2017-10-09 14:23:28)

Offline

#13 2017-10-09 16:19:53

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

Nope!

I think I'll have to use Arch Time Machine to go back in time and see when the problem first appeared.

Offline

#14 2017-10-10 16:28:23

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

So, it's mesa. On 10th Sep, mesa was upgraded from 17.1.8-2 to 17.2.0-2 which breaks video functionality.
Video works perfectly on 9th Sep, and breaks on 10th; keeping my system on 10th and downgrading mesa fixes the video problem. This is the excerpt from pacman.log for the "faulty" upgrade:

[2017-10-10 20:49] [PACMAN] Running 'pacman -Syyuu'
[2017-10-10 20:49] [PACMAN] synchronizing package lists
[2017-10-10 20:49] [PACMAN] starting full system upgrade
[2017-10-10 20:49] [ALPM] transaction started
[2017-10-10 20:49] [ALPM] upgraded coreutils (8.27-1 -> 8.28-1)
[2017-10-10 20:49] [ALPM] upgraded harfbuzz (1.5.0-1 -> 1.5.1-1)
[2017-10-10 20:49] [ALPM] upgraded fontconfig (2.12.4-1 -> 2.12.5-1)
[2017-10-10 20:49] [ALPM-SCRIPTLET] Rebuilding fontconfig cache... done.
[2017-10-10 20:49] [ALPM] upgraded gtk-update-icon-cache (3.22.19-2 -> 3.22.20-1)
[2017-10-10 20:49] [ALPM] warning: /etc/drirc installed as /etc/drirc.pacnew
[2017-10-10 20:49] [ALPM] upgraded mesa (17.1.8-2 -> 17.2.0-2)
[2017-10-10 20:49] [ALPM] upgraded gtk3 (3.22.19-2 -> 3.22.20-1)
[2017-10-10 20:49] [ALPM] upgraded libinput (1.8.1-1 -> 1.8.2-1)
[2017-10-10 20:50] [ALPM] upgraded linux (4.12.10-1 -> 4.12.12-1)
[2017-10-10 20:50] [ALPM-SCRIPTLET] >>> Updating module dependencies. Please wait ...
[2017-10-10 20:50] [ALPM] transaction completed
[2017-10-10 20:50] [ALPM] running '90-linux.hook'...

So, how do I go about this? Should I keep mesa at the "good" version and update rest of the system? But then this partial upgrade may cause other surprises. Any recommendations?

Last edited by adesh (2017-10-10 16:28:41)

Offline

#15 2017-10-31 12:01:58

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

So, I took the plunge and decided to bisect. This commit seems to be the culprit.

$ git bisect start 
$ git bisect good mesa-17.1.8 
$ git bisect bad mesa-17.2.0
Bisecting: a merge base must be tested
[7748c3f5eb1d98ca97d2cf6e516ff54a5d75130a] configure.ac: deprecate --with-egl-platforms over --with-platforms
$ git bisect good 
Bisecting: 1684 revisions left to test after this (roughly 11 steps)
[a625d58ee19cd9f88af2ee76de604420c39f5afb] radeonsi: call LLVMAddEarlyCSEMemSSAPass only for LLVM >= 4.0
$ git bisect bad 
Bisecting: 841 revisions left to test after this (roughly 10 steps)
[12f9fa564aa844d8ecd995853ac78a3f8156b965] Revert "freedreno: use bypass if only clears"
$ git bisect good 
Bisecting: 420 revisions left to test after this (roughly 9 steps)
[7f4645e89cb61d856f386d148566002652d2d4fd] i965: Port CC_VIEWPORT to genxml.
$ git bisect bad 
Bisecting: 210 revisions left to test after this (roughly 8 steps)
[1586768e7475a2732650f0ec2738b4e8429e4b40] vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreation
$ git bisect good 
Bisecting: 105 revisions left to test after this (roughly 7 steps)
[c19150af5cce3ce3a50b818e0869064a26a62f62] i965: Use blorp_copy for doing r8 stencil updates on HSW
$ git bisect good 
Bisecting: 52 revisions left to test after this (roughly 6 steps)
[48b91103cea7fec8ec2864c3a4f8fe1eec711073] radeonsi: use ac_build_buffer_load for shader buffer loads
$ git bisect bad 
Bisecting: 26 revisions left to test after this (roughly 5 steps)
[302c0488cf37c145a538b7560c2aeea1b75e6890] intel/blorp: Don't use ffma directly
$ git bisect good 
Bisecting: 13 revisions left to test after this (roughly 4 steps)
[0901d0bc4c78313eaaf29dff74c6a7bf5514f75b] i965: Round copy size to the nearest block in intel_miptree_copy
$ git bisect bad 
Bisecting: 6 revisions left to test after this (roughly 3 steps)
[0ed6f196fc2a35bf95112d76b9e7ea8f0152217a] intel/blorp: Add support for gen4-5 SF programs
$ git bisect good 
Bisecting: 3 revisions left to test after this (roughly 2 steps)
[752d7af77a52898cebf5597def4fdd38b1d6303e] i965: Add blorp support for gen4-5
$ git bisect good 
Bisecting: 1 revision left to test after this (roughly 1 step)
[6d11362d8b0325ab1f9d12a93323d36ad92d24b0] i965: Use blorp for color blits on gen4-5
$ git bisect good 
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[79f2a5541f92920d35d3621179f7377c97cc75e1] i965: Use BLORP for color clears on gen4-5
$ git bisect bad 
79f2a5541f92920d35d3621179f7377c97cc75e1 is the first bad commit
commit 79f2a5541f92920d35d3621179f7377c97cc75e1
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Fri May 12 17:14:18 2017 -0700

    i965: Use BLORP for color clears on gen4-5
    
    We don't support replicated data clears yet.  Those take a bit more work
    and enabling replicated data clears in its own commit is probably better
    for bisectibility anyway.
    
    Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>

:040000 040000 9b569b93e8e41156b7c87709b1aa669a42325121 d918ec9039e0181d09a1783e757f551ac3a20dfc M	src

First bad commit:

commit 79f2a5541f92920d35d3621179f7377c97cc75e1
Author: Jason Ekstrand <jason.ekstrand@intel.com>
Date:   Fri May 12 17:14:18 2017 -0700

    i965: Use BLORP for color clears on gen4-5
    
    We don't support replicated data clears yet.  Those take a bit more work
    and enabling replicated data clears in its own commit is probably better
    for bisectibility anyway.
    
    Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>

diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c
index fea5eb7b44..3d5c41cc71 100644
--- a/src/intel/blorp/blorp_clear.c
+++ b/src/intel/blorp/blorp_clear.c
@@ -399,6 +399,10 @@ blorp_clear(struct blorp_batch *batch,
    if (surf->surf->tiling == ISL_TILING_LINEAR)
       use_simd16_replicated_data = false;
 
+   /* Replicated clears don't work yet before gen6 */
+   if (batch->blorp->isl_dev->info->gen < 6)
+      use_simd16_replicated_data = false;
+
    /* Constant color writes ignore everyting in blend and color calculator
     * state.  This is not documented.
     */
diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c
index ba9aa4b654..664342d452 100644
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@ -285,8 +285,7 @@ brw_clear(struct gl_context *ctx, GLbitfield mask)
          mt->stencil_mt->r8stencil_needs_update = true;
    }
 
-   /* BLORP is currently only supported on Gen6+. */
-   if (brw->gen >= 6 && (mask & BUFFER_BITS_COLOR)) {
+   if (mask & BUFFER_BITS_COLOR) {
       const bool encode_srgb = ctx->Color.sRGBEnabled;
       if (brw_blorp_clear_color(brw, fb, mask, partial_clear, encode_srgb)) {
          debug_mask("blorp color", mask & BUFFER_BITS_COLOR);

I have updated the system but the problem remains. Should I file a bug upstream?

Offline

#16 2017-10-31 13:04:42

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: GPU hang when switching video fullscreen

What happens if you revert only the patch? And yes, you should file a bug. This looks critical and only older IGPs are affected.

Offline

#17 2017-10-31 15:09:36

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

Reverting the commit gives a conflict, which I cannot resolve.

$ git diff src/mesa/drivers/dri/i965/brw_clear.c
diff --cc src/mesa/drivers/dri/i965/brw_clear.c
index fe8634b3b3,ba9aa4b654..0000000000
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@@ -293,21 -285,18 +293,31 @@@ brw_clear(struct gl_context *ctx, GLbit
           mt->stencil_mt->r8stencil_needs_update = true;
     }
  
++<<<<<<< HEAD
 +   if (mask & BUFFER_BITS_COLOR) {
 +      brw_blorp_clear_color(brw, fb, mask, partial_clear,
 +                            ctx->Color.sRGBEnabled);
 +      debug_mask("blorp color", mask & BUFFER_BITS_COLOR);
 +      mask &= ~BUFFER_BITS_COLOR;
 +   }
 +
 +      mask &= ~BUFFER_BITS_COLOR;
 +   }
 +
 +   if (devinfo->gen >= 6 && (mask & BUFFER_BITS_DEPTH_STENCIL)) {
 +      brw_blorp_clear_depth_stencil(brw, fb, mask, partial_clear);
 +      debug_mask("blorp depth/stencil", mask & BUFFER_BITS_DEPTH_STENCIL);
 +      mask &= ~BUFFER_BITS_DEPTH_STENCIL;
++=======
+    /* BLORP is currently only supported on Gen6+. */
+    if (brw->gen >= 6 && (mask & BUFFER_BITS_COLOR)) {
+       const bool encode_srgb = ctx->Color.sRGBEnabled;
+       if (brw_blorp_clear_color(brw, fb, mask, partial_clear, encode_srgb)) {
+          debug_mask("blorp color", mask & BUFFER_BITS_COLOR);
+          mask &= ~BUFFER_BITS_COLOR;
+       }
++>>>>>>> parent of 79f2a5541f... i965: Use BLORP for color clears on gen4-5
     }
  
 -   GLbitfield tri_mask = mask & (BUFFER_BITS_COLOR |
 -                               BUFFER_BIT_STENCIL |
 -                               BUFFER_BIT_DEPTH);
 +   GLbitfield tri_mask = mask & (BUFFER_BIT_STENCIL |
 +                                 BUFFER_BIT_DEPTH);

Offline

#18 2017-10-31 15:57:36

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: GPU hang when switching video fullscreen

The conflict file looks fishy (there's a stray bitmask clearance) but the relevant part should be to turn

   if (mask & BUFFER_BITS_COLOR) {
      brw_blorp_clear_color(brw, fb, mask, partial_clear,
                            ctx->Color.sRGBEnabled);
      debug_mask("blorp color", mask & BUFFER_BITS_COLOR);
      mask &= ~BUFFER_BITS_COLOR;
   }

into

   if (devinfo->gen >= 6 && (mask & BUFFER_BITS_COLOR)) {
      brw_blorp_clear_color(brw, fb, mask, partial_clear,
                            ctx->Color.sRGBEnabled);
      debug_mask("blorp color", mask & BUFFER_BITS_COLOR);
      mask &= ~BUFFER_BITS_COLOR;
   }

around line 296 (ie. follow the BUFFER_BITS_DEPTH_STENCIL pattern right below)

Offline

#19 2017-10-31 19:23:00

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: GPU hang when switching video fullscreen

Adding 'brw->gen >=6' back to the condition fixes the issue. Verified with 17.2.4 patched and built.
Bug report: https://bugs.freedesktop.org/show_bug.cgi?id=103529

Thanks seth for all the help!

Last edited by adesh (2017-11-01 18:08:35)

Offline

Board footer

Powered by FluxBB