protonscr

vrcompositor segfault with High Fidelity threaded submit

steamvrclosed
ValveSoftware/SteamVR-for-Linux#78 · opened 2017-11-21 by ChristophHaag · updated 2018-05-02 · 7 comments · github
CChristophHaag 2017-11-21 github

RX 480, latest radv.

If you want to test it, use this branch https://github.com/ChristophHaag/hifi/commits/threadedsubmit

See the latest commit that enables their threaded submit implementation. It looks like they're basically doing their own reprojection there.

Anyway, at https://github.com/highfidelity/hifi/blob/89425ca210b47f3b66bf461ab62423da4781fa1c/plugins/openvr/src/OpenVrDisplayPlugin.cpp#L214 they have their thread that submits, which works fine for a couple of seconds, but then SteamVR's vrcompositor segfaults.

Core was generated by `/home/chris/.local/share/Steam/SteamApps/common/SteamVR/bin/linux64/vrcomposito'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000540f56 in CVulkanVRRenderer::ImportTextureFromSharedHandle(unsigned long, vr::EColorSpace, bool) ()
[Current thread is 1 (Thread 0x7fad7f7fe700 (LWP 25734))]
(gdb) info locals
No symbol table info available.
(gdb) bt
#0  0x0000000000540f56 in CVulkanVRRenderer::ImportTextureFromSharedHandle(unsigned long, vr::EColorSpace, bool) ()
#1  0x0000000000460a5a in CGenericResources::Update(vr::IGraphicsDevice::UpdateParams_t const&) ()
#2  0x000000000045102e in vr::CHmdDistort::Update(vr::EVREye, vr::CHmdDistort::UpdateParams_t const*, vr::TrackedDevicePose_t const*, vr::ETrackingUniverseOrigin, unsigned long) ()
#3  0x0000000000482574 in CRenderThread::Update() ()
#4  0x0000000000483d27 in CRenderThread::Run() ()
#5  0x0000000000536f32 in SteamThreadTools::CThread::ThreadProc(void*) ()
#6  0x00007fadb45b308a in start_thread () from /usr/lib/libpthread.so.0
#7  0x00007fadb42ea47f in clone () from /usr/lib/libc.so.6

That probably shouldn't happen, no matter what the application submits.

Llostgoat 2017-11-22 github

Possibly related to fd leaks when sharing surfaces. I'll message you on freenode if I have any trouble repro'ing the issue.

Llostgoat 2017-11-27 github

@ChristophHaag got the bug reproduced locally

CChristophHaag 2017-12-14 github

Any progress? I think I've seen a similar crash in Doom 3 with SteamVR, so I'm not using the patches anymore for now...

Llostgoat 2017-12-15 github

@ChristophHaag This is due to libdrm running out of va space to import the new handle. I'll be taking a look at why that happens soon (once I get a new version of the GL semaphore patches out).

Adding correct protection against the segfault when import fails is going to be a slightly bigger task than expected. That problem has a little bit of deep roots.

Llostgoat 2018-04-13 github

The latest SteamVR beta correctly detects cases where a shared texture is un-importable and returns an error (as opposed to crashing).

Haven't looked into the exact details as to why the shared-texture is un-importable, but I suspect the VA resources are being exhausted due constant eye texture allocations. Probably worth another look to determine whether the app or steamvr is failing to fully cleanup the old resources.

Llostgoat 2018-04-30 github

Driver side fix for this issue is now pushed to mesa master:
https://lists.freedesktop.org/archives/mesa-dev/2018-April/193590.html

Llostgoat 2018-05-02 github

The fix above + the latest steam beta should have threaded hifi working correctly:
https://steamcommunity.com/games/250820/announcements/detail/1658891645926260963

Nothing extracted yet.