Commit d4bbe47
{CUDA Decoding} Restore SW decoder fallback in xprsDecoderMaker
Summary:
The CUDA-enabled Linux wheel segfaults on any machine without an NVIDIA driver. The GitHub CI "Test wheel" job crashes with exit 139 after a burst of:
Cannot load libcuda.so.1
[XPRS][WARNING]: Loading CUDA functions failed
[DecoderFactory][WARNING]: Could not create a decoder for 'H.265'!
Root cause: the SW-fallback fixes intended for `arvr/libraries/vrs/utils/xprs/XprsDecoder.cpp` never landed. The landed commit for D103253728 (`a4556645655d`) touched only the four `arvr/projects/compression/xprs/` files -- the `XprsDecoder.cpp` hunks were dropped somewhere during rebasing, even though the reviewed diff contained them. The same happened to the monochrome-skip hunks from D110227872. Internal master's copy of this file was last modified 2026-04-29, so ShipIt correctly exported a file that had never received the fixes.
Consequence: with no `libcuda`, `getNvCodecContext()` throws, `enumDecoders()` catches it and returns non-OK -- while still having collected the SW `hevc`/`h264` decoders. The stale `xprsDecoderMaker` bails on the non-OK result (`if (xprs::enumDecoders(decoders) != XprsResult::OK) return nullptr;`) without ever looking at those SW decoders, so no decoder is created and the null decoder is later dereferenced.
This re-applies the four lost changes to that file:
- Tolerate a non-OK `enumDecoders()` result; fail only when the decoder list is genuinely empty. (Fixes the crash.)
- On decoder `init()` failure, `continue` to the next decoder instead of returning `nullptr`, so HW->SW fallback works.
- Downgrade the recoverable HW->SW decode-probe log from `XR_LOGE` to `XR_LOGW`.
- Skip HW decoders up front for monochrome streams (`isMonochromePixelFormat`), which NVDEC cannot decode.
No change to the GPU path: color streams still select `hevc_cuvid`.
Reviewed By: kongchen1992
Differential Revision: D1148064131 parent 2f4fc9e commit d4bbe47
1 file changed
Lines changed: 46 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
96 | 112 | | |
97 | 113 | | |
98 | 114 | | |
| |||
337 | 353 | | |
338 | 354 | | |
339 | 355 | | |
340 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
341 | 361 | | |
342 | 362 | | |
343 | 363 | | |
| |||
373 | 393 | | |
374 | 394 | | |
375 | 395 | | |
376 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
377 | 403 | | |
378 | 404 | | |
379 | 405 | | |
| |||
388 | 414 | | |
389 | 415 | | |
390 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
391 | 428 | | |
392 | 429 | | |
393 | 430 | | |
394 | 431 | | |
395 | 432 | | |
396 | 433 | | |
397 | | - | |
398 | | - | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
399 | 440 | | |
400 | 441 | | |
401 | 442 | | |
402 | | - | |
| 443 | + | |
403 | 444 | | |
404 | 445 | | |
405 | 446 | | |
| |||
0 commit comments