Mesa 19.1 rc crashing MPV with VAAPI
https://bugs.freedesktop.org/show_bug.cgi?id=110783
Bug ID: 110783
Summary: Mesa 19.1 rc crashing MPV with VAAPI
Product: Mesa
Version: 19.1
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/r600
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
Created attachment 144362
--> https://bugs.freedesktop.org/attachment.cgi?id=144362&action=edit
xorg
Hi.
I noticed that after the Mesa upgrade from stable 19.0X to 19.1rc when trying to play MPV video with VAAPI it crashing MPV with this error:
Playing: /VID_20150204_135614.m4v
(+) Video --vid=1 (*) (mpeg4 17.570fps)
(+) Audio --aid=1 --alang=eng (*) (amr_nb 1ch 8000Hz)
AO: [pulse] 8000Hz mono 1ch float
VO: [vdpau] 640x480 yuv420p
[vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
EE ../src/gallium/drivers/r600/r600_shader.c:4290 tgsi_unsupported - DIV tgsi opcode unsupported
EE ../src/gallium/drivers/r600/r600_shader.c:185 r600_pipe_shader_create - translation from TGSI failed !
EE ../src/gallium/drivers/r600/r600_state_common.c:879 r600_shader_select - Failed to build shader variant (type=5) -22
EE ../src/gallium/drivers/r600/r600_shader.c:4290 tgsi_unsupported - DIV tgsi opcode unsupported
EE ../src/gallium/drivers/r600/r600_shader.c:185 r600_pipe_shader_create - translation from TGSI failed !
EE ../src/gallium/drivers/r600/r600_state_common.c:879 r600_shader_select - Failed to build shader variant (type=5) -22
Violation of memory protection (memory dump) <- (last line translated)
It worked fine on Mesa 19.0X, it began crash after upgrade to Mesa 19.1rc2 and 19.1rc3.
Trying libva 2.4.0 and also libva 2.4.1 - same results.
MPV crashing at default launch options. Crashing also with --vo=vaapi or --vo=vdpau.
Not crashing with --vo=gpu or --vo=xv
Worth to add other video players like VLC not crashing wit VAAPI. Only MPV.
Details:
Linux OpenMandriva Lx 4 x86_64
Kernel 5.1.5
Mesa 19.1rc2/3
libva 2.4.0/2.4.1
Tested on two computers with R600, one PC with Radeon HD5850 and notebook with Radeon HD5650m.
In attachment output of xorg log.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #1 from AngryPenguin <[email protected]> --- Created attachment 144363
--> https://bugs.freedesktop.org/attachment.cgi?id=144363&action=edit
inxi
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #2 from Matt Turner <[email protected]> --- Looks like this was reported as a Gentoo bug as well
(https://bugs.gentoo.org/686252)
Have you tried bisecting?
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #3 from Gert Wollny <[email protected]> ---
R600 doesn't implement TGSI_OPCODE_DIV and in the Gentoo bug this is the one reported as being triggered. If think for glsl this is lowered, so maybe there is some compiler option missing in the vdpau state tracker.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #4 from Gert Wollny <[email protected]> --- @AngryPenguin A closer look shows that the bicubic filter in gallium/auxiliar/vl issues TGSI code that contains a DIV operation.
Could you try this tree:
https://gitlab.freedesktop.org/gerddie/mesa/tree/vl-fix-DIV
You can also just apply the last commit, thanks.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #5 from Gert Wollny <[email protected]> --- No this doesn't fix the bug, there are other instances where a DIV is introduced.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #6 from Gert Wollny <[email protected]> ---
The commit that added TGSI shaders with DIV were introduced with
f6ac0b5d7187
gallium/auxiliary/vl: Add compute shader to support video compositor render
and the use of the shaders was enabled with
9364d66cb7f7
gallium/auxiliary/vl: Add video compositor compute shader render
The simplest approach is probably to add the lowering to RCP + MUL in the GLSL-TO-TGSI stage.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #7 from Gert Wollny <[email protected]> ---
This is a very deep rabbit hole: Not only does r600 not support DIV, it also doesn't support TEX_LZ that is used by these compute shaders and Evergreen class hardware doesn't support more then one target swizzle for the destinations with RCP so that the shader is even more broken. I think the best option now will be to disable this shader for now for this hardware.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #8 from Ilia Mirkin <[email protected]> --- (In reply to Gert Wollny from comment #7)
Quoted 5 lines
This is a very deep rabbit hole: Not only does r600 not support DIV, it also doesn't support
TEX_LZthat is used by these compute shaders and Evergreen class hardware doesn't support more then one target swizzle for the destinations with RCP so that the shader is even more broken. I think the best option now will be to disable this shader for now for this hardware.
The state tracker has to respect PIPE_CAP's. If the driver doesn't say it has DIV or TEX_LZ, then those shouldn't be used.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #9 from Gert Wollny <[email protected]> --- Indeed, currently the code only tests whether compute shaders are supported, and DIV and TEX_LZ don't have any caps yet. I guess I'll take in on me to add these caps.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #10 from Christian König <[email protected]> --- (In reply to Gert Wollny from comment #9)
Quoted 3 lines
Indeed, currently the code only tests whether compute shaders are supported, and DIV and
TEX_LZdon't have any caps yet. I guess I'll take in on me to add these caps.
Well the key point is probably rather that we should not use compute shaders on that hw generation in the first place.
How did that got enabled?
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #11 from Ilia Mirkin <[email protected]> --- (In reply to Christian König from comment #10)
Quoted 9 lines
(In reply to Gert Wollny from comment #9)
Quoted 3 lines
Indeed, currently the code only tests whether compute shaders are supported, and DIV and
TEX_LZdon't have any caps yet. I guess I'll take in on me to add these caps.Well the key point is probably rather that we should not use compute shaders on that hw generation in the first place.
How did that got enabled?
It just checks for PIPE_CAP_COMPUTE (which *is* supported by r600). The change was targeted at radeonsi. I had to disable PIPE_CAP_COMPUTE on nv50 to work around this as well, but there it wasn't _really_ supported very well so it was OK.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #12 from Gert Wollny <[email protected]> ---
I might add that the DIV is lowered in glsl to RCP+MUL before it is translated to TGSI, so no need for it there.
When I look at the bicubic shader with the offending opcodes, I have to say that using DIV there is a bit lazy, because the DIVs act on constants or uniforms or combinations of these, and it would probably be better to pass them reciprocal value in (I just don't know (yet) where the constants are actually passed in to change this).
Anyway, since there is already a CAP for TEX_LZ I was able to create a simple fix:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1084
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #13 from Ilia Mirkin <[email protected]> --- (In reply to Gert Wollny from comment #12)
Quoted 3 lines
Anyway, since there is already a CAP for
TEX_LZI was able to create a simple fix:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1084
TEX_LZ == TXL with LOD = 0. You could rather easily make the tgsi code that generates TEX_LZ to optionally use TXL with LOD = 0 (which has to go into coord.w).
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #14 from Gert Wollny <[email protected]> ---
Well, I already pointed out that the fix is by no means complete, because even if I provide a TGSI that doesn't use TEX_LZ, I still have to take care of the DIV, which is a bit more tedious and there is currently no CAP.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #15 from AngryPenguin <[email protected]> --- Hi.
I can confirm, this fix my issue with vaapi and vdpau.
Thanks.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #16 from Gert Wollny <[email protected]> ---
I've updated the MR to add a CAP for support of TGSI_OPCODE_DIV to also check for it.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
Matt Turner <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
URL| |https://gitlab.freedesktop. | |org/mesa/mesa/merge_request | |s/1084
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
[email protected] changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |major
--- Comment #17 from [email protected] ---
My distribution just upgraded to Mesa-19.1.1 release and I hit this bug.
I can't believe the fix has been forgotten.
Please, push it ASAP.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #18 from Thomas Capricelli <[email protected]> --- Just updated to 19.1.1 here, and the bug is still present, can't play mpv with vdpau driver.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #19 from ITwrx <[email protected]> ---
this bug has halted the development of a project i am working on. crashes the program.
arch linux 5.1.16.a-1-hardened
libva 2.4.1-1
libva-mesa-driver 19.1.1-1
libva-utils 2.4.1-1
mesa 19.1.1-1
i have a Radeon HD 5830
thanks
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #20 from Juan A. Suarez <[email protected]> --- The fix has landed in 19.1.2 release.
Can you try it again?
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #21 from ITwrx <[email protected]> ---
@juan sure, but i'll probably wait long enough for arch to package the new version. Thanks for letting me know.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #22 from AngryPenguin <[email protected]> --- I can confirm. 19.1.2 fixed my issue on OpenMandirva. Thanks
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
AngryPenguin <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXEDSignature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #23 from [email protected] ---
I can confirm that mesa-19.1.2 works for me too.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=110783
--- Comment #24 from ITwrx <[email protected]> ---
19.1.2 did the trick. thanks
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel