ConcurrentReal-Time-Logo

リアルタイムテクニカルドキュメント 最終更新 2025.03.28

外部リンクを除く、以下のドキュメントの著作権は、特に記載の無い限りConcurrent Real-Time社に帰属します。
下記ドキュメントの弊社を除く営利目的の利用は禁じますが、ウィキペディアからの参照や社内教育、
大学等の非営利の目的であれば、ご自身の責任において自由に利用して頂いてかまいません。
ドキュメントの内容は予告無く変更する事がありますが、出来る限りリンクが消滅しないように保存しています。
ここに、記載した商品名は、一般に各社の商標または登録商標です。
外部リンク先の著作権及び個人情報保護ポリシーは、各サイトの著作権表示及び個人情報保護ポリシーをご覧ください。弊社著作権についてのポリシー及び個人情報保護ポリシーは、 [hand.right] こちらをご覧ください。
外部サイトへのリンクはで示されています。

Google の開発したTensorFlowはモデル設計からトレーニング、推論まで幅広い段階でCPUだけでも、GPUを利用することも可能です。
一方、Nvidiaの開発したTensorRTは主にトレーニング後の推論段階で使用されGPUが必須です。
トレーニング済みのモデルをGPU向けに最適化することで、リアルタイム推論や高速処理が求められる場面で高い性能を発揮します。

[images/hand.right] TensorFlow for C のインストール方法
TensorFlowは、Googleが開発しオープンソースで公開している、機械学習に用いるためのソフトウェアライブラリです。
TensorFlow for C のインストールに従ってインストールすれば良いのですが、下記にRedHawk8.4に インストールする方法と注意点を示します

ダウンロード
CPU のみ
# wget https://storage.googleapis.com/tensorflow/versions/2.18.1/libtensorflow-cpu-linux-x86_64.tar.gz

GPU サポート
# wget https://storage.googleapis.com/tensorflow/versions/2.18.1/libtensorflow-gpu-linux-x86_64.tar.gz

解凍

ダウンロードしたアーカイブを解凍します。アーカイブには、C プログラムに含めるヘッダー ファイルと、リンク先の共有ライブラリが含まれています。

RedHawk では /usr/local/lib に展開できます。

# tar -C /usr/local -xzf libtensorflow-gpu-linux-x86_64.tar.gz
リンカー

RedHawk 上で、TensorFlow の C ライブラリをシステム ディレクトリ(/usr/local など)に解凍した場合は、ldconfig を使ってリンカーを再構成します。
# ldconfig
リンカー環境変数の構成

TensorFlow の C ライブラリをリンクする様に、リンカー環境変数を構成します。

/etc/bashrcか、~/.bashrcに下記を加えます

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib:/usr/local/cuda
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib64:/usr/local/lib:/usr/local/cuda/lib64

ビルド
サンプル プログラム
TensorFlow の C ライブラリをインストールした後、以下のソースコード(hello_tf.c)を使ってサンプルプログラムを作成します。
#include <stdio.h>
#include <tensorflow/c/c_api.h>

int main() {
  printf("Hello from TensorFlow C library version %s\n", TF_Version());
  return 0;
}
コンパイル
サンプル プログラムをコンパイルして実行可能ファイルを作成し、次のように実行します。
# gcc hello_tf.c -ltensorflow -o hello_tf
# ./hello_tf
Hello from TensorFlow C library version 2.18.1
注意:
cuda-12をrpmではなく、runファイルを利用してインストールしていた場合、下記のコマンドを実行して、alternativesコマンドで管理できるように設定して下さい。
# update-alternatives --install /usr/local/cuda cuda /usr/local/cuda-12.4 124
# update-alternatives --install /usr/local/cuda-12 cuda-12 /usr/local/cuda-12.4 124
# alternatives --config cuda

2 プログラムがあり 'cuda' を提供します。

  選択       コマンド
-----------------------------------------------
 + 1           /usr/local/cuda-11.4
*  2           /usr/local/cuda-12.4

Enter を押して現在の選択 [+] を保持するか、選択番号を入力します: 2
[images/hand.right] TensorFlow2をソースからビルドする 方法
下記に動作が確認できたTensorflow2.19.0のソースビルドの方法を示します。
なお、すべてのインストールにネットワークが必要でローカルには、コンパイルできません。(bazelはソースコードをダウンロードしながらコンパイルインストールします)

事前インストール
   clang18.1.8-1

        # dnf install clang

   python3.12

        # dnf install python3.12-requests.noarch python3-pip
        # alternatives --config python

        5 プログラムがあり 'python' を提供します。

          選択       コマンド
        -----------------------------------------------
        *+ 1           /usr/libexec/no-python
           2           /usr/bin/python2
           3           /usr/bin/python3
           4           /usr/bin/python3.11
           5           /usr/bin/python3.12

        Enter を押して現在の選択 [+] を保持するか、選択番号を入力します:5

        # python -V
        Python 3.12.8

        # alternatives --config python3

        3 プログラムがあり 'python3' を提供します。

          選択       コマンド
        -----------------------------------------------
        *+ 1           /usr/bin/python3.6
           2           /usr/bin/python3.11
           3           /usr/bin/python3.12

        Enter を押して現在の選択 [+] を保持するか、選択番号を入力します:3
        # python3 -V
        Python 3.12.8

	注意:architectなどpython3で起動するプログラムは、動作しなくなりますので、その場合には、このコマンドで、切り替えてください。
              (architectは、python3で起動する際、phthon3.6である必要があります。)

        # python -m pip install --upgrade pip
        # pip -V
        pip 25.0.1 from /usr/local/lib/python3.12/site-packages/pip (python 3.12)


   patchelf

        # wget http://nixos.org/releases/patchelf/patchelf-0.8/patchelf-0.8.tar.bz2
        # tar xfa patchelf-0.8.tar.bz2
        # cd patchelf-0.8
        # ./configure --prefix=/usr
        # make
        # make install
        # patchelf --version
        patchelf 0.8

   bazel

        # cd "/usr/bin"
        # curl -fLO https://releases.bazel.build/6.5.0/release/bazel-6.5.0-linux-x86_64
        # chmod +x bazel-6.5.0-linux-x86_64
        # mv bazel-6.5.0-linux-x86_64 bazel
        # bazel --version
        bazel 6.5.0

   Nvidia

        # cd /lib/modules/`uname -r`/build
        # ./ccur-config -n -c
        # cd /home
        # wget https://developer.download.nvidia.com/compute/cuda/12.5.0/local_installers/cuda_12.5.0_555.42.02_linux.run
        # reboot
   シングルユーザで起動し、現在のNvidiaドライバを無効にしてからインストールする
        # rmmod nvidia_drm
        # rmmod nvidia_modeset
        # rmmod nvidia
        # cd /home
        # sh cuda_12.5.0_555.42.02_linux.run
   インストール出来たら再起動しcudnnをダウンロードしてインストールする
        # wget https://developer.download.nvidia.com/compute/cudnn/9.3.0/local_installers/cudnn-local-repo-rhel8-9.3.0-1.0-1.x86_64.rpm
        # rpm -i cudnn-local-repo-rhel8-9.3.0-1.0-1.x86_64.rpm
        # dnf clean all
        # dnf -y install cudnn
   下記の2行を/etc/bashrcに加えておく
        export CUDA_HOME=/usr/local/cuda
        export PATH="$PATH:/usr/local/cuda/bin"
tensorflow12.9.0のダウンロードとインストール
    # wget https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.19.0.zip
    # unzip v2.19.0.zip
    # cd tensorflow-2.19.0/
    # export CUDA_HOME=/usr/local/cuda
    # export PATH="$PATH:/usr/local/cuda/bin"

    # ./configure
    You have bazel 6.5.0 installed.
    Please specify the location of python. [Default is /usr/bin/python3]:  ENTER


    Found possible Python library paths:
      /usr/lib/python3.12/site-packages
      /usr/lib64/python3.12/site-packages
      /usr/local/lib/python3.12/site-packages
      /usr/local/lib64/python3.12/site-packages
    Please input the desired Python library path to use.  Default is [/usr/lib/python3.12/site-packages]  ENTER

    Do you wish to build TensorFlow with ROCm support? [y/N]:   ENTER
    No ROCm support will be enabled for TensorFlow.

    Do you wish to build TensorFlow with CUDA support? [y/N]: y
    CUDA support will be enabled for TensorFlow.

    Please specify the hermetic CUDA version you want to use or leave empty to use the default version.   ENTER


    Please specify the hermetic cuDNN version you want to use or leave empty to use the default version.   ENTER


    Please specify a list of comma-separated CUDA compute capabilities you want to build with.
    You can find the compute capability of your device at: https://developer.nvidia.com/cuda-gpus. Each capability can be specified as "x.y" or "compute_xy" to include both virtual and binary GPU code, or as "sm_xy" to only include the binary code.
    Please note that each additional compute capability significantly increases your build time and binary size, and that TensorFlow only supports compute capabilities >= 3.5 [Default is: 3.5,7.0]: 8.0,9.0


    Please specify the local CUDA path you want to use or leave empty to use the default version.   ENTER


    Please specify the local CUDNN path you want to use or leave empty to use the default version.   ENTER


    Please specify the local NCCL path you want to use or leave empty to use the default version.   ENTER


    Do you want to use clang as CUDA compiler? [Y/n]:   ENTER
    Clang will be used as CUDA compiler.

    Please specify clang path that to be used as host compiler. [Default is /usr/bin/clang]:   ENTER


    You have Clang 18.1.8 installed.

    Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -Wno-sign-compare]:   ENTER


    Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: n
    Not configuring the WORKSPACE for Android builds.

    Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
        --config=mkl             # Build with MKL support.
        --config=mkl_aarch64     # Build with oneDNN and Compute Library for the Arm Architecture (ACL).
        --config=monolithic      # Config for mostly static monolithic build.
        --config=numa            # Build with NUMA support.
        --config=dynamic_kernels    # (Experimental) Build kernels into separate shared objects.
        --config=v1              # Build with TensorFlow 1 API instead of TF 2 API.
    Preconfigured Bazel build configs to DISABLE default on features:
        --config=nogcp           # Disable GCP support.
        --config=nonccl          # Disable NVIDIA NCCL support.
    Configuration finished
パッチを適用し、コンパイルする。(bazelrc.patchは「.bazelrc」の--host_linkopt="-fuse-ld=lld"をすべてコメントアウトするだけなのでエディタでも編集できます。)
注意:下記--copt=-Wno-gnu-offsetof-extensionsを追加しないと、エラーになります。
    # patch < bazelrc.patch
    # bazel build //tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tensorflow --config=cuda --config=cuda_wheel --copt=-Wno-gnu-offsetof-extensions
この後3時間ほどダウンロードとコンパイルを行います。
    # python3 -m pip install bazel-bin/tensorflow/tools/pip_package/wheel_house/tensorflow-2.19.0-cp312-cp312-linux_x86_64.whl

    Processing ./bazel-bin/tensorflow/tools/pip_package/wheel_house/tensorflow-2.19.0-cp312-cp312-linux_x86_64.whl

    :

    Installing collected packages: tensorflow
    Successfully installed tensorflow-2.19.0
これで、インストールが完了です。
TensorFlow 2.19.1 および関連パッケージ(tf_slim,tensorflow_datasets,tensorflow-hub,Keras,keras-tuner,keras-visualizer)のインストールとTensorFlowの公式ドキュメント,サンプルコード、Kerasの追加モジュールもインストールします。
加えてPythonパッケージ(Pillow, pydot, matplotlib, seaborn, pandas, scipy, scikit-learn, scikit-learn-intelex, opencv-python, opencv-contrib-python)のインストールも行います。
    # python -m pip install -U protobuf tensorflow==2.19.0 tf_slim tensorflow_datasets==4.8.3 tensorflow-hub keras keras-tuner keras-visualizer
    # python -m pip install git+https://github.com/tensorflow/docs
    # python -m pip install git+https://github.com/tensorflow/examples.git
    # python -m pip install git+https://www.github.com/keras-team/keras-contrib.git
    # python -m pip install -U pillow pydot matplotlib seaborn pandas scipy scikit-learn scikit-learn-intelex opencv-python opencv-contrib-python
動作確認ですが、TensorFlow2の信頼できる確認方法が https://www.kkaneko.jp/tools/win/tensorflow2.html しか見つかりませんでした
下記は、その方法で確認した記録です(赤字部位分を変更)
TensorFlow のバージョン確認
    # python -c "import tensorflow as tf; print( tf.__version__ )" 2> /dev/null
    2.19.0
TensorFlow パッケージの情報の表示
    # pip show tensorflow
    Name: tensorflow
    Version: 2.19.0
    Summary: TensorFlow is an open source machine learning framework for everyone.
    Home-page: https://www.tensorflow.org/
    Author: Google Inc.
    Author-email: packages@tensorflow.org
    License: Apache 2.0
    Location: /usr/local/lib64/python3.12/site-packages
    Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, keras, libclang, ml-dtypes, numpy, opt-einsum, packaging, protobuf, requests, setuptools, six, tensorboard, termcolor, typing-extensions, wrapt
    Required-by: tf_keras
実行結果の中に,次のように「device_type: "GPU"」があれば,GPUが認識できています。
    # python -c "from tensorflow.python.client import device_lib; print(device_lib.list_local_devices())" 2> /dev/null
    [name: "/device:CPU:0"
    device_type: "CPU"
    memory_limit: 268435456
    locality {
    }
    incarnation: 17768764073637773910
    xla_global_id: -1
    , name: "/device:GPU:0"
    device_type: "GPU"
    memory_limit: 4293132288
    locality {
      bus_id: 1
      links {
      }
    }
    incarnation: 13801274830847876372
    physical_device_desc: "device: 0, name: NVIDIA RTX A2000, pci bus id: 0000:17:00.0, compute capability: 8.6"
    xla_global_id: 416903419
    ]

[images/hand.right] NVIDIA TensorRT のインストール方法
TensorRT は、NVIDIAが開発し提供する 「ディープラーニング推論を最適化するツール 」です。
学習済みのAIモデルを NVIDIA GPU上で高速かつ効率的に実行 できるように最適化し、レイテンシ(応答時間)の短縮、スループット(処理能力)の向上、消費電力の削減 を実現しています。

Installing TensorRTに従ってインストールすれば良いのですが、下記にRedHawk8.4にインストールする方法と注意点を示します。

アカウントの登録とログイン
TensorRTにアクセスして【Download Now】ボタンからアカウントを登録しログインしてください。



TensorRTバージョンの決定
TensorRT 10をクリックし、 □ I Agree To the Terms of the NVIDIA TensorRT License Agreement にチェックをしてください。

TensorRT 10.9 GAを選択してください。

TensorRT をRedHawk8.4(RHEL clone)にインストールするときは、RPM パッケージ、tar ファイルのいずれかのインストール オプションを選択できます。
  1. tar ファイルを使用すると、複数のバージョンの TensorRT を同時にインストールするなど、柔軟性が高まります。
    ただし、必要な依存関係をインストールしてLD_LIBRARY_PATH自分で管理する必要があります。
  2. RPM インストールでは依存関係が自動的にインストールされますが、次の点に注意してください。
    • インストールするには root 権限が必要です。
    • TensorRT がどの場所にインストールされるかについては柔軟性がありません。
    • RPM パッケージを使用して CUDA Toolkit をインストールする必要がありますので、runファイルでインストール済みの場合cudaパッケージを上書きで、再インストールする事になります。。
    • Python 3.8のインストールが必要です。
    • TensorRT のマイナー バージョンを複数同時にインストールすることはできません。
1. Tar ファイルのインストール
使用している CPU アーキテクチャと CUDA バージョンに一致する TensorRT tar ファイルをダウンロードします。
(以下の説明では、cuda12.4を前提にします。)

TensorRT をインストールする場所を選択し tar ファイルを解凍します。
 
# tar -C /usr/local -xzf TensorRT-10.9.0.34.Linux.x86_64-gnu.cuda-12.8.tar.gz.gz
TensorRT ディレクトリへの絶対パスを LD_LIBRARY_PATH 環境変数に追加します。
 
# export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH:/usr/local/TensorRT-10.9.0.34/lib/
 
Python TensorRT wheel ファイルをPython バージョンに合わせてインストールします。
(Python TensorRT wheel ファイルは現在バージョン 3.8 から 3.13 をサポートしており、他のバージョンでは動作しません。)
 
 Python 3.8 :
	tensorrt-10.9.0.34-cp38-none-linux_x86_64.whl
	tensorrt_dispatch-10.9.0.34-cp38-none-linux_x86_64.whl
	tensorrt_lean-10.9.0.34-cp38-none-linux_x86_64.whl
 Python 3.9 :
	tensorrt-10.9.0.34-cp39-none-linux_x86_64.whl
	tensorrt_dispatch-10.9.0.34-cp39-none-linux_x86_64.whl
	tensorrt_lean-10.9.0.34-cp39-none-linux_x86_64.whl
 Python 3.10 :
	tensorrt-10.9.0.34-cp310-none-linux_x86_64.whl
	tensorrt_dispatch-10.9.0.34-cp310-none-linux_x86_64.whl
	tensorrt_lean-10.9.0.34-cp310-none-linux_x86_64.whl
 Python 3.11 : 
	tensorrt-10.9.0.34-cp311-none-linux_x86_64.whl
	tensorrt_dispatch-10.9.0.34-cp311-none-linux_x86_64.whl
	tensorrt_lean-10.9.0.34-cp311-none-linux_x86_64.whl 
 Python 3.12 :
	tensorrt-10.9.0.34-cp312-none-linux_x86_64.whl
	tensorrt_dispatch-10.9.0.34-cp312-none-linux_x86_64.whl
	tensorrt_lean-10.9.0.34-cp312-none-linux_x86_64.whl
 Python 3.13 :
	tensorrt-10.9.0.34-cp313-none-linux_x86_64.whl
	tensorrt_dispatch-10.9.0.34-cp313-none-linux_x86_64.whl
	tensorrt_lean-10.9.0.34-cp313-none-linux_x86_64.whl
 
このため RedHawk8.4.xで最上位版である、python3.11-pip,python3.11-pip-wheelをインストールしておきます。
 
# dnf --disablerepo="*" --enablerepo="rocky-8.9-updates-media-BaseOS rocky-8.9-updates-media-AppStream" install python3.11-pip python3.11-pip-wheel 
メタデータの期限切れの最終確認: 364 days, 1:24:18 前の 2024年03月19日 11時58分56秒 に実施しました。
パッケージ python3.11-pip-wheel-22.3.1-4.el8.noarch は既にインストールされています。
依存関係が解決しました。
================================================================================
 パッケージ         Arch   バージョン   リポジトリー                      サイズ
================================================================================
インストール:
 python3.11-pip     noarch 22.3.1-4.el8 rocky-8.9-updates-media-AppStream 2.9 M
弱い依存関係のインストール:
 python3.11-setuptools
                    noarch 65.5.1-2.el8 rocky-8.9-updates-media-AppStream 2.0 M

トランザクションの概要
================================================================================
インストール  2 パッケージ

合計サイズ: 4.9 M
インストール後のサイズ: 20 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1 
  インストール中   : python3.11-setuptools-65.5.1-2.el8.noarch              1/2 
  インストール中   : python3.11-pip-22.3.1-4.el8.noarch                     2/2 
  scriptletの実行中: python3.11-pip-22.3.1-4.el8.noarch                     2/2 
  検証             : python3.11-pip-22.3.1-4.el8.noarch                     1/2 
  検証             : python3.11-setuptools-65.5.1-2.el8.noarch              2/2 
インストール済みの製品が更新されています。

インストール済み:
  python3.11-pip-22.3.1-4.el8.noarch  python3.11-setuptools-65.5.1-2.el8.noarch 

完了しました!
 
python3のディフォルトをpython3.6からpython3.11へ変更します。
 
# alternatives --config python3

2 プログラムがあり 'python3' を提供します。

  選択       コマンド
-----------------------------------------------
*+ 1           /usr/bin/python3.6
   2           /usr/bin/python3.11

Enter を押して現在の選択 [+] を保持するか、選択番号を入力します:2

 
 
# python3 -m pip -V
pip 22.3.1 from /usr/lib/python3.11/site-packages/pip (python 3.11)
 
 
# cd /usr/local/TensorRT-10.9.0.34/python/

# python3 -m pip install tensorrt-10.9.0.34-cp311-none-linux_x86_64.whl
Processing ./tensorrt-10.9.0.34-cp311-none-linux_x86_64.whl
Installing collected packages: tensorrt
Successfully installed tensorrt-10.9.0.34
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

# python3 -m pip install tensorrt_lean-10.9.0.34-cp311-none-linux_x86_64.whl
Processing ./tensorrt_lean-10.9.0.34-cp311-none-linux_x86_64.whl
Installing collected packages: tensorrt-lean
Successfully installed tensorrt-lean-10.9.0.34
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

# python3 -m pip install tensorrt_dispatch-10.9.0.34-cp311-none-linux_x86_64.whl
Processing ./tensorrt_dispatch-10.9.0.34-cp311-none-linux_x86_64.whl
Installing collected packages: tensorrt-dispatch
Successfully installed tensorrt-dispatch-10.9.0.34
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
 
インストールを確認します。
インストールされたファイルが正しいディレクトリにあることを確認します。
たとえば、 tree -d コマンドを実行して、サポートされているすべてのインストール済みファイルが、 lib include data などのディレクトリに配置されているかどうかを確認します。
 
# tree -d
.
├── bin -> targets/x86_64-linux-gnu/bin
├── data
│   ├── char-rnn
│   │   └── model
│   ├── int8_api
│   ├── mnist
│   └── resnet50
├── doc
├── include
├── lib -> targets/x86_64-linux-gnu/lib
├── python
│   └── include
│  	└── impl
├── samples
│   ├── common
│   ├── python
│   │   ├── aliased_io_plugin
│   │   ├── dds_faster_rcnn
│   │   ├── detectron2
│   │   ├── efficientdet
│   │   ├── efficientnet
│   │   ├── engine_refit_onnx_bidaf
│   │   ├── introductory_parser_samples
│   │   ├── network_api_pytorch_mnist
│   │   ├── non_zero_plugin
│   │   ├── onnx_custom_plugin
│   │   │   └── plugin
│   │   ├── onnx_packnet
│   │   ├── python_plugin
│   │   │   └── circ_plugin_cpp
│   │   ├── quickly_deployable_plugins
│   │   ├── sample_weight_stripping
│   │   ├── simple_progress_monitor
│   │   ├── tensorflow_object_detection_api
│   │   └── yolov3_onnx
│   ├── sampleCharRNN
│   ├── sampleDynamicReshape
│   ├── sampleEditableTimingCache
│   ├── sampleINT8API
│   ├── sampleIOFormats
│   ├── sampleNamedDimensions
│   ├── sampleNonZeroPlugin
│   ├── sampleOnnxMNIST
│   ├── sampleOnnxMnistCoordConvAC
│   ├── sampleProgressMonitor
│   ├── trtexec
│   └── utils
└── targets
    └── x86_64-linux-gnu
	├── bin
	│   ├── chobj
	│   │   └── sampleOnnxMNIST
	│   │  	    ├── common
	│   │  	    ├── sampleOnnxMNIST
	│   │  	    └── utils
	│   └── dchobj
	│  	└── sampleOnnxMNIST
	│  	    ├── common
	│  	    ├── sampleOnnxMNIST
	│  	    └── utils
	├── include -> ../../include
	├── lib
	│   └── stubs
	└── samples -> ../../samples

64 directories
 
インストールされたディレクトリにある、同梱のサンプルの 1 つ sampleOnnxMNIST をビルドして実行します。
追加の設定なしでサンプルをコンパイルして実行できるはずです。詳細については、sampleOnnxMNISTを参照してください。
 
# alternatives --config cuda

2 プログラムがあり 'cuda' を提供します。

  選択       コマンド
-----------------------------------------------
 + 1           /usr/local/cuda-11.4
*  2           /usr/local/cuda-12.4

Enter を押して現在の選択 [+] を保持するか、選択番号を入力します: 2


# export LD_LIBRARY_PATH=:$LD_LIBRARY_PATH:/usr/local/TensorRT-10.9.0.34/lib/
# cd /usr/local/TensorRT-10.9.0.34/samples/sampleOnnxMNIST

# make
../Makefile.config:25: CUDA_INSTALL_DIR variable is not specified, using /usr/local/cuda by default, use CUDA_INSTALL_DIR= to change.
../Makefile.config:45: TRT_LIB_DIR is not specified, searching ../../lib, ../../lib, ../lib by default, use TRT_LIB_DIR= to change.
	:
	:
Compiling: ../utils/fileLock.cpp
Linking: ../../bin/sample_onnx_mnist


# ../../bin/sample_onnx_mnist
&&&& RUNNING TensorRT.sample_onnx_mnist [TensorRT v100900] [b34] # ../../bin/sample_onnx_mnist
[03/18/2025-13:52:20] [I] Building and running a GPU inference engine for Onnx MNIST
[03/18/2025-13:52:20] [I] [TRT] [MemUsageChange] Init CUDA: CPU +18, GPU +0, now: CPU 25, GPU 276 (MiB)
[03/18/2025-13:52:38] [I] [TRT] [MemUsageChange] Init builder kernel library: CPU +2647, GPU +414, now: CPU 2873, GPU 690 (MiB)
[03/18/2025-13:52:38] [I] [TRT] ----------------------------------------------------------------
[03/18/2025-13:52:38] [I] [TRT] Input filename:   ../../data/mnist/mnist.onnx
[03/18/2025-13:52:38] [I] [TRT] ONNX IR version:  0.0.3
[03/18/2025-13:52:38] [I] [TRT] Opset version:    8
[03/18/2025-13:52:38] [I] [TRT] Producer name:    CNTK
[03/18/2025-13:52:38] [I] [TRT] Producer version: 2.5.1
[03/18/2025-13:52:38] [I] [TRT] Domain:           ai.cntk
[03/18/2025-13:52:38] [I] [TRT] Model version:    1
[03/18/2025-13:52:38] [I] [TRT] Doc string:       
[03/18/2025-13:52:38] [I] [TRT] ----------------------------------------------------------------
[03/18/2025-13:52:38] [I] [TRT] Local timing cache in use. Profiling results in this builder pass will not be stored.
[03/18/2025-13:52:39] [I] [TRT] Compiler backend is used during engine build.
[03/18/2025-13:52:41] [I] [TRT] Detected 1 inputs and 1 output network tensors.
[03/18/2025-13:52:41] [I] [TRT] Total Host Persistent Memory: 18960 bytes
[03/18/2025-13:52:41] [I] [TRT] Total Device Persistent Memory: 0 bytes
[03/18/2025-13:52:41] [I] [TRT] Max Scratch Memory: 0 bytes
[03/18/2025-13:52:41] [I] [TRT] [BlockAssignment] Started assigning block shifts. This will take 4 steps to complete.
[03/18/2025-13:52:41] [I] [TRT] [BlockAssignment] Algorithm ShiftNTopDown took 0.013118ms to assign 2 blocks to 4 nodes requiring 31744 bytes.
[03/18/2025-13:52:41] [I] [TRT] Total Activation Memory: 31744 bytes
[03/18/2025-13:52:41] [I] [TRT] Total Weights Memory: 25704 bytes
[03/18/2025-13:52:41] [I] [TRT] Compiler backend is used during engine execution.
[03/18/2025-13:52:41] [I] [TRT] Engine generation completed in 2.86614 seconds.
[03/18/2025-13:52:41] [I] [TRT] [MemUsageStats] Peak memory usage of TRT CPU/GPU memory allocators: CPU 0 MiB, GPU 5 MiB
[03/18/2025-13:52:41] [I] [TRT] Loaded engine size: 0 MiB
[03/18/2025-13:52:41] [I] [TRT] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +0, GPU +0, now: CPU 0, GPU 0 (MiB)
[03/18/2025-13:52:41] [I] Input:
[03/18/2025-13:52:41] [I] @@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@=   ++++#++=*@@@@@
@@@@@@@@#.            *@@@@@
@@@@@@@@=             *@@@@@
@@@@@@@@.   .. ...****%@@@@@
@@@@@@@@: .%@@#@@@@@@@@@@@@@
@@@@@@@%  -@@@@@@@@@@@@@@@@@
@@@@@@@%  -@@*@@@*@@@@@@@@@@
@@@@@@@#  :#- ::. ::=@@@@@@@
@@@@@@@-             -@@@@@@
@@@@@@%.              *@@@@@
@@@@@@#     :==*+==   *@@@@@
@@@@@@%---%%@@@@@@@.  *@@@@@
@@@@@@@@@@@@@@@@@@@+  *@@@@@
@@@@@@@@@@@@@@@@@@@=  *@@@@@
@@@@@@@@@@@@@@@@@@*   *@@@@@
@@@@@%+%@@@@@@@@%.   .%@@@@@
@@@@@*  .******=    -@@@@@@@
@@@@@*             .#@@@@@@@
@@@@@*            =%@@@@@@@@
@@@@@@%#+++=     =@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@

[03/18/2025-13:52:41] [I] Output:
[03/18/2025-13:52:41] [I]  Prob 0  0.0000 Class 0: 
[03/18/2025-13:52:41] [I]  Prob 1  0.0000 Class 1: 
[03/18/2025-13:52:41] [I]  Prob 2  0.0000 Class 2: 
[03/18/2025-13:52:41] [I]  Prob 3  0.0000 Class 3: 
[03/18/2025-13:52:41] [I]  Prob 4  0.0000 Class 4: 
[03/18/2025-13:52:41] [I]  Prob 5  1.0000 Class 5: **********
[03/18/2025-13:52:41] [I]  Prob 6  0.0000 Class 6: 
[03/18/2025-13:52:41] [I]  Prob 7  0.0000 Class 7: 
[03/18/2025-13:52:41] [I]  Prob 8  0.0000 Class 8: 
[03/18/2025-13:52:41] [I]  Prob 9  0.0000 Class 9: 
[03/18/2025-13:52:41] [I] 
&&&& PASSED TensorRT.sample_onnx_mnist [TensorRT v100900] [b34] # ../../bin/sample_onnx_mnist
 
2. RPM ファイルのインストール
Python 3.8のインストール
TensorRTパッケージをRPMインストールするためには、Python 3.8が必須です。
下記に従って、Python 3.8をインストールしてください。

[images/hand.right] Update Blu-Ray Discをリポジトリとしてインストールする場合

 
# dnf --disablerepo="*" --enablerepo="rocky-8.4-updates-media-AppStream rocky-8.4-updates-media-BaseOS" install python3.8
Rocky-Updates-BaseOS-8.4 - Media                565 kB/s | 2.3 MB     00:04    
Rocky-Updates-AppStream-8.4 - Media             8.4 MB/s | 6.7 MB     00:00    
メタデータの期限切れの最終確認: 0:00:01 前の 2025年03月18日 10時28分36秒 に実施しました。
依存関係が解決しました。
================================================================================
 パッケージ                Arch   バージョン
                                        リポジトリー                      サイズ
================================================================================
インストール:
 python38                  x86_64 3.8.6-3.module+el8.4.0+595+c96abaa2
                                        rocky-8.4-updates-media-AppStream  78 k
依存関係のインストール:
 python38-libs             x86_64 3.8.6-3.module+el8.4.0+595+c96abaa2
                                        rocky-8.4-updates-media-AppStream 8.3 M
 python38-pip-wheel        noarch 19.3.1-1.module+el8.4.0+570+c2eaf144
                                        rocky-8.4-updates-media-AppStream 1.2 M
 python38-setuptools-wheel noarch 41.6.0-4.module+el8.4.0+570+c2eaf144
                                        rocky-8.4-updates-media-AppStream 303 k
弱い依存関係のインストール:
 python38-pip              noarch 19.3.1-1.module+el8.4.0+570+c2eaf144
                                        rocky-8.4-updates-media-AppStream 1.9 M
 python38-setuptools       noarch 41.6.0-4.module+el8.4.0+570+c2eaf144
                                        rocky-8.4-updates-media-AppStream 666 k
モジュールストリームの有効化中:
 python38                         3.8                                          

トランザクションの概要
================================================================================
インストール  6 パッケージ

合計サイズ: 12 M
インストール後のサイズ: 45 M
これでよろしいですか? [y/N]: y
	:
	:
 

[images/hand.right] Rocky (8.9+) Install Blu-RayDiscをリポジトリとして更新インストールする場合

 
# dnf --disablerepo="*" --enablerepo="rocky-8.9-updates-media-BaseOS rocky-8.9-updates-media-AppStream" install python3.8
メタデータの期限切れの最終確認: 363 days, 1:49:04 前の 2024年03月19日 11時58分56秒 に実施しました。
依存関係が解決しました。
================================================================================
 パッケージ                Arch   バージョン
                                        リポジトリー                      サイズ
================================================================================
インストール:
 python38                  x86_64 3.8.17-2.module+el8.9.0+1418+f0d66789
                                        rocky-8.9-updates-media-AppStream  80 k
依存関係のインストール:
 python38-libs             x86_64 3.8.17-2.module+el8.9.0+1418+f0d66789
                                        rocky-8.9-updates-media-AppStream 8.3 M
 python38-pip-wheel        noarch 19.3.1-7.module+el8.9.0+1418+f0d66789
                                        rocky-8.9-updates-media-AppStream 1.0 M
 python38-setuptools-wheel noarch 41.6.0-5.module+el8.9.0+1418+f0d66789
                                        rocky-8.9-updates-media-AppStream 303 k
弱い依存関係のインストール:
 python38-pip              noarch 19.3.1-7.module+el8.9.0+1418+f0d66789
                                        rocky-8.9-updates-media-AppStream 1.7 M
 python38-setuptools       noarch 41.6.0-5.module+el8.9.0+1418+f0d66789
                                        rocky-8.9-updates-media-AppStream 666 k
モジュールストリームの有効化中:
 python38                         3.8                                          

トランザクションの概要
================================================================================
インストール  6 パッケージ

合計サイズ: 12 M
インストール後のサイズ: 44 M
これでよろしいですか? [y/N]: y
	:
	:
 
Python 3.8のアクティベート
下記コマンドで、python3のバージョンが3.8になっていることを確認してください。
(3.8以外はインストールエラーになります)
 
# alternatives --set python3 /usr/bin/python3.8

# alternatives --list | grep python
python              	auto  	/usr/libexec/no-python
python3             	manual	/usr/bin/python3.8

# python3 -V
Python 3.8.17
 
CUDA のインストール
CUDA のインストール手順に従って CUDA local リポジトリ をインストールします。
 
# wget https://developer.download.nvidia.com/compute/cuda/12.4.1/local_installers/cuda-repo-rhel8-12-4-local-12.4.1_550.54.15-1.x86_64.rpm

# dnf install cuda-repo-rhel8-12-4-local-12.4.1_550.54.15-1.x86_64.rpm
メタデータの期限切れの最終確認: 0:35:10 前の 2025年03月17日 14時27分47秒 に実施しました。
依存関係が解決しました。
======================================================================================================================================
 パッケージ                                アーキテクチャー      バージョン                         リポジトリー                サイズ
======================================================================================================================================
インストール:
 cuda-repo-rhel8-12-4-local                x86_64                12.4.1_550.54.15-1                 @commandline                4.6 G

トランザクションの概要
======================================================================================================================================
インストール  1 パッケージ

合計サイズ: 4.6 G
インストール後のサイズ: 4.6 G
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                                                                              1/1 
  検証             : cuda-repo-rhel8-12-4-local-12.4.1_550.54.15-1.x86_64                                                         1/1 
インストール済みの製品が更新されています。

インストール済み:
  cuda-repo-rhel8-12-4-local-12.4.1_550.54.15-1.x86_64                                                                                

完了しました!
 
使用している RHEL/CentOS のバージョンと CPU アーキテクチャに一致する TensorRT ローカル リポジトリ ファイルをダウンロードします。
 
# wget https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.1.0/local_repo/nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm

# rpm -ivh nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm
警告: nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm: ヘッダー V4 RSA/SHA512 Signature、鍵 ID 38c8a975: NOKEY
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:nv-tensorrt-local-repo-rhel8-10.1################################# [100%]

ローカル リポジトリ RPM パッケージから TensorRT をインストールします。

# dnf -ivh nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm

# wget https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.1.0/local_repo/nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm
# rpm -ivh nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm
警告: nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm: ヘッダー V4 RSA/SHA512 Signature、鍵 ID 38c8a975: NOKEY
Verifying...                          ################################# [100%]
準備しています...              ################################# [100%]
更新中 / インストール中...
   1:nv-tensorrt-local-repo-rhel8-10.1################################# [100%]
 
ローカル リポジトリ RPM パッケージから TensorRT をインストールします。
 
# dnf -ivh nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4-1.0-1.x86_64.rpm

# python3 -m pip install numpy
WARNING: Running pip install with root privileges is generally not a good idea. Try `python3 -m pip install --user` instead.
Collecting numpy
  Downloading https://files.pythonhosted.org/packages/98/5d/5738903efe0ecb73e51eb44feafba32bdba2081263d40c5043568ff60faf/numpy-1.24.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3MB)
     |????????????????????????????????| 17.3MB 9.3MB/s 
Installing collected packages: numpy
Successfully installed numpy-1.24.4


# dnf install python3-libnvinfer-devel
メタデータの期限切れの最終確認: 0:00:43 前の 2025年03月17日 14時27分47秒 に実施しました。
依存関係が解決しました。
================================================================================
 パッケージ
     Arch   バージョン           リポジトリー                             サイズ
================================================================================
インストール:
 python3-libnvinfer-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 7.6 k
依存関係のインストール:
 libnvinfer-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 723 M
 libnvinfer-dispatch-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 128 k
 libnvinfer-dispatch10
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 222 k
 libnvinfer-headers-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 124 k
 libnvinfer-headers-plugin-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4  11 k
 libnvinfer-lean-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4  26 M
 libnvinfer-lean10
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 8.9 M
 libnvinfer-plugin-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4  11 M
 libnvinfer-plugin10
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4  11 M
 libnvinfer-vc-plugin-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 115 k
 libnvinfer-vc-plugin10
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 255 k
 libnvinfer10
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 719 M
 libnvonnxparsers-devel
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 2.1 M
 libnvonnxparsers10
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 970 k
 python3-libnvinfer
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 802 k
 python3-libnvinfer-dispatch
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 484 k
 python3-libnvinfer-lean
     x86_64 10.1.0.27-1.cuda12.4 nv-tensorrt-local-rhel8-10.1.0-cuda-12.4 484 k

トランザクションの概要
================================================================================
インストール  18 パッケージ

合計サイズ: 1.5 G
インストール後のサイズ: 3.6 G
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
nv-tensorrt-local-rhel8-10.1.0-cuda-12.4        3.1 MB/s | 3.2 kB     00:00    
GPG 鍵 0x38C8A975 をインポート中:
 Userid     : "Kitmaker "
 Fingerprint: 44A3 F5FC E3CE 5FB5 FC22 52FA 1026 003B 38C8 A975
 From       : /var/nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4/38C8A975.pub
これでよろしいですか? [y/N]: y
鍵のインポートに成功しました
GPG 鍵 0xC71DCCD2 をインポート中:
 Userid     : "Kitmaker "
 Fingerprint: B265 316D F6EB 0AB3 6776 5F23 0DAF 9D22 C71D CCD2
 From       : /var/nv-tensorrt-local-repo-rhel8-10.1.0-cuda-12.4/38C8A975.pub
これでよろしいですか? [y/N]: y
鍵のインポートに成功しました
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1 
  インストール中   : libnvinfer-headers-devel-10.1.0.27-1.cuda12.4.x86_    1/18 
  インストール中   : libnvinfer10-10.1.0.27-1.cuda12.4.x86_64              2/18 
  インストール中   : libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_64          3/18 
  インストール中   : libnvinfer-headers-plugin-devel-10.1.0.27-1.cuda12    4/18 
  インストール中   : libnvinfer-plugin10-10.1.0.27-1.cuda12.4.x86_64       5/18 
  インストール中   : libnvonnxparsers10-10.1.0.27-1.cuda12.4.x86_64        6/18 
  インストール中   : libnvinfer-vc-plugin10-10.1.0.27-1.cuda12.4.x86_64    7/18 
  インストール中   : libnvinfer-lean10-10.1.0.27-1.cuda12.4.x86_64         8/18 
  インストール中   : libnvinfer-dispatch10-10.1.0.27-1.cuda12.4.x86_64     9/18 
  インストール中   : libnvinfer-dispatch-devel-10.1.0.27-1.cuda12.4.x86   10/18 
  インストール中   : python3-libnvinfer-dispatch-10.1.0.27-1.cuda12.4.x   11/18 
  インストール中   : libnvinfer-lean-devel-10.1.0.27-1.cuda12.4.x86_64    12/18 
  インストール中   : python3-libnvinfer-lean-10.1.0.27-1.cuda12.4.x86_6   13/18 
  インストール中   : libnvinfer-vc-plugin-devel-10.1.0.27-1.cuda12.4.x8   14/18 
  インストール中   : python3-libnvinfer-10.1.0.27-1.cuda12.4.x86_64       15/18 
  インストール中   : libnvonnxparsers-devel-10.1.0.27-1.cuda12.4.x86_64   16/18 
  インストール中   : libnvinfer-plugin-devel-10.1.0.27-1.cuda12.4.x86_6   17/18 
  インストール中   : python3-libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_   18/18 
  scriptletの実行中: python3-libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_   18/18 
  検証             : libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_64          1/18 
  検証             : libnvinfer-dispatch-devel-10.1.0.27-1.cuda12.4.x86    2/18 
  検証             : libnvinfer-dispatch10-10.1.0.27-1.cuda12.4.x86_64     3/18 
  検証             : libnvinfer-headers-devel-10.1.0.27-1.cuda12.4.x86_    4/18 
  検証             : libnvinfer-headers-plugin-devel-10.1.0.27-1.cuda12    5/18 
  検証             : libnvinfer-lean-devel-10.1.0.27-1.cuda12.4.x86_64     6/18 
  検証             : libnvinfer-lean10-10.1.0.27-1.cuda12.4.x86_64         7/18 
  検証             : libnvinfer-plugin-devel-10.1.0.27-1.cuda12.4.x86_6    8/18 
  検証             : libnvinfer-plugin10-10.1.0.27-1.cuda12.4.x86_64       9/18 
  検証             : libnvinfer-vc-plugin-devel-10.1.0.27-1.cuda12.4.x8   10/18 
  検証             : libnvinfer-vc-plugin10-10.1.0.27-1.cuda12.4.x86_64   11/18 
  検証             : libnvinfer10-10.1.0.27-1.cuda12.4.x86_64             12/18 
  検証             : libnvonnxparsers-devel-10.1.0.27-1.cuda12.4.x86_64   13/18 
  検証             : libnvonnxparsers10-10.1.0.27-1.cuda12.4.x86_64       14/18 
  検証             : python3-libnvinfer-10.1.0.27-1.cuda12.4.x86_64       15/18 
  検証             : python3-libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_   16/18 
  検証             : python3-libnvinfer-dispatch-10.1.0.27-1.cuda12.4.x   17/18 
  検証             : python3-libnvinfer-lean-10.1.0.27-1.cuda12.4.x86_6   18/18 
インストール済みの製品が更新されています。

インストール済み:
  libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_64                                  
  libnvinfer-dispatch-devel-10.1.0.27-1.cuda12.4.x86_64                         
  libnvinfer-dispatch10-10.1.0.27-1.cuda12.4.x86_64                             
  libnvinfer-headers-devel-10.1.0.27-1.cuda12.4.x86_64                          
  libnvinfer-headers-plugin-devel-10.1.0.27-1.cuda12.4.x86_64                   
  libnvinfer-lean-devel-10.1.0.27-1.cuda12.4.x86_64                             
  libnvinfer-lean10-10.1.0.27-1.cuda12.4.x86_64                                 
  libnvinfer-plugin-devel-10.1.0.27-1.cuda12.4.x86_64                           
  libnvinfer-plugin10-10.1.0.27-1.cuda12.4.x86_64                               
  libnvinfer-vc-plugin-devel-10.1.0.27-1.cuda12.4.x86_64                        
  libnvinfer-vc-plugin10-10.1.0.27-1.cuda12.4.x86_64                            
  libnvinfer10-10.1.0.27-1.cuda12.4.x86_64                                      
  libnvonnxparsers-devel-10.1.0.27-1.cuda12.4.x86_64                            
  libnvonnxparsers10-10.1.0.27-1.cuda12.4.x86_64                                
  python3-libnvinfer-10.1.0.27-1.cuda12.4.x86_64                                
  python3-libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_64                          
  python3-libnvinfer-dispatch-10.1.0.27-1.cuda12.4.x86_64                       
  python3-libnvinfer-lean-10.1.0.27-1.cuda12.4.x86_64                           

完了しました!
 
onnx-graphsurgeon を必要とするサンプルを実行したい場合、またはプロジェクトに Python モジュールを使用したい場合。
 
# python3 -m pip install numpy onnx onnx-graphsurgeon
WARNING: Running pip install with root privileges is generally not a good idea. Try `python3 -m pip install --user` instead.
Requirement already satisfied: numpy in /usr/local/lib64/python3.8/site-packages (1.24.4)
Collecting onnx
  Downloading https://files.pythonhosted.org/packages/fb/4c/687f641702f3d3c67ce01a17d93cf2a83d7f9d9cb32bd18e397d4ff9580d/onnx-1.17.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.0MB)
     |????????????????????????????????| 16.1MB 458kB/s 
Collecting onnx-graphsurgeon
  Downloading https://files.pythonhosted.org/packages/cb/b1/af8edee1ec693369b84e32db3159aa9dbea7361078685ed19b58646cdccd/onnx_graphsurgeon-0.5.6-py2.py3-none-any.whl (57kB)
     |????????????????????????????????| 61kB 2.3MB/s 
Collecting protobuf>=3.20.2
  Downloading https://files.pythonhosted.org/packages/a8/45/2ebbde52ad2be18d3675b6bee50e68cd73c9e0654de77d595540b5129df8/protobuf-5.29.3-cp38-abi3-manylinux2014_x86_64.whl (319kB)
     |????????????????????????????????| 327kB 37.9MB/s 
Installing collected packages: protobuf, onnx, onnx-graphsurgeon
Successfully installed onnx-1.17.0 onnx-graphsurgeon-0.5.6 protobuf-5.29.3

# dnf install libcudart.so.12-devel
cuda-rhel8-12-4-local                           1.2 MB/s | 105 kB     00:00    
依存関係が解決しました。
================================================================================
 パッケージ                      Arch   バージョン  リポジトリー          サイズ
================================================================================
インストール:
 cuda-cudart-devel-12-4          x86_64 12.4.127-1  cuda-rhel8-12-4-local 2.0 M
依存関係のインストール:
 cuda-cccl-12-4                  x86_64 12.4.127-1  cuda-rhel8-12-4-local 1.9 M
 cuda-cudart-12-4                x86_64 12.4.127-1  cuda-rhel8-12-4-local 223 k
 cuda-toolkit-12-4-config-common noarch 12.4.127-1  cuda-rhel8-12-4-local 6.6 k
 cuda-toolkit-12-config-common   noarch 12.4.127-1  cuda-rhel8-12-4-local 6.8 k
 cuda-toolkit-config-common      noarch 12.4.127-1  cuda-rhel8-12-4-local 6.8 k

トランザクションの概要
================================================================================
インストール  6 パッケージ

合計サイズ: 4.2 M
インストール後のサイズ: 22 M
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
cuda-rhel8-12-4-local                           1.6 MB/s | 1.6 kB     00:00    
GPG 鍵 0x0A1F4CFA をインポート中:
 Userid     : "Kitmaker "
 Fingerprint: FB57 DA60 ABBC 7CE3 9365 E75B F2F5 B666 0A1F 4CFA
 From       : /var/cuda-repo-rhel8-12-4-local/0A1F4CFA.pub
これでよろしいですか? [y/N]: y
鍵のインポートに成功しました
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
  準備             :                                                        1/1 
  インストール中   : cuda-toolkit-config-common-12.4.127-1.noarch           1/6 
  インストール中   : cuda-toolkit-12-config-common-12.4.127-1.noarch        2/6 
  インストール中   : cuda-toolkit-12-4-config-common-12.4.127-1.noarch      3/6 
  インストール中   : cuda-cudart-12-4-12.4.127-1.x86_64                     4/6 
  scriptletの実行中: cuda-cudart-12-4-12.4.127-1.x86_64                     4/6 
  インストール中   : cuda-cccl-12-4-12.4.127-1.x86_64                       5/6 
  インストール中   : cuda-cudart-devel-12-4-12.4.127-1.x86_64               6/6 
  scriptletの実行中: cuda-toolkit-12-4-config-common-12.4.127-1.noarch      6/6 
  scriptletの実行中: cuda-cudart-devel-12-4-12.4.127-1.x86_64               6/6 
  検証             : cuda-cccl-12-4-12.4.127-1.x86_64                       1/6 
  検証             : cuda-cudart-12-4-12.4.127-1.x86_64                     2/6 
  検証             : cuda-cudart-devel-12-4-12.4.127-1.x86_64               3/6 
  検証             : cuda-toolkit-12-4-config-common-12.4.127-1.noarch      4/6 
  検証             : cuda-toolkit-12-config-common-12.4.127-1.noarch        5/6 
  検証             : cuda-toolkit-config-common-12.4.127-1.noarch           6/6 
インストール済みの製品が更新されています。

インストール済み:
  cuda-cccl-12-4-12.4.127-1.x86_64                                              
  cuda-cudart-12-4-12.4.127-1.x86_64                                            
  cuda-cudart-devel-12-4-12.4.127-1.x86_64                                      
  cuda-toolkit-12-4-config-common-12.4.127-1.noarch                             
  cuda-toolkit-12-config-common-12.4.127-1.noarch                               
  cuda-toolkit-config-common-12.4.127-1.noarch                                  

完了しました!
 
インストールの確認
 
# rpm -q tensorrt
tensorrt-10.1.0.27-1.cuda12.4.x86_64

# rpm -qa | grep nvinfer
libnvinfer-headers-devel-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-plugin-devel-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-vc-plugin-devel-10.1.0.27-1.cuda12.4.x86_64
python3-libnvinfer-dispatch-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-bin-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-lean10-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-plugin10-10.1.0.27-1.cuda12.4.x86_64
python3-libnvinfer-lean-10.1.0.27-1.cuda12.4.x86_64
libnvinfer10-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-dispatch-devel-10.1.0.27-1.cuda12.4.x86_64
python3-libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-vc-plugin10-10.1.0.27-1.cuda12.4.x86_64
python3-libnvinfer-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-samples-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-headers-plugin-devel-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-lean-devel-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-dispatch10-10.1.0.27-1.cuda12.4.x86_64
libnvinfer-devel-10.1.0.27-1.cuda12.4.x86_64
 

[back]Back