ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.17k stars 173 forks source link

Hardware encoding not working on Linux #11028

Open bargu2 opened 3 weeks ago

bargu2 commented 3 weeks ago

Your system information

Please describe your issue in as much detail as possible:

Recording function is not utilizing hardware encoding, setting "Enable GPU hardware encoding" is enable on Steam settings, hardware encoding works fine on OBS and decoding also works fine with supported software. Recording works but defaults to software encoding.

Steps for reproducing this issue:

  1. Open Steam
  2. Open Game
  3. Start recording

Is always reproducible on my system.

clydetm commented 2 weeks ago

This issue applies to me as well, same distro but I'm using NVIDIA (RTX 2080).

x5f3759df commented 2 weeks ago

Don't work for newly feature of game recording. On my system vainfo show no issues, but steam cannot use it. I guess this is related.

>>> Switching video stream from NONE to GameOverlay_MovieStream_552856
CGameStreamVideoStageVAAPI: Reinitializing 1920x1080 at 7500 Kbit/s and 60.00 FPS with quality 1
video libav error: Failed to initialise VAAPI connection: -1 (unknown libva error).
libav: Failed to initialise VAAPI connection: -1 (unknown libva error).
CGameStreamVideoStageVAAPI: Failed to create device context: Input/output error
Detected 12 logical processors, using 4 threads
Detected 12 logical processors, using 4 threads
Configuring encoder: [threads=4][width=1920][height=1080][preset=veryfast][tune=film]
Video Encoder Changed
>>> Saw first frame, starting a session
Game Recording - Recording Started [recording=fg_892970_20240627_095355]
user@fedora ~> vainfo
Trying display: wayland
libva info: VA-API version 1.21.0
libva info: Trying to open /usr/lib64/dri-nonfree/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri-freeworld/radeonsi_drv_video.so
libva info: Trying to open /usr/lib64/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_21
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.21 (libva 2.21.0)
vainfo: Driver version: Mesa Gallium driver 24.1.2 for AMD Radeon Graphics (radeonsi, raphael_mendocino, LLVM 18.1.6, DRM 3.57, 6.9.4-200.fc40.x86_64)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
x5f3759df commented 2 weeks ago

Looks like not my case - steam needed mesa-va-drivers-freeworld:i686, instead of x64

bargu2 commented 2 weeks ago

Replying to https://github.com/ValveSoftware/steam-for-linux/issues/11028#issuecomment-2194278887

It's pretty similar to the error I'm getting

>>> Switching video stream from NONE to GameOverlay_MovieStream_17419
CGameStreamVideoStageVAAPI: Reinitializing 1920x1080 at 12000 Kbit/s and 60.00 FPS with quality 1
video libav error: libva: /usr/lib32/dri/radeonsi_drv_video.so has no function __vaDriverInit_1_0
libav: libva: /usr/lib32/dri/radeonsi_drv_video.so has no function __vaDriverInit_1_0
video libav error: libva: dlopen of /usr/lib/dri/radeonsi_drv_video.so failed: /usr/lib/dri/radeonsi_drv_video.so: wrong ELF class: ELFCLASS64
libav: libva: dlopen of /usr/lib/dri/radeonsi_drv_video.so failed: /usr/lib/dri/radeonsi_drv_video.so: wrong ELF class: ELFCLASS64
video libav error: Failed to initialise VAAPI connection: -1 (unknown libva error).
libav: Failed to initialise VAAPI connection: -1 (unknown libva error).
CGameStreamVideoStageVAAPI: Failed to create device context: Input/output error
x5f3759df commented 2 weeks ago

Looks like my problem solved installing i686 version of mesa-va-driver on Fedora

urbenlegend commented 2 weeks ago

On my Nvidia 3090, the streaming_log.txt still seems to indicate that it is trying to use VAAPI when it should be using NVENC just like Remote Play. VAAPI initialization fails and then it falls back to libx264.

streaming_log.txt