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

Aperta
#282 1 commento 0 reazioni 2 assegnatari Vedi su GitHub

@rrawther ci sta già lavorando.

Dal 3/9/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
C++
Stelle
8
Fork
13
Merge medio
2g 1h
PR unite (30g)
6

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ROCm/rocPyDecode

Tutte le issue di ROCm/rocPyDecode

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.