Package Details: tensorrt 10.7.0.23-2

Git Clone URL: https://aur.archlinux.org/tensorrt.git (read-only, click to copy)
Package Base: tensorrt
Description: A platform for high-performance deep learning inference on NVIDIA hardware
Upstream URL: https://developer.nvidia.com/tensorrt/
Keywords: ai artificial intelligence nvidia
Licenses: Apache-2.0, LicenseRef-NVIDIA-TensorRT-SLA
Submitter: dbermond
Maintainer: dbermond
Last Packager: dbermond
Votes: 20
Popularity: 0.36
First Submitted: 2018-07-29 16:17 (UTC)
Last Updated: 2024-12-25 17:37 (UTC)

Latest Comments

1 2 3 4 5 6 .. 10 Next › Last »

thesword commented on 2024-12-26 01:20 (UTC) (edited on 2024-12-26 01:20 (UTC) by thesword)

I even have that issue before Python 3.13 with the the pre-built ones. The issue seems to come from libnvonnxparser.so binary and python bindings are required for the package python-pytorch-tensorrt.

dbermond commented on 2024-12-26 00:34 (UTC)

@thesword when you modify the PKGBUILD, you are for your own, and I cannot help you with a modified PKGBUILD. I've disabled the building of the main python bindings (and use the pre-built ones from upstream) for a reason: it fails to build, and I could not find a way to make them to build. But now now you enable it for yourself and found what I've just said: it fails to build. Do not enable it.

thesword commented on 2024-12-26 00:06 (UTC)

I modified PKGBUILD to include python bindings. I added local -x TENSORRT_MODULE="tensorrt"

diff --git a/PKGBUILD b/PKGBUILD
index 9f34781..c9454cd 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -90,20 +90,21 @@ build() {
         -Wno-dev
     cmake --build build

-    # python bindings (fails to build with python 3.11)
-    #local _pyver
-    #_pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
-    #local -x PYTHON_MAJOR_VERSION="${_pyver%%.*}"
-    #local -x PYTHON_MINOR_VERSION="${_pyver#*.}"
-    #local -x TARGET_ARCHITECTURE="$CARCH"
-    #local -x TRT_OSSPATH="${srcdir}/TensorRT"
-    #local -x CUDA_ROOT='/opt/cuda'
-    #local -x ROOT_PATH="${srcdir}/TensorRT"
-    #local -x EXT_PATH="$srcdir"
-    #local -x TRT_NONOSS_ROOT="${srcdir}/TensorRT-${pkgver}"
-    #git -C pybind11 checkout "v${_pybind11_ver}"
-    #cd TensorRT/python
-    #./build.sh
+    # python bindings
+    local _pyver
+    _pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
+    local -x PYTHON_MAJOR_VERSION="${_pyver%%.*}"
+    local -x PYTHON_MINOR_VERSION="${_pyver#*.}"
+    local -x TARGET_ARCHITECTURE="$CARCH"
+    local -x TRT_OSSPATH="${srcdir}/TensorRT"
+    local -x CUDA_ROOT='/opt/cuda'
+    local -x ROOT_PATH="${srcdir}/TensorRT"
+    local -x EXT_PATH="$srcdir"
+    local -x TRT_NONOSS_ROOT="${srcdir}/TensorRT-${pkgver}"
+    local -x TENSORRT_MODULE="tensorrt"
+    git -C pybind11 checkout "v${_pybind11_ver}"
+    cd TensorRT/python
+    ./build.sh

     # python tools (pytorch-quantization currently fails to build)
     local _dir
@@ -132,9 +133,9 @@ package_tensorrt() {
 }

 package_python-tensorrt() {
-    #pkgdesc+=' (python bindings and tools)'
+    pkgdesc+=' (python bindings and tools)'
     pkgdesc+=' (python tools)'
-    #license=('LicenseRef-Custom' 'Apache-2.0')
+    license=('LicenseRef-Custom' 'Apache-2.0')
     license=('Apache-2.0')
     depends=('python' 'python-numpy' 'tensorrt')
     optdepends=('python-onnx: for onnx_graphsurgeon python module'
@@ -149,6 +150,7 @@ package_python-tensorrt() {
     #local _pyver
     #_pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
     #python -m installer --destdir="$pkgdir" "TensorRT-${pkgver}/python/tensorrt-${pkgver%.*}-cp${_pyver/./}-none-linux_${CARCH}.whl"
+    python -m installer --destdir="$pkgdir" "TensorRT/python/build/bindings_wheel/dist/tensorrt-${pkgver%.*}-py3-none-any.whl"

     local _dir
     for _dir in TensorRT/tools/{onnx-graphsurgeon,Polygraphy,tensorflow-quantization}/dist

But now I got:

Python 3.13.1 (main, Dec  4 2024, 18:05:56) [GCC 14.2.1 20240910] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import tensorrt
  File "/usr/lib/python3.13/site-packages/tensorrt/__init__.py", line 75, in <module>
    from .tensorrt import *
ImportError: /usr/lib/libnvonnxparser.so.10: undefined symbol: _ZTIN8onnx2trt16OnnxTrtExceptionE

dbermond commented on 2024-12-25 17:37 (UTC) (edited on 2024-12-25 17:37 (UTC) by dbermond)

@thesword Package updated. Disabled installation of the main tensorrt python bindings, as upstream currently does not support python 3.13 yet. I will enable it again when/if upstream supports python 3.13. Thanks for reporting.

thesword commented on 2024-12-25 15:14 (UTC)

It doesn't build anymore sice Python 3.13 update

==> Starting package_python-tensorrt()...
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib/python3.13/site-packages/installer/__main__.py", line 98, in <module>
    _main(sys.argv[1:], "python -m installer")
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/installer/__main__.py", line 86, in _main
    with WheelFile.open(args.wheel) as source:
         ~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/lib/python3.13/contextlib.py", line 141, in __enter__
    return next(self.gen)
  File "/usr/lib/python3.13/site-packages/installer/sources.py", line 162, in open
    with zipfile.ZipFile(path) as f:
         ~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/zipfile/__init__.py", line 1362, in __init__
    self.fp = io.open(file, filemode)
              ~~~~~~~^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'TensorRT-10.7.0.23/python/tensorrt-10.7.0-cp313-none-linux_x86_64.whl'
==> ERROR: A failure occurred in package_python-tensorrt().
    Aborting...

dbermond commented on 2024-12-19 03:26 (UTC)

@sots removing the unneeded patch is already on my radar, thanks for pointing anyway. The build jobs/parallelism is a user setting and should be configured in your 'makepkg.conf'.

sots commented on 2024-12-19 01:55 (UTC)

Recommended patch for PKGBUILD:

--- a/PKGBUILD
+++ b/PKGBUILD
@@ -27,7 +27,6 @@ source=("https://developer.nvidia.com/downloads/compute/machine-learning/tensorr
         "https://github.com/google/protobuf/releases/download/v${_protobuf_ver}/protobuf-cpp-${_protobuf_ver}.tar.gz"
         '010-tensorrt-use-local-protobuf-sources.patch'
         '020-tensorrt-fix-python.patch'
-        '030-tensorrt-onnx-tensorrt-disable-missing-source-file.patch'
         'TensorRT-SLA.txt')
 noextract=("protobuf-cpp-${_protobuf_ver}.tar.gz")
 sha256sums=('d7f16520457caaf97ad8a7e94d802f89d77aedf9f361a255f2c216e2a3a40a11'
@@ -41,7 +40,6 @@ sha256sums=('d7f16520457caaf97ad8a7e94d802f89d77aedf9f361a255f2c216e2a3a40a11'
             'dddd73664306d7d895a95e1cf18925b31b52785e468727e4635b45edae5166f9'
             'ba94c0685216fe9566f7989df98b372e72a8da04b66d64380024107f2f7f4a8f'
             '62109d798ecfe286aa12d8c848927baa074b422669fb6248590a7ae00074ab26'
-            '5b90eb795c5d7a209a67c7aad73f3b472650e52c0c42f8cd15b43b5a6c6396c4'
             'c493df1b40477f750d9840a1b0b6cf5ec36c1b6bde3bcd6c7029e27e60df3c58')

 prepare() {
@@ -73,7 +71,7 @@ prepare() {
     patch -d TensorRT -Np1 -i "${srcdir}/020-tensorrt-fix-python.patch"

     # https://github.com/onnx/onnx-tensorrt/issues/979
-    patch -d TensorRT/parsers/onnx -Np1 -i "${srcdir}/030-tensorrt-onnx-tensorrt-disable-missing-source-file.patch"
+    # patch -d TensorRT/parsers/onnx -Np1 -i "${srcdir}/030-tensorrt-onnx-tensorrt-disable-missing-source-file.patch"
 }

 build() {
@@ -88,7 +86,7 @@ build() {
         -DGPU_ARCHS='50 52 53 60 61 62 70 72 75 80 86 87 89 90' \
         -DPROTOBUF_VERSION="$_protobuf_ver" \
         -Wno-dev
-    cmake --build build
+    cmake --build build -j "$(nproc)"

     # python bindings (fails to build with python 3.11)
     #local _pyver

juliusk commented on 2024-12-03 01:21 (UTC) (edited on 2024-12-03 01:21 (UTC) by juliusk)

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files: nvinfer_LIB_PATH

whiteLinux commented on 2024-11-10 05:12 (UTC)

030-tensorrt-onnx-tensorrt-disable-missing-source-file.patch is no longer needed.The annotated file "errorHelpers.cpp" provide _ZTIN8onnx2trt16OnnxTrtExceptionE define.python-onnx package also include this file,so install python-onnx will fix it

dbermond commented on 2024-11-02 14:47 (UTC)

@jholmer try to rebuild the python-onnx package and use it. For rebuilding, use the PKGBUILD from the official repositories (can be found in this link). If if works, please open a bug report for python-onnx.