external/meta-python: update python3-tensorrt to 10.3.0

* Python package files moved to a subdirectory
* Need to use gitsm:// to pick up the onnx parser submodule
* Refresh the build-related changes and patch

Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
Matt Madison
2024-10-14 04:54:53 -07:00
committed by Matt Madison
parent 383596fb08
commit 491904be3c
2 changed files with 24 additions and 57 deletions

View File

@@ -1,63 +1,27 @@
From 800ade095be320586162e08fe8dc94db56f8493f Mon Sep 17 00:00:00 2001
From a007d9400002107b044774c688ac327f0df22fa2 Mon Sep 17 00:00:00 2001
From: Matt Madison <matt@madison.systems>
Date: Fri, 11 Mar 2022 11:20:55 -0800
Date: Mon, 14 Oct 2024 02:19:11 -0700
Subject: [PATCH] Fixups for cross building in OE
Upstream-Status: Inappropriate [OE-specific]
Signed-off-by: Matt Madison <matt@madison.systems>
---
python/CMakeLists.txt | 9 ++-------
python/include/ForwardDeclarations.h | 2 +-
2 files changed, 3 insertions(+), 8 deletions(-)
python/CMakeLists.txt | 5 -----
1 file changed, 5 deletions(-)
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 5672db9..5f46c90 100644
index 49f5d8a1..9f891ffe 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -36,11 +36,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tensorrt/)
set(CPP_STANDARD 11 CACHE STRING "CPP Standard Version")
@@ -38,11 +38,6 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${TENSORRT_MODULE}/)
set(CPP_STANDARD 14 CACHE STRING "CPP Standard Version")
set(CMAKE_CXX_STANDARD ${CPP_STANDARD})
-if (NOT MSVC)
- # This allows us to use TRT libs shipped with standalone wheels.
- set(CMAKE_SHARED_LINKER_FLAGS -Wl,-rpath=$ORIGIN)
- set(CMAKE_SHARED_LINKER_FLAGS -Wl,-rpath=$ORIGIN:$ORIGIN/../${TENSORRT_MODULE}_libs)
-endif()
-
set(PY_MODULE_NAME tensorrt)
# -------- PATHS --------
@@ -58,7 +53,7 @@ set_ifndef(WIN_EXTERNALS ${EXT_PATH})
message(STATUS "WIN_EXTERNALS: ${WIN_EXTERNALS}")
# Convert to an absolute path.
-set_ifndef(ONNX_INC_DIR ${TENSORRT_ROOT}/parsers/)
+set_ifndef(ONNX_INC_DIR ${TENSORRT_ROOT}/parsers/onnx/)
find_path(PYBIND11_DIR pybind11/pybind11.h HINTS ${EXT_PATH} ${WIN_EXTERNALS} PATH_SUFFIXES pybind11/include)
message(STATUS "ONNX_INC_DIR: ${ONNX_INC_DIR}")
@@ -114,7 +109,7 @@ if (MSVC)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
endif()
else()
- set(CMAKE_CXX_FLAGS "-fvisibility=hidden -std=c++${CPP_STANDARD} -Wno-deprecated-declarations")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -std=c++${CPP_STANDARD} -Wno-deprecated-declarations")
endif()
# Update linker
diff --git a/python/include/ForwardDeclarations.h b/python/include/ForwardDeclarations.h
index d9d891a..9a6c7a7 100644
--- a/python/include/ForwardDeclarations.h
+++ b/python/include/ForwardDeclarations.h
@@ -32,7 +32,7 @@ using ssize_t = int64_t;
#include "NvInfer.h"
#include "NvInferPlugin.h"
#include "NvUffParser.h"
-#include "onnx/NvOnnxParser.h"
+#include "NvOnnxParser.h"
// We need to avoid making copies of PluginField because it does not own any of it's members.
// When there are multiple PluginFields pointing to the same data in Python, bad things happen.
--
2.32.0
message(STATUS "EXT_PATH: ${EXT_PATH}")
message(STATUS "TENSORRT_BUILD: ${TENSORRT_BUILD}")

View File

@@ -1,7 +1,7 @@
SUMMARY = "Python bindings for TensorRT"
HOMEPAGE = "http://developer.nvidia.com/tensorrt"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://python/packaging/LICENSE.txt;md5=c291e0a531e08d4914e269730ba2f70d"
LIC_FILES_CHKSUM = "file://python/packaging/bindings_wheel/LICENSE.txt;md5=0f58ca2991dd21e8f5c268a18ac2535b"
DEPENDS = "python3-pybind11 tensorrt-core tensorrt-plugins"
@@ -10,19 +10,20 @@ COMPATIBLE_MACHINE = "(tegra)"
inherit setuptools3 cmake cuda
SRC_REPO = "github.com/NVIDIA/TensorRT.git;protocol=https"
SRCBRANCH = "release/8.5"
SRC_URI = "git://${SRC_REPO};branch=${SRCBRANCH} \
SRCBRANCH = "release/10.3"
SRC_URI = "gitsm://${SRC_REPO};branch=${SRCBRANCH} \
file://0001-Fixups-for-cross-building-in-OE.patch \
"
# 8.5.2 tag
SRCREV = "ad932f72126f875392a4336d9ee45b2756d934a0"
# v10.3.0 tag
SRCREV = "c5b9de37f7ef9034e2efc621c664145c7c12436e"
S = "${WORKDIR}/git"
OECMAKE_SOURCEPATH = "${S}/python"
SETUPTOOLS_SETUP_PATH = "${B}"
EXTRA_OECMAKE = "-DONNX_INC_DIR=${STAGING_INCDIR} -DPYBIND11_DIR=${STAGING_DIR_TARGET} \
EXTRA_OECMAKE = "-DTENSORRT_ROOT=${S} -DTENSORRT_LIBPATH=${STAGING_LIBDIR} -DTENSORRT_MODULE=tensorrt \
-DCUDA_INCLUDE_DIRS=${CUDA_PATH}/include \
-DTARGET=${HOST_ARCH} -DCMAKE_BUILD_TYPE=Release \
-DPY_INCLUDE=${STAGING_INCDIR}/${PYTHON_DIR} -DEXT_PATH=${STAGING_INCDIR}"
@@ -38,15 +39,17 @@ do_configure() {
TRT_MAJMINPATCH=${TRT_MAJOR}.${TRT_MINOR}.${TRT_PATCH}
varsubst() {
sed -e "s|\#\#TENSORRT_VERSION\#\#|${TRT_VERSION}|g" \
-e "s|\#\#TENSORRT_MAJMINPATCH\#\#|${TRT_MAJMINPATCH}|g" $1 >$2
-e "s|\#\#TENSORRT_MAJMINPATCH\#\#|${TRT_MAJMINPATCH}|g" \
-e "s|\#\#TENSORRT_PYTHON_VERSION\#\#|${TRT_MAJMINPATCH}|g" \
-e "s|\#\#TENSORRT_MODULE\#\#|tensorrt|g" $1 >$2
}
rm -rf ${B}/tensorrt
mkdir ${B}/tensorrt
varsubst ${S}/python/packaging/setup.cfg ${B}/setup.cfg
varsubst ${S}/python/packaging/setup.py ${B}/setup.py
varsubst ${S}/python/packaging/tensorrt/__init__.py ${B}/tensorrt/__init__.py
cp ${S}/python/packaging/LICENSE.txt ${B}/
varsubst ${S}/python/packaging/bindings_wheel/setup.cfg ${B}/setup.cfg
varsubst ${S}/python/packaging/bindings_wheel/setup.py ${B}/setup.py
varsubst ${S}/python/packaging/bindings_wheel/tensorrt/__init__.py ${B}/tensorrt/__init__.py
cp ${S}/python/packaging/bindings_wheel/LICENSE.txt ${B}/
}
do_compile() {