Skip to content

Commit eedacbc

Browse files
YLouWashUfacebook-github-bot
authored andcommitted
{Feature} Packaging - Enable NVDEC GPU H.265 decoding in Linux wheels (#389)
Summary: Explanation: Turns GPU-accelerated H.265 decoding back on for Linux x86_64 wheels. Two changes that have to happen together: - `cmake/Setup3rdParty.cmake`: move the VRS pin from `2f4fc9e5` (main, Aug 3rd) to `e8cd5984` (main, Aug 6th). - `.github/workflows/build-wheels-and-deploy.yml` and `.github/workflows/test-for-build-wheels.yml`: restore `PROJECTARIA_ENABLE_CUDA=1` and the CUDA-aware `auditwheel` invocation. They are in one diff on purpose. Enabling NVDEC against the old pin is what previously produced a wheel that segfaulted on machines with no NVIDIA driver: `xprsDecoderMaker` discarded the software decoders it had already enumerated once the CUDA probe threw, and the resulting null decoder was dereferenced. Splitting these would allow the enable to land without the fix and reintroduce that crash. `e8cd5984` is the ShipIt export of "Restore SW decoder fallback in xprsDecoderMaker". At that commit the maker keeps the software decoders collected before the throw, continues to the next candidate when `init()` fails, and returns `nullptr` instead of an instance whose `decode()` failed. The wheel remains CUDA-agnostic: `libcuda` and `libnvcuvid` are excluded from `auditwheel repair` because they are dlopen'd from the driver at runtime and must never be vendored. A wheel built this way imports and decodes on a machine with no GPU, using the software decoder. Note that `BUILD_WITH_XPRS` was already forced on and is unchanged; only the NVDEC option moves. Reproducibility: Confirmed on the VRS GitHub mirror at `e8cd5984` that `vrs/utils/xprs/XprsDecoder.cpp` has the `decoders.empty()` check and `(void)xprs::enumDecoders(...)`, no longer has the `enumDecoders(decoders) != XprsResult::OK` early return, uses `continue` on `init()` failure, and ends with `return nullptr`; and that `xprs/nvDecoder.cpp` still carries the `cuvidGetDecoderCaps` pre-check and the destroy-before-recreate guard. A local configure with the new pin and no source override resolved `_deps/vrs-src` to HEAD `e8cd5984368d5c9344b79da2ba0e69876d20a976` with the fix present. Both workflows parse as valid YAML and each Linux cibuildwheel step carries the restored environment and repair command. Reviewed By: kongchen1992 Differential Revision: D115087480
1 parent ac4a15f commit eedacbc

3 files changed

Lines changed: 6 additions & 10 deletions

File tree

.github/workflows/build-wheels-and-deploy.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,8 @@ jobs:
149149
CIBW_BUILD_VERBOSITY: 3
150150
CIBW_BUILD: ${{ matrix.cibw_build }}
151151
CIBW_BEFORE_BUILD_LINUX: bash build_third_party_libs/install_manylinux_deps.sh
152-
# NVDEC GPU H.265 decode is currently disabled in the shipped wheels.
153-
# Re-enable by restoring:
154-
# CIBW_ENVIRONMENT_LINUX: "PROJECTARIA_ENABLE_CUDA=1 PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig"
155-
# CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libcuda.so.1 --exclude libnvcuvid.so.1 -w {dest_dir} {wheel}"
152+
CIBW_ENVIRONMENT_LINUX: "PROJECTARIA_ENABLE_CUDA=1 PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig"
153+
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libcuda.so.1 --exclude libnvcuvid.so.1 -w {dest_dir} {wheel}"
156154
CIBW_SKIP: "*-manylinux_i686 *-musllinux_*"
157155
CIBW_ARCHS: "x86_64"
158156
- name: Build wheels for CPython

.github/workflows/test-for-build-wheels.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- 'projectaria_tools/**'
1717
- '.github/workflows/test-for-build-wheels.yml'
1818
schedule:
19-
- cron: '0 16 * * MON' # Weekly canary, Monday 16:00 UTC = 8 AM PST / 9 AM PDT
19+
- cron: '0 16 * * MON' # Weekly canary, Monday 16:00 UTC = 8 AM PST / 9 AM PDT.
2020

2121
concurrency:
2222
group: ${{ github.workflow }}-${{ github.ref }}
@@ -148,10 +148,8 @@ jobs:
148148
CIBW_BUILD_VERBOSITY: 3
149149
CIBW_BUILD: ${{ matrix.cibw_build }}
150150
CIBW_BEFORE_BUILD_LINUX: bash build_third_party_libs/install_manylinux_deps.sh
151-
# NVDEC GPU H.265 decode is currently disabled in the shipped wheels.
152-
# Re-enable by restoring:
153-
# CIBW_ENVIRONMENT_LINUX: "PROJECTARIA_ENABLE_CUDA=1 PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig"
154-
# CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libcuda.so.1 --exclude libnvcuvid.so.1 -w {dest_dir} {wheel}"
151+
CIBW_ENVIRONMENT_LINUX: "PROJECTARIA_ENABLE_CUDA=1 PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig"
152+
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --exclude libcuda.so.1 --exclude libnvcuvid.so.1 -w {dest_dir} {wheel}"
155153
CIBW_SKIP: "*-manylinux_i686 *-musllinux_*"
156154
CIBW_ARCHS: "x86_64"
157155
- name: Build wheels for CPython

cmake/Setup3rdParty.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ FetchContent_Declare(
4040
FetchContent_Declare(
4141
vrs
4242
GIT_REPOSITORY https://github.com/facebookresearch/vrs.git
43-
GIT_TAG 2f4fc9e555311928bc4643ea251a1542216f5e74 # main Aug 3rd, 2026.
43+
GIT_TAG e8cd5984368d5c9344b79da2ba0e69876d20a976 # main Aug 6th, 2026.
4444
)
4545
# Override config for vrs
4646
option(UNIT_TESTS OFF)

0 commit comments

Comments
 (0)