Skip to content

Python 3.15 bindings: OSS BUILD_PYTHON build works, but wheel packaging fails (missing bindings_wheel/pyproject.toml) and 3.15 is not in the version list #4890

Open

Description

@KRRT7

Description

We need TensorRT Python bindings for CPython 3.15, which reached final release this month. The OSS tree builds them without source changes, but two things in the repo get in the way, and no cp315 wheels are published yet on PyPI or pypi.nvidia.com.

1. The OSS build cannot package a wheel. With -DBUILD_PYTHON=ON, ninja refuses to start:

ninja: error: '/work/src/trt/python/packaging/bindings_wheel/pyproject.toml', needed by
'python/packaging/bindings_wheel/tensorrt_binding-py3.15/Release/pyproject.toml',
missing and no known rule to make it

python/packaging/bindings_wheel/CMakeLists.txt references pyproject.toml, but the directory only contains CMakeLists.txt, LICENSE.txt and tensorrt/, on both v11.3 and main. This affects every Python version, not just 3.15. Building only the tensorrt_bindings_tensorrt_<ver> target works around it.

2. 3.15 is missing from the version list. python/CMakeLists.txt hardcodes BUILD_PYTHON_PY_VERSIONS 3.8 ... 3.14 (also on main). The OSS BUILD_PYTHON path overrides this with the interpreter's version, so it didn't block us, but the official wheel builds presumably use this list.

What we verified

Built against the 11.3.0.99 GA libraries (CUDA 13.4, Linux x86_64), with CPython 3.15.0 and the repo's pinned pybind11 v3.0.1:

cmake <TRT_OSS> -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$TRT_ROOT \
  -DBUILD_PYTHON=ON -DBUILD_PLUGINS=OFF -DBUILD_PARSERS=OFF -DBUILD_SAMPLES=OFF \
  -DPython3_EXECUTABLE=<python3.15> -DTRT_BUILD_PYTHON_PY_VERSIONS=3.15 \
  -DTRT_BUILD_PYTHON_EXTERNALS_PATH=<prefix>/include
ninja tensorrt_bindings_tensorrt_3.15

The resulting tensorrt.so, dropped into the official cp314 wheel layout and retagged cp315, behaves the same as the official cp314 wheel on 3.14 in the same container: it imports, reports 34 plugin creators, tensorrt.plugin imports, and pybind11 calls from a non-main thread work. Without a GPU, trt.Builder fails identically on both ("CUDA driver version is insufficient"). We have not run engine builds or inference on a GPU with the cp315 build.

Ask

  • Add python/packaging/bindings_wheel/pyproject.toml (or remove the dependency on it) so the OSS wheel step works.
  • Add 3.15 to BUILD_PYTHON_PY_VERSIONS and publish cp315 tensorrt-cu13-bindings / tensorrt wheels.

Unrelated, but seen in both versions: tensorrt/plugin/_lib.py, _tensor.py and _top_level.py emit SyntaxWarning: "\s" is an invalid escape sequence from docstrings (:class:`X`\s). These become errors under -W error; raw docstrings would fix them.

Environment

  • TensorRT 11.3.0.99 (OSS tag v11.3), GA tarball TensorRT-Enterprise-11.3.0.99-Linux-x86_64-cuda-13.4
  • nvidia/cuda:13.4.1-devel-ubuntu24.04 (linux/amd64)
  • CPython 3.15.0 / 3.15.1, CMake 4.4.4

Activity

  1. added
    Module:OSS Build
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Module:OSS Build

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions