ValveSoftware/SteamVR-for-Linux

[BUG] SteamVR fails on launch under Wayland if asynchronous reprojection is enabled

ZarathustraDK opened this issue · 19 comments

Describe the bug
When launching SteamVR in a Wayland-session, the client will fail with error 307 unless "enableLinuxVulkanAsync" : false, has been set in steamvr.vrsettings . The client will remain open and detect peripherals, but there'll be no output on the HMD.

To Reproduce
Steps to reproduce the behavior:

  1. Make sure "enableLinuxVulkanAsync" : true," is set under the SteamVR-section in /home/user/.steam/steam/config/steamvr.vrsettings .
  2. Launch SteamVR.
  3. Have it error out with error 307

Expected behavior
SteamVR should launch into SteamVR Home and show the output on the HMD.

System Information (please complete the following information):

  • Distribution: Arch
  • Desktop Environment: KDE 5.24
  • Xwayland-version: 22.1
  • SteamVR version: 1.20.4 (1634602223)
  • GPU: Radeon 6800 XT
  • Steam client version: Jan 16 2022 at 17:34:49
  • Opted into Steam client beta?: No
  • Graphics driver version: Mesa 21.3.6
  • Gist for SteamVR System Information](https://gist.github.com/ZarathustraDK/826fccf684c6372ccb12a650ab929df1)

Additional context
Logs from vrclient_vrmonitor, vrcompositor, vrmonitor, vrserver and vrwebhelper attached. Stuff starts going awry at 21:28:02

Side-question: is there a preferred display-server for feedback regarding SteamVR on linux?

Workaround
Set "enableLinuxVulkanAsync" : false, in /home/user/.steam/steam/config/steamvr.vrsettings in the SteamVR-section. This allows SteamVR to launch, but destroys the ability to enable asynchronous reprojection on a per-game basis (which is preferrable in some cases despite the bugs pertaining to this function), resulting in a lot of stutter/lack of reprojection in demanding games. This can be somewhat alleviated by running Corectl on AMD cards with vr-profile turned on, but demanding titles will still "haze out" when turning your head.

Note: Commenters who are also experiencing this issue are encouraged to include the "System Information" section in their replies.

I'm experiencing the same issue on ArcoLinux (Arch). Same GPU as @ZarathustraDK

It's got something to do with SteamVR not being able to create a surface because of Vulkan WSI modifier support: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5266

Downgrading to mesa 21.0, or disabling explicit modifiers by reverting the commit that enabled them works around the bug

I also experience this issue. The workaround gets Error 307 to go away. I haven't tried reverting Mesa either but may try that.

I played Beat Saber with not any issues, but The Forest, I got lots of the stutter/lack when moving my head.

Distribution: Arch Linux
SteamVR version: 1.22.5 (1648853008)
Steam client version: Built: March 31, 2022 at 23:11:43
Opted into Steam client beta?: Yes
Graphics driver version: mesa 22.0.0-1
Gist for SteamVR System Information: https://gist.github.com/alpacalife/2d9a89546a2b73757bb9e4ed19c049bd

I got this issue too, but fixed it by forcing X11/XWayland on SDL. So setting export SDL_VIDEODRIVER=x11 in /etc/profile / /etc/profile.local depending on your system. Leaving it unset could also work, but keep in mind that the default changed recently.

steamvr.vrsettings

{
   "DesktopUI" : {
      "pairing" : "560,240,799,599,0",
      "settings_desktop" : "560,240,799,599,0"
   },
   "GpuSpeed" : {
      "gpuSpeed0" : 463,
      "gpuSpeedCount" : 1,
      "gpuSpeedDriver" : "92274689",
      "gpuSpeedHorsepower" : 463,
      "gpuSpeedRenderTargetScale" : 1.2599999904632568,
      "gpuSpeedVendor" : "AMD RADV POLARIS10",
      "gpuSpeedVersion" : 2
   },
   "LastKnown" : {
      "HMDManufacturer" : "HTC",
      "HMDModel" : "Vive. MV"
   },
   "driver_lighthouse" : {
      "PowerManagedBaseStations2" : "LHB-108DA96B:BS1:1,LHB-DB574D3E:BS1:1"
   },
   "steamvr" : {
      "enableLinuxVulkanAsync" : true,
      "installID" : "10594661635945228443",
      "lastVersionNotice" : "1.21.12",
      "lastVersionNoticeDate" : "1647468137"
   }
}

System Information (please complete the following information):

enableLinuxVulkanAsync is deprecated now? Each time I launch SteamVR, this parameter vanishes.

enableLinuxVulkanAsync is deprecated now? Each time I launch SteamVR, this parameter vanishes.

I also have this issue, now. I can no longer disable async and my menus are all wobbly again on Nvidia. What is the new solution to this issue?

enableLinuxVulkanAsync is deprecated now? Each time I launch SteamVR, this parameter vanishes.

I had the same issue, make note that each line ends with a comma until the last one. If you miss a comma, it will regenerate the file. It's currently working for me using sway.

enableLinuxVulkanAsync is deprecated now? Each time I launch SteamVR, this parameter vanishes.

I had the same issue, make note that each line ends with a comma until the last one. If you miss a comma, it will regenerate the file. It's currently working for me using sway.

You are my savior.

enableLinuxVulkanAsync is deprecated now? Each time I launch SteamVR, this parameter vanishes.

I had the same issue, make note that each line ends with a comma until the last one. If you miss a comma, it will regenerate the file. It's currently working for me using sway.

You are my savior.

Happy to help :)
Unfortunately now I'm having problems getting my headset to display instead of outputting to the desktop, but it's further than I got before.

enableLinuxVulkanAsync is deprecated now? Each time I launch SteamVR, this parameter vanishes.

I had the same issue, make note that each line ends with a comma until the last one. If you miss a comma, it will regenerate the file. It's currently working for me using sway.

I have proper syntax with comma at end and it still removes it.
Also I changed to "enableLinuxVulkanAsync": false, in default.vrsettings, and it results to always adding "enableLinuxVulkanAsync": true, in steamvr.vrsettings

I have proper syntax with comma at end and it still removes it.

@xDShot try parsing steamvr.vrsettings with jq and see if it succeeds. I can confirm that setting that to false in steamvr.vrsettings was enough to resolve this for me (and it didn't come back).

SteamVR version: 1.24.2
Kernel version: 6.0-rc4
Mesa: 22.2.0-rc3
Xwayland: 22.1.3
Compositor: Sway 1.7 (wlroots 0.15.1)
GPU: AMD Radeon 6900XT (NAVI21/SIENNA_CICHLID)

This original issue, however, reproducible for me, as is the workaround.

Here is a (quite useless due to lack of debug info for vrcompositor) stack trace of the segfault that's causing this when enableLinuxVulkanAsync is true.

Stack trace of thread 131253:
                #0  0x00007f8298a77994 pthread_mutex_lock (libc.so.6 + 0x89994)
                #1  0x00005644e6a17a91 n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0xa7a91)
                #2  0x00005644e6bc817d n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0x25817d)
                #3  0x00005644e6a0495a n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0x9495a)
                #4  0x00005644e69e0810 n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0x70810)
                #5  0x00005644e6a739c6 n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0x1039c6)
                #6  0x00005644e6a7462d n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0x10462d)
                #7  0x00005644e69da846 n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0x6a846)
                #8  0x00007f8298a112d0 n/a (libc.so.6 + 0x232d0)
                #9  0x00007f8298a1138a __libc_start_main (libc.so.6 + 0x2338a)
                #10 0x00005644e69dbcf1 n/a (/home/mcoffin/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor + 0x6bcf1)

@mcoffin I've tried jq and it outputs config file properly, so there was a proper syntax. It is still removed after launching SteamVR.

I noticed there's "disableAsync" : true, added. Is it the same? @kisak-valve

Fixed with latest ALVR build

I decided to test async reprojection on sway 1.8 with the SteamVR beta (1.25.2) on my Index. It is working for me now. I'm on stable steam client.

#395 appears worse on sway compared to X11.

If more people can check the async reprojection in SteamVR beta on sway, KDE, and other wayland compositors, we might be at the point where this issue is fixed.

Further testing: Turning on legacy reprojection for SteamVR Home (or setting "disableAsync" : true for openvr.tool.steamvr_environments) may help with stability on SteamVR startup.

Edit: GPU: RX 5700 XT

On SteamVR Beta (1.25.3) on kwin wayland 5.26.5, launching with asynchronus reprojection enabled does indeed work.
However, it introduces severe wobble/jitter not present when the setting is disabled. Making it effectively unusable.

Further testing: Turning on legacy reprojection <...>may help with stability on SteamVR startup.

I've been running legacy reprojection for everything just to get livable frame time variance for ages. I wasn't aware that the "modern" reprojection system was working in a livable state for anyone!

Before adopting that change, any brief interruption in frame consistency would cause the runtime to permanently lock itself to 50% framerate until restarted, and even when it wasn't throttling, the performance was worse.

It takes a little more effort to tune each game to get consistent timings where you don't drop to interleaved reproj, but I didn't know anyone had the alternative working in a long-term livable state

This seems to have resolved itself for me with the introduction of the latest Mesa drivers. Seems this issue was what caused it: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5266

Closing per the last comment.