Packaging - Add pinned pybind11 dependency and align dlpack version with rocCV (v1.3) for hermetic builds

Open
#282 1 comment 0 reactions 2 assignees View on GitHub

@rrawther is already working on this.

Since Sep 3, 2026.

Assessment

This issue has not been assessed yet.

Description

enhancement

Problem

rocPyDecode has two related dependency issues that affect hermetic build environments like TheRock's manylinux pipeline:

1. pybind11 version is unpinned

CMakeLists.txt uses find_package(pybind11 REQUIRED) with no version constraint, resolving to whatever the system provides. This means:

  • Different build hosts can produce binaries linked against different pybind11 versions
  • manylinux container (RHEL-based, no -devel system packages) has no pybind11 at all — the build will fail silently or pick up an incompatible version

The companion library rocCV python/CMakeLists.txt pins pybind11 at v3.0.2 via FetchContent. rocPyDecode should be aligned to the same major version (v3.x).

2. dlpack version mismatch with rocCV

rocPyDecode's FindDLPACK.cmake searches for dlpack/dlpack.h in system paths and $ROCM_PATH/include with no version check. It accepts dlpack v1.0 (the version documented in rocPyDecode-requirements.py).

rocCV pins dlpack at v1.3. When both libraries are built together in a super-project, they must agree on a single dlpack version. Since minor-version bumps are additive (same major = 1), v1.3 is a drop-in superset of v1.0, but the discrepancy is a maintenance hazard.

3. FindDLPACK.cmake cannot be overridden by a super-project

The current FindDLPACK.cmake only searches system paths and $ROCM_PATH/include. A super-project that vendors dlpack at a specific location and passes -DDLPACK_DIR=/path cannot reliably redirect the search — the module ignores DLPACK_DIR as a CMake variable (it reads the env var $ENV{DLPACK_DIR} instead).

Requested changes

  1. Pin pybind11 to v3.0.x (matching rocCV). Prefer find_package(pybind11 3.0 QUIET) first so super-projects can provide it via -Dpybind11_DIR=, with FetchContent as fallback for standalone builds:
find_package(pybind11 3.0 QUIET CONFIG)
if(NOT pybind11_FOUND)
  FetchContent_Declare(
      pybind11
      URL https://github.com/pybind/pybind11/archive/refs/tags/v3.0.4.tar.gz
      URL_HASH SHA256=<hash>
      EXCLUDE_FROM_ALL
  )
  FetchContent_MakeAvailable(pybind11)
endif()
  1. Align dlpack to v1.3 (matching rocCV). Update FindDLPACK.cmake to also honour the DLPACK_DIR CMake variable (not just the environment variable), so super-projects can pass -DDLPACK_DIR=/path:
find_path(DLPACK_INCLUDE_DIRS
    NAMES dlpack/dlpack.h
    HINTS
    ${DLPACK_DIR}/include        # CMake variable (super-project override)
    $ENV{DLPACK_DIR}/include     # env variable (existing behaviour)
    $ENV{ROCM_PATH}/include
    PATHS
    ${ROCM_PATH}/include
    /usr/include
    /usr/local/include
)

These changes are backward-compatible — standalone builds continue to work exactly as before, while hermetic super-project builds can supply pinned versions without network access.

Dominant language
C++
Stars
8
Forks
13
Avg merge
2d 1h
Merged PRs (30d)
6

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ROCm/rocPyDecode

All issues in ROCm/rocPyDecode

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.