protonscr

NVENC doesn't work for Game Recordings

steamopen NVIDIA driversStreaming
ValveSoftware/steam-for-linux#11919 · opened 2025-04-20 by x5f3759df · updated 2025-04-20 · 1 comments · github
Xx5f3759df 2025-04-20 github

Your system information

  • Steam client version (build number or date): 1743554648
  • Distribution (e.g. Ubuntu): Fedora 42
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes
  • Steam Logs: [generate by running this command in a terminal tar -zcvf ~/Desktop/steam-logs.tar.gz ~/.steam/steam/logs]
  • GPU: Nvidia (RTX 5070, 575.51.02 BETA drivers installed via binary from site)

Please describe your issue in as much detail as possible:

NVENC doesn't work for Game Recordings. It fails to init and Steam use CPU for encode videos.

>>> Switching video stream from NONE to GameOverlay_MovieStream_36691
Building new pipeline
Trying to create an encoder for recording: [hardware_enabled=true][hardware_suppressed=false]
Allowed Codecs: 4
NVENC - couldn't create context: 999
Created encoder VAAPI for codec 4
CGameStreamVideoStageVAAPI: Reinitializing 1920x1080 at 12000 Kbit/s and 60.00 FPS with quality 1
libav: libva: /usr/lib/dri/nvidia_drv_video.so init failed

libav: libva: /usr/lib/dri/nvidia_drv_video.so init failed
libav: Failed to initialise VAAPI connection: 1 (operation failed).

libav: Failed to initialise VAAPI connection: 1 (operation failed).
CGameStreamVideoStageVAAPI: Failed to create device context: Input/output error
Failed to pre-process frame
CGameStreamVideoStageVAAPI: Reinitializing 1920x1080 at 12000 Kbit/s and 60.00 FPS with quality 1
libav: libva: /usr/lib/dri/nvidia_drv_video.so init failed

libav: libva: /usr/lib/dri/nvidia_drv_video.so init failed
libav: Failed to initialise VAAPI connection: 1 (operation failed).

libav: Failed to initialise VAAPI connection: 1 (operation failed).
CGameStreamVideoStageVAAPI: Failed to create device context: Input/output error
Failed to pre-process frame
Encoder stage failed [type=5, codec=4]
Building new pipeline
Trying to create an encoder for recording: [hardware_enabled=true][hardware_suppressed=false]
Allowed Codecs: 4
Failed encoders: 2/4, 4/4, 5/4
Created encoder X264 for codec 4
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_12130_20250420_214442]
>>> First audio pts is 38914.225885s
>>> Recording new resolution 1920x1080 using bitrate 12000kbps
>>> Capture method set to Game Delayed OpenGL NV12 + libx264 high (4 threads)
>>> First video pts is 38914.209125s, first video PTS is 0.000000s
Manual recording for game 12130, no retention interval
>>> Audio deltas: first audio frame 38914.225885s, first video frame 38914.209125s, first video PTS 0.000000s. Resulting first audio sample is 804 (0.016750s)
Encoding complete
Video capture state changed
PulseAudio: Context connection terminated
Game Recording - Recording Stopped [recording=fg_12130_20250420_214442]

Steps for reproducing this issue:

  1. Run any game with Steam overlay
  2. Run Game Recording via hotkey
  3. See that steam use CPU via top or else

Libva works fine, also mpv or any other player in the system use NV encoder/decoder without any problems (gpu-screen-recorder for example).

user@fedora ~> vainfo
Trying display: wayland
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib64/dri-nonfree/nvidia_drv_video.so
libva info: Trying to open /usr/lib64/dri-freeworld/nvidia_drv_video.so
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_0
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: VA-API NVDEC driver [direct backend]
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain12             :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointVLD
      VAProfileHEVCMain444_10         :	VAEntrypointVLD
      VAProfileHEVCMain444_12         :	VAEntrypointVLD
Xx5f3759df 2025-04-20 github

To clarify more - I have installed both i686 and x86_64 libva-nvidia packages

user@fedora ~> rpm -qa | grep libva-nvidia
libva-nvidia-driver-0.0.13^20250118gitc519e97-1.fc42.i686
libva-nvidia-driver-0.0.13^20250118gitc519e97-1.fc42.x86_64

Nothing extracted yet.