You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
obs-ffmpeg: VAAPI encoder probe takes 2.7 s of startup on NVIDIA machines #1168
On a machine with two NVIDIA GPUs (RTX 3060 + RTX 2080 Ti, driver 595.99, KDE Wayland), obs_init_module(obs-ffmpeg.so) takes 2.6–2.7 s of a ~4.0 s startup (OBS profiler, AppImage from master).
Cause, measured with timing logs around the libva calls:
h264_vaapi_supported(), av1_vaapi_supported() and hevc_vaapi_supported() each walk every /dev/dri/renderD* node and open it again with vaInitialize → 3 codecs × 2 nodes = 6 opens.
For the nvidia kernel driver libva loads nvidia-vaapi-driver, whose vaInitialize initialises CUDA: 0.45–0.8 s per open. That driver cannot encode at all (README: "Hardware decoding only, encoding is not supported"), so every open ends in "not supported".
Each open also leaves CUDA contexts in the process (~27 MiB RSS).
Fix
Probe each render node once, for all three codecs, and keep the answer (the encoders' property pages ask again later).
Open the render nodes in parallel.
Do not open a node whose kernel driver is nvidia unless LIBVA_DRIVER_NAME picks another VA driver.
The decisions go into plugins/obs-ffmpeg/vaapi-probe-policy.c, tested by test/cmocka/test_vaapi_probe_policy.c (RED, then GREEN).
Measured on that machine (median of interleaved runs, launch → main window mapped): 3.98 s → 1.39 s, RSS 320 → 293 MiB.
Activity
zackees commentedon Oct 17, 2026
Claiming: branch
fix/vaapi-startup-probe.test: VAAPI probe skips decode-only drivers and opens each device onc…
obs-ffmpeg: Probe each VAAPI device once and skip decode-only drivers…
obs-nvenc: Reuse obs-nvenc-test's answer while the driver, GPUs and t…
obs-nvenc: Reuse obs-nvenc-test's answer while the driver, GPUs and t…
docs: Launch-speed results graphic in the README