Repository navigation
obs-ffmpeg: Probe each VAAPI device once and skip decode-only drivers - #1175
Merged
Merged
Conversation
This was referenced Oct 17, 2026
…e (RED, Refs #1168) test_vaapi_probe_policy (tests.d) checks the decisions behind the obs-ffmpeg VAAPI encoder probe against stubs in vaapi-probe-policy.c.h, its own unity group (BUILD.md) so the test builds it without libva: the nvidia kernel driver (nvidia-vaapi-driver, decode only) is not opened unless LIBVA_DRIVER_NAME picks another VA driver, and a device answers all three codec queries from one probe. Fails: nvidia_kernel_driver_is_decode_only, each_device_is_probed_once, added_answers_are_used_and_kept.
… (GREEN, Fixes #1168) Every codec query (H.264, AV1, HEVC) opened every render node again, and for the nvidia kernel driver each vaInitialize loads nvidia-vaapi-driver, which initialises CUDA (0.45-0.8 s) only to report that it cannot encode. On a machine with two NVIDIA GPUs that was 2.7 s of a 4 s start. - vaapi-probe-policy.c.h: a device's answer for all three codecs is probed once and kept; a node whose kernel driver is nvidia is not opened unless LIBVA_DRIVER_NAME picks another VA driver. - vaapi-utils.c.h: the render nodes are opened in parallel, one thread each. - The cache is freed on unload (no bmem leak). Launch to main window, median of interleaved runs (2x NVIDIA, KDE Wayland): 4.28 s -> 1.42 s; RSS 327 -> 298 MiB (no CUDA contexts in the process). test_vaapi_probe_policy: 5/5.
zackees
force-pushed
the
fix/vaapi-startup-probe
branch
from
October 17, 2026 06:39
5374201 to
b4df4e2
Compare
Member
Author
|
Rebuilt on master after the BUILD.md unity-group conversion of this plugin (and #1184's Fast Gate fix): the policy/cache code is now |
3 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1168
RED (first commit):
test_vaapi_probe_policyagainst stubs failsnvidia_kernel_driver_is_decode_only,each_device_is_probed_once,added_answers_are_used_and_kept.GREEN: 5/5.
./unittestTier 2: 271/272, the one failuretest_deinterlace_2x_field_orderis the known load-sensitive test (#456), unrelated.vaapi-probe-policy.c(libva-free, tested): one probe per device for all three codecs; nodes driven by thenvidiakernel driver are not opened (nvidia-vaapi-driver is decode-only) unlessLIBVA_DRIVER_NAMEpicks another VA driver.vaapi-utils.c: render nodes probed in parallel; cache freed on unload (0 leaks).Measured, launch → main window mapped, median of interleaved runs (2× NVIDIA, KDE Wayland): 4.32 s → 1.43 s; RSS 327 → 298 MiB (no CUDA contexts in-process). Tiers: Tier 2 (cmocka) only; no Rust port involved.