Skip to contentSkip to conversation

vdpau segfaults and gpu locks with kodi on R9285

Bug 99158 [email protected] 1 participant 10 messages Dec 20, 2016 – Jan 5, 2017

lore
Share & tools
lore
#0 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=99158

Bug ID: 99158
Summary: vdpau segfaults and gpu locks with kodi on R9285
Product: Mesa
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]

Created attachment 128583
--> https://bugs.freedesktop.org/attachment.cgi?id=128583&action=edit
some segfaults

This is an initial report no bisects as I have no clue when it started yet.

It seems there is an unlucky timing situation with kodi that may segfault radeonsi or lock gpu playing videos with vdpau h/w decode + temporal vdpau deint which is default kodi settings.

I can't reproduce with mplayer or mpv.

It seems to need HD interlaced + deint, but that may be just because it changes timing.

Running with VDPAU_TRACE=1 so far avoids the crash/lock, as does setting cpus to perf.

Running kodi git, but it's reproducable with 11 month old git as well.

It's easiest to provoke starting kodi with a file on command line, but is possible starting from running kodi menu - possible improved chance of crash/lock by moving mouse after clicking file to make overlay instantly render over video.

Attaching some segfaults and locks.

I am running git mesa/llvm/kernel and the crash is rare enough that I may have missed it for ages given the amount I test kodi. Additionally the best way to provoke = repeated command line start, only started being possible again ecently due to a kodi bug.

The segfaults are a bit random.

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

#1 lore raw

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #1 from Andy Furniss <[email protected]> --- Created attachment 128584
--> https://bugs.freedesktop.org/attachment.cgi?id=128584&action=edit
some gpu locks

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

#2 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #2 from Michel Dänzer <[email protected]> ---
Can you try reproducing it in valgrind and see if that raises some interesting errors?

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

#3 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #3 from Andy Furniss <[email protected]> --- Couldn't get it to crash with valgrind.

Bisect not 100% sure as it seemed to get harder to provoke going back in time, but it does seem to need temporal deint and I got -

first bad commit: [d0d5f7600c2e8ab8d0c153787185f7a534753edd] Revert "st/vdpau: use linear layout for output surfaces

The revert reverts from current head, so I will test for a while like that.

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

#4 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #4 from Andy Furniss <[email protected]> --- (In reply to Andy Furniss from comment #3)

Quoted 9 lines

Couldn't get it to crash with valgrind.

Bisect not 100% sure as it seemed to get harder to provoke going back in time, but it does seem to need temporal deint and I got -

first bad commit: [d0d5f7600c2e8ab8d0c153787185f7a534753edd] Revert "st/vdpau: use linear layout for output surfaces

The revert reverts from current head, so I will test for a while like that.

I've been running OK with the revert reverted for some time now, testing with a script that repeatedly starts kodi, so it does seem to be this commit that causes some timing issue with vdpau temporal deint.

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

#5 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #5 from Christian König <[email protected]> --- Yeah and that actually makes sense, by using linear layout you also disable DCC.

Does using R600_DEBUG=nodcc help as well?

Marek please take a look at the backtraces in the first post. It sounds like one thread is getting the handle of a texture which results in a DCC decompress.

Could it be that we have a race with that?

Regards,
Christian.

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

#6 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #6 from Marek Olšák <[email protected]> ---
We could get a race if vlVdpOutputSurfaceDMABuf is called from a different thread than the context is normally used with. Can that happen?

You can try to test this:

(quoted diff) +0 -0

b/src/gallium/state_trackers/vdpau/output.c
index 64574b2..96474fb 100644

src/gallium/state_trackers/vdpau/output.c +0 -0
@@ -804,7 +804,7 @@ VdpStatus vlVdpOutputSurfaceDMABuf(VdpOutputSurface

surface,

    whandle.type = DRM_API_HANDLE_TYPE_FD;

    pscreen = vlsurface->surface->texture->screen;
-   if (!pscreen->resource_get_handle(pscreen, vlsurface->device->context,
+   if (!pscreen->resource_get_handle(pscreen, NULL,
                                      vlsurface->surface->texture, &whandle,
                                     PIPE_HANDLE_USAGE_READ_WRITE))
       return VDP_STATUS_NO_IMPLEMENTATION;
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

#7 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #7 from Marek Olšák <[email protected]> --- Nevermind. This series should fix it for VDPAU and VAAPI:

https://patchwork.freedesktop.org/series/17480/

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

#8 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

--- Comment #8 from Andy Furniss <[email protected]> --- (In reply to Marek Olšák from comment #7)

Quoted 3 lines

Nevermind. This series should fix it for VDPAU and VAAPI:

https://patchwork.freedesktop.org/series/17480/

Yea, it's OK with these, 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

#9 lore raw
In reply to [email protected]

https://bugs.freedesktop.org/show_bug.cgi?id=99158

Christian König <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
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