ValveSoftware / SteamVR-for-Linux

Issue tracker for the Linux port of SteamVR
933 stars 45 forks source link

[BUG] asynchronous reprojection - Insufficient permission to create high priority queue. #660

Open Links2004 opened 11 months ago

Links2004 commented 11 months ago

Describe the bug cap_sys_nice is set but Insufficient permission to create high priority queue. is shown in the log and asynchronous reprojection is "not supported"

$ getcap ~/.steam/steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher
/home/links/.steam/steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher cap_sys_nice=eip

the only simmular issue i found is: https://github.com/NixOS/nixpkgs/issues/217119 since it looks like that Steam Linux Runtime is using bwrap too.

$ ps aux | grep bwrap
links      48707  0.0  0.0   4592  1536 ?        S    11:24   0:00 /home/links/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/pressure-vessel/bin/pv-bwrap --args 27 /usr/lib/pressure-vessel/from-host/bin/pressure-vessel-adverb --generate-locales --fd 18 --regenerate-ld.so-cache /run/pressure-vessel/ldso --add-ld.so-path /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu --add-ld.so-path /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu --set-ld-library-path /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases --exit-with-parent --subreaper --assign-fd=1=6 --assign-fd=2=7 --shell=none --terminal=none --ld-preload=libgamemodeauto.so.0 -- /home/links/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/pressure-vessel/bin/steam-runtime-launcher-interface-0 container-runtime /home/links/.local/share/Steam/steamapps/common/SteamVR/bin/vrstartup.sh

To Reproduce Steps to reproduce the behavior:

  1. Go to start SteamVR with steam linux runtime
  2. look in log or settings page

Expected behavior the steam linux runtime chroot / isolation do allow the use of cap_sys_nice and as a result asynchronous reprojection can be enabled.

System Information (please complete the following information):

Screenshots image

Additional context

Thu Dec 14 2023 11:25:01.226004 [Info] - Selected mode 3.
Thu Dec 14 2023 11:25:01.464403 [Info] - Acquired xlib display!
Thu Dec 14 2023 11:25:01.464436 [Info] - Direct mode surface: 0x56019a1b5070
Thu Dec 14 2023 11:25:01.464466 [Info] - Requesting 10 device extensions:
Thu Dec 14 2023 11:25:01.464477 [Info] -  - VK_KHR_swapchain
Thu Dec 14 2023 11:25:01.464486 [Info] -  - VK_KHR_maintenance1
Thu Dec 14 2023 11:25:01.464496 [Info] -  - VK_KHR_dedicated_allocation
Thu Dec 14 2023 11:25:01.464505 [Info] -  - VK_KHR_get_memory_requirements2
Thu Dec 14 2023 11:25:01.464514 [Info] -  - VK_KHR_external_memory
Thu Dec 14 2023 11:25:01.464524 [Info] -  - VK_KHR_external_semaphore
Thu Dec 14 2023 11:25:01.464533 [Info] -  - VK_EXT_display_control
Thu Dec 14 2023 11:25:01.464542 [Info] -  - VK_KHR_external_memory_fd
Thu Dec 14 2023 11:25:01.464551 [Info] -  - VK_KHR_external_semaphore_fd
Thu Dec 14 2023 11:25:01.464568 [Info] -  - VK_EXT_global_priority
Thu Dec 14 2023 11:25:01.464579 [Info] - Global priority query enabled: 1
Thu Dec 14 2023 11:25:01.464588 [Info] - Attempting to enable async support...
Thu Dec 14 2023 11:25:01.464598 [Info] - Enabling async support!
Thu Dec 14 2023 11:25:01.464745 [Error] - Insufficient permission to create high priority queue.
Thu Dec 14 2023 11:25:01.464758 [Error] - Failed to create VkDevice with high priority queue.
Thu Dec 14 2023 11:25:01.464768 [Error] - Disabling async support and retrying.
Thu Dec 14 2023 11:25:01.505361 [Info] - m_pVkInstance : 0x56019a16da20
Thu Dec 14 2023 11:25:01.505393 [Info] - m_pVkPhysicalDevice : 0x56019a1a9060
Thu Dec 14 2023 11:25:01.505412 [Info] - m_pVkDevice : 0x56019a259da0
Thu Dec 14 2023 11:25:01.505423 [Info] - m_pVkGraphicsQueue : 0x56019a473d60
Thu Dec 14 2023 11:25:01.505432 [Info] - m_pVkComputeQueue : (nil)

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

Scrumplex commented 11 months ago

I don't think SteamVR runs inside a pressure-vessel based runtime by default, so I don't think this is a problem with CAP_SYS_NICE. I thought NVIDIA didn't support async reprojection in general yet

Links2004 commented 11 months ago

the NVIDIA driver supports it since a long time (2021) see:

https://www.nvidia.com/download/driverResults.aspx/176525/en-us/

Added support for VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT from the VK_EXT_global_priority extension. This enables support for asynchronous reprojection in SteamVR.

VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT is supported on Pascal GPUs and newer.

Global priorities other than VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT require root privileges or the CAP_SYS_NICE capability.

and vulkaninfo shows support.

sudo vulkaninfo  | grep -i global
    VK_EXT_global_priority                        : extension revision 2
    VK_EXT_global_priority_query                  : extension revision 1
    VK_KHR_global_priority                        : extension revision 1
        VkQueueFamilyGlobalPriorityPropertiesKHR:
                QUEUE_GLOBAL_PRIORITY_LOW_KHR
                QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
                QUEUE_GLOBAL_PRIORITY_HIGH_KHR
                QUEUE_GLOBAL_PRIORITY_REALTIME_KHR
        VkQueueFamilyGlobalPriorityPropertiesKHR:
                QUEUE_GLOBAL_PRIORITY_LOW_KHR
                QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
                QUEUE_GLOBAL_PRIORITY_HIGH_KHR
        VkQueueFamilyGlobalPriorityPropertiesKHR:
                QUEUE_GLOBAL_PRIORITY_LOW_KHR
                QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
                QUEUE_GLOBAL_PRIORITY_HIGH_KHR
                QUEUE_GLOBAL_PRIORITY_REALTIME_KHR
        VkQueueFamilyGlobalPriorityPropertiesKHR:
                QUEUE_GLOBAL_PRIORITY_LOW_KHR
                QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
                QUEUE_GLOBAL_PRIORITY_HIGH_KHR
        VkQueueFamilyGlobalPriorityPropertiesKHR:
                QUEUE_GLOBAL_PRIORITY_LOW_KHR
                QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
                QUEUE_GLOBAL_PRIORITY_HIGH_KHR
                QUEUE_GLOBAL_PRIORITY_REALTIME_KHR
VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR:
    globalPriorityQuery = true
edwin-v commented 6 months ago

The same thing started happening on a working 1.27.5 install. So it's something the Steam client did. I see that vrstartup.sh / vrsetup.sh is no started under Sniper, so I assume this is what broke a bunch of things.

Edit: Conclusions after a short investigation.

I'm unsure if it's even possible to elevate your permission in the container.

If I have more time, I may try to wrap srt-bwrap in a script that skips the container for vrstartup.sh.

cyberkitsune commented 6 months ago

Just commenting to +1 this, also getting:

Tue May 21 2024 23:02:34.355714 [Info] - Enabling async support!
Tue May 21 2024 23:02:34.355965 [Error] - Insufficient permission to create high priority queue.
Tue May 21 2024 23:02:34.355984 [Error] - Failed to create VkDevice with high priority queue.
Tue May 21 2024 23:02:34.356001 [Error] - Disabling async support and retrying.

Distribution: Fedora 40 SteamVR version: 2.6.1 beta Steam client version: 1716242052 Opted into Steam client beta?: Yes Graphics driver version: NVIDIA 550.78 Gist for SteamVR System Information: https://gist.github.com/cyberkitsune/daa3332e369056298004d5bae3ec6439

vsTerminus commented 4 months ago

Also just commenting to +1 as the issue is still affecting me.

I can work around the issue by launching ~/.steam/steam/steamapps/common/SteamVR/bin/vrstartup-helper.sh manually instead of from inside Steam and then async reprojection works perfectly, but, often times when I shut down SteamVR after it has been launched this way it just crashes my entire computer and that's no good.

However, games like DCS and Microsoft Flight Simulator are unplayable without async, so finding a better solution to this problem that doesn't risk hard crashing my computer would be nice.

(Edit: System-wide crash doesn't seem to happen on Wayland.)

When I launch SteamVR the normal way (through Steam) I see this in vrcompositor.txt

Thu Jul 04 2024 22:03:32.107047 [Info] - Global priority query enabled: 1
Thu Jul 04 2024 22:03:32.107056 [Info] - Attempting to enable async support...
Thu Jul 04 2024 22:03:32.107065 [Info] - Enabling async support!
Thu Jul 04 2024 22:03:32.107245 [Error] - Insufficient permission to create high priority queue.                                                                                                                                                                                                                        
Thu Jul 04 2024 22:03:32.107257 [Error] - Failed to create VkDevice with high priority queue.
Thu Jul 04 2024 22:03:32.107266 [Error] - Disabling async support and retrying.

System Info Distribution: Arch Linux SteamVR Version: 2.7.2 Steam Beta Branch: Steam Beta Update Steam Version: 1719967667 Steam Client Build Date: Tue, Jul 2 17:38 UTC -08:00 Steam Web Build Date: Tue, Jul 2 19:35 UTC -08:00 Steam API Version: SteamClient021 Graphics Driver Version: nvidia-dkms 555.58.02-1 Gist for SteamVR System Information GPU: NVIDIA RTX 3090 Ti CPU: AMD Ryzen 9 5950X RAM: 64GB DDR4-3200 HMD: Valve Index

exuvo commented 1 week ago

Running as steam-native in the console i get: vrstartup.sh[581849]: Steam Linux Runtime: sniper_platform_0.20241008.104210 vrstartup.sh[581849]: call /home/exuvo/.local/share/Steam/steamapps/common/SteamVR/bin/vrsetup.sh vrsetup.sh[581873]: Detected Steam Linux Runtime pressure-vessel launch in sniper_platform_0.20241008.104210 vrsetup.sh[581873]: Error: steam launcher service not available, vrcompositor-launcher will execute inside the container with no privileges.

And Insufficient permission to create high priority queue in the vrcompositor log.

But running with steam-runtime it works. UI still says it is not supported but log does not say it failed and actually playing is very smooth now.

System Info Arch Linux GPU: AMD RX 7900 XTX HMD: Valve Index