steam-for-linux icon indicating copy to clipboard operation
steam-for-linux copied to clipboard

Slow framerate, high latency, input lag during Remote Play of Vulkan games on Ubuntu to Steam Link (SlowGamePercent)

Open Davidian1024 opened this issue 1 year ago • 1 comments

Your system information

  • Steam client version: Steam Beta Branch: Stable Client Steam Version: 1718904662 Steam Client Build Date: Thu, Jun 20 1:14 PM UTC -05:00 Steam Web Build Date: Wed, Jun 19 8:04 PM UTC -05:00 Steam API Version: SteamClient021

  • Distribution: Ubuntu 22.04.4 LTS Jammy Jellyfish

  • Opted into Steam client beta?: No

  • Have you checked for system updates?: Yes

  • Steam Logs: steam-logs.tar.gz

  • GPU: Nvidia GTX 1080Ti

Please describe your issue in as much detail as possible:

When I stream games to a Steam Link device (I have tested with a Raspberry Pi 4B and an Androind phone) I get very low FPS for any Vulkan based game. Games using OpenGL seem unaffected. I think all of the games I run with Proton are affected by this. I think those all use Vulkan now.

In ~/.local/share/Steam/logs/streaming_log.txt I see lines like these: Slow framerate: game 45.95, capture 0.51, convert 0.01, encode 13.89, network 9.30, decode 1.67, display 7.88 (game) Followed by a SessionStats section that mentions SlowGamePercent with a number that's usually above 20. While all the other Slow...Percent stats are 0.

I can most easily determine which games are using Vulkan or OpenGL with the Remote Play Client Details Performance Overlay. For Vulkan games the encoder is reported as Game Vulkan NV12. For OpenGL games is is Game Delayed OpenGL NV12.

I have tried many many different combinations of both advanced host and client options under Steam's Remote Play settings. Nothing seems to improve the situation when streaming Vulkan games.

Steps for reproducing this issue:

Launch a Vulkan based game directly on the Ubuntu host with the Steam In-game FPS Counter enabled. Observe a high framerate. Launch the same game on the same host through a Steam Link device. Observe a low framerate.

Games I've spent the most time testing with: Vulkan Games (Encoder: Game Vulkan NV12)

  • Cuphead (Vulkan): Directly on the host FPS: ~60. Streaming to either Steam Link device: ~22FPS.
  • Trackmania (Vulkan): Directly: ~150. Streaming to Steam Link: ~22FPS.

OpenGL Games (Encoder: Game Delayed OpenGL NV12)

  • Celeste (OpenGL): Directly on the host FPS: ~60. Streaming to either Steam Link device: ~60FPS.
  • Angry Video Game Nerd I & II Deluxe (OpenGL): Directly on the host FPS: ~60. Streaming to either Steam Link device: ~60FPS.

For what it's worth I see roughly the exact same FPS for any Vulkan game when streamed to any of my Steam Link devices. It's almost always 22FPS or very close to that number.

Davidian1024 avatar Jun 30 '24 15:06 Davidian1024

same issue for me, ~2 weeks ago my encoder has change from NVENC to libx264 ( using cpu for encoding ) and very laggy

in my streaming log, ffmpeg cant find my nvidia driver in lib32

Video Encoder Changed                                                                                
>>> Capture method set to Desktop OpenGL NV12 + NVENC HEVC                                           
>>> Capture resolution set to 1260x788                                                               
>>> Capture colorspace set to BT.601 limited range                                                   
NVENC - Submitting frame for encoding failed: 20                                                     
CGameStreamVideoStageVAAPI: Reinitializing 1260x788 at 5000 Kbit/s and 60.00 FPS with quality 0      
ffmpeg verbose: libva: VA-API version 1.21.0                                                         
ffmpeg verbose: libva: User environment variable requested driver 'nvidia'                           
ffmpeg verbose: libva: Trying to open /usr/lib32/dri/nvidia_drv_video.so                             
ffmpeg verbose: libva: va_openDriver() returns -1                                                    
ffmpeg error: Failed to initialise VAAPI connection: -1 (unknown libva error).                       
CGameStreamVideoStageVAAPI: Failed to create device context: Input/output error                      
Detected 4 logical processors, using 3 threads                                                       
Configuring encoder: [threads=3][width=1260][height=788][preset=superfast][tune=zerolatency]         
Video Encoder Changed                                                                                
>>> Capture method set to Desktop OpenGL NV12 + libx264 main (3 threads)

kokossVN avatar Jul 01 '24 10:07 kokossVN

I've also been running into this same issue with Nvidia driver version > 555. NVENC is not being used, and the host falls back to software encoding.

I believe it's the same issue that's being tracked over here: https://github.com/ValveSoftware/steam-for-linux/issues/10984

rstrube avatar Sep 13 '24 13:09 rstrube