オプション
家家 Skill 開発者ツール holoscan-install-wheel

holoscan-install-wheel

NVIDIA/skills NVIDIA/skills

pip を使用して、Holoscan SDK の Python ホイールを仮想環境にインストールし、サンプルスクリプトを使って動作を確認してください。

...すべて拡張します
6
更新された時間 2026年9月25日

ホロスキャン・ピップ・ホイールの取り付け

目的

holoscan-cu12/holoscan-cu13pip wheel を使用して、仮想環境に Holoscan SDK の Python バインディングをインストールし、hello_worldおよびvideo_replayer を用いて動作を確認します。

前提条件

  • NVIDIA GPU およびドライバ (nvidia-smi) がインストールされた Linux x86_64 環境。
  • ホストの CUDA メジャーバージョン(12 または 13)と一致する CUDA ツールキットがPATHに設定されていること。
  • venvが利用可能な Python 3.10~3.13。
  • PyPI およびdocs.nvidia.com へのネットワークアクセス。

制限事項

  • Python のみ。C++ ヘッダー/ライブラリを使用する場合は、/holoscan-install-debian と組み合わせて使用してください。
  • holoscan-cu12とholoscan-cu13は相互に排他的です。wheel はホストの CUDA ドライバと一致している必要があります。
  • video_replayerデータは Debian パッケージにのみ同梱されています。同梱されていない場合は、HOLOSCAN_INPUT_PATH を racerx/ を含むディレクトリに設定してください。
  • Holoscan を実行するすべてのシェルで、ulimit -s 32768を実行することをお勧めします。これを行わないと、一部のアプリでスタックサイズの警告が表示されたり、まれにセグメンテーションフォールトが発生したりする場合があります。

ステップ 0: 公式のインストール手順を参照する

インストールする前に、必ずhttps://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.htmlの pip-wheel セクションを確認してください。 要約:正確な wheel パッケージ名(holoscan-cu12、holoscan-cu13)、現在のリリースでサポートされている Python のバージョン範囲、PATHに設定しておく必要がある前提条件(CUDA ツールキット)、およびオプションの追加要件(LibTorch / ONNX Runtime のバージョン指定)を確認してください。 以下の内容とドキュメントに矛盾がある場合は、ドキュメントの記載を優先してください。

使用する CUDA バリアントはあらかじめ決定しておく必要があります。不明な場合は、まず `nvidia-smi 2>&1 | head -5` を実行してください。

CUDA バリアントの決定ルール — 以下の pip パッケージを選択してください:

nvidia-smi CUDA バージョン pipパッケージ
13.x+ holoscan-cu13
12.x (どのGPUでも) holoscan-cu12

前提条件:PATHにCUDA Toolkitが設定されていること、Python 3.10–3.13。オプションの追加要件:LibTorch 2.11.0以上、ONNX Runtime 1.22.0以上。

必ず Python 仮想環境にインストールしてください。これによりシステムパッケージとの競合を回避でき、Ubuntu 24.04(システム全体の pip を完全にブロックする)では必須となります。

ステップ 1: venv の作成と有効化

まず、venvが存在するかどうかを確認します:

ls ~/holoscan/venv 2>/dev/null && echo "exists" || echo "missing"

存在しない場合:

python3 -m venv ~/holoscan/venv

その後、有効化します:

source ~/holoscan/venv/bin/activate

ステップ 2: インストール

pip install holoscan-cu12   # または holoscan-cu13

ステップ 3: 確認

以下のすべてのコマンドを実行するには、venv がアクティブである必要があります。

# 基本的なインポート — 期待される出力: バージョン文字列(例: "4.1.0")
# スタックサイズに関する RuntimeWarning は問題ありません。ulimit -s 32768 を実行すると表示されなくなります。
python3 -c "import holoscan; print(holoscan.__version__)"

# GitHub から、インストール済みのバージョンタグに対応する Python サンプルを取得します。
# これらは NVIDIA の公式サンプルであり、HTTPS 経由で取得され、インストール済みのホイール (v${SDK_VER}) と一致するタグに固定されています。
# 実行する前に、ユーザーに次のように通知してください
# このURLからリモートのサンプルスクリプトをダウンロードして実行しようとしていることをユーザーに伝えてください。もし
# ユーザーが拒否した場合、またはGitHubに接続できない場合は、手順4のサンプル閲覧に進んでください。
SDK_VER=$(python3 -c "import holoscan; print(holoscan.__version__)")
BASE="https://raw.githubusercontent.com/nvidia-holoscan/holoscan-sdk/v${SDK_VER}/examples"

# hello_world — 期待される出力: "Hello World!"
curl -fsSL "${BASE}/hello_world/python/hello_world.py" -o /tmp/hs_hello_world.py
ulimit -s 32768 && python3 /tmp/hs_hello_world.py

# video_replayer (10 フレーム、ヘッドレス) — 期待される出力: "Graph execution finished."
# 常にヘッドレスで実行: ディスプレイの有無にかかわらず動作し、SSH経由でのGUIの障害を回避します。
curl -fsSL "${BASE}/video_replayer/python/video_replayer.py" -o /tmp/hs_video_replayer.py
curl -fsSL "${BASE}/video_replayer/python/video_replayer.yaml" -o /tmp/hs_video_replayer.yaml
python3 -c "
c = open('/tmp/hs_video_replayer.yaml').read()
c = c.replace('count: 0','count: 10').replace('repeat: true','repeat: false').replace('realtime: true','realtime: false')
c = c.replace('holoviz:\n  width: 854','holoviz:\n  headless: true\n  width: 854')
open('/tmp/hs_video_replayer_run.yaml','w').write(c)"
ulimit -s 32768 && HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data \
  python3 /tmp/hs_video_replayer.py --config /tmp/hs_video_replayer_run.yaml

注:video_replayer にはracerx データファイルが必要です。これらは Debian パッケージに同梱されており、/opt/nvidia/holoscan/data にあります。 Debian パッケージがインストールされていない場合は、まずsudo /opt/nvidia/holoscan/examples/download_example_dataを実行してください(このスクリプトを実行するには apt パッケージのインストールが必要です)。または、HOLOSCAN_INPUT_PATH をデータの保存先に設定してください。

ステップ 4: ユーザーへの注意喚起

ユーザーは、新しいシェルセッションごとに venv をアクティブ化する必要があります:

source ~/holoscan/venv/bin/activate
ulimit -s 32768   # スタックサイズの警告を抑制

その後、次の手順を案内してください:

  • https://github.com/nvidia-holoscan/holoscan-sdk/tree/v/examplesで Python のサンプルを参照してください
  • 具体的な例を順を追って解説する:/explain-example
  • カスタム Holoscan アプリケーションの構築を開始する

トラブルシューティング

  • pip install holoscan-cu12を実行すると、「externally-managed-environment」というエラーが発生します。Ubuntu 24.04では、システム全体の pip がブロックされています。まず、ステップ 1 の手順に従って venv を作成し、有効化してください。
  • ImportError/holoscan のインポート時に CUDA が間違っています。Wheel バリアントがホストの CUDA と一致しません。一致するものアンインストールして再インストールしてください:pip uninstall -y holoscan-cu13 && pip install holoscan-cu12(またはその逆)。
  • RuntimeWarning: スタックサイズ ....問題はありませんが、警告を表示させないようにするには、現在のシェルでulimit -s 32768を設定してください。
  • サンプル実行時にセグメンテーションフォルトが発生。 ulimit -s 32768が設定されていませんでした。python3 の実行前に設定してください……。
  • video_replayer が racerx/ を見つけられません。 HOLOSCAN_INPUT_PATH が、それが含まれるディレクトリを指していません。/opt/nvidia/holoscan/data 用の Debian パッケージをインストールするか、HOLOSCAN_INPUT_PATHをデータが存在する場所へ設定してください。
  • source: no such file: ~/holoscan/venv/bin/activateが新しいシェルで発生しました。venv が作成されていないか、パスが異なります。ステップ 1 を再実行するか、パスを修正してください。
GitHubで見る
---
name: holoscan-install-wheel
description: Install the Holoscan SDK Python wheel via pip into a virtual environment and verify with example scripts.
license: Apache-2.0
---

# Holoscan pip Wheel Installation

## Purpose

Install the Holoscan SDK Python bindings via the `holoscan-cu12` / `holoscan-cu13` pip wheel into a virtual environment, and verify with `hello_world` and `video_replayer`.

## Prerequisites

- Linux x86_64 with NVIDIA GPU + driver (`nvidia-smi`).
- CUDA Toolkit on `PATH` matching the host CUDA major (12 or 13).
- Python 3.10–3.13 with `venv` available.
- Network access to PyPI and `docs.nvidia.com`.

## Limitations

- Python only. For C++ headers/libs, pair with `/holoscan-install-debian`.
- `holoscan-cu12` and `holoscan-cu13` are mutually exclusive — wheel must match host CUDA driver.
- `video_replayer` data ships only with the Debian package; without it, set `HOLOSCAN_INPUT_PATH` to a directory containing `racerx/`.
- `ulimit -s 32768` is recommended in every shell that runs Holoscan — without it some apps emit a stack-size warning or, in rarer cases, segfault.

## Step 0: Consult the Official Install Instructions

Always fetch the pip-wheel section of `https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html` before installing. Extract: exact wheel package names (`holoscan-cu12`, `holoscan-cu13`), the supported Python range for the current release, prerequisites that must be on `PATH` (CUDA Toolkit), and any optional extras (LibTorch / ONNX Runtime version pins). If the doc disagrees with anything below, the doc wins.

You need the CUDA variant already determined. If not known, run `nvidia-smi 2>&1 | head -5` first.

**CUDA variant rule — pick the pip package:**

| nvidia-smi CUDA Version | pip package |
|------------------------|-------------|
| 13.x+ | `holoscan-cu13` |
| 12.x (any GPU) | `holoscan-cu12` |

Prerequisites: CUDA Toolkit on PATH, Python 3.10–3.13. Optional extras: LibTorch 2.11.0+, ONNX Runtime 1.22.0+.

Always install into a Python virtual environment — this avoids system-package conflicts and is required on Ubuntu 24.04 (which blocks system-wide pip entirely).

## Step 1: Create and Activate the venv

Check if one exists first:

```bash
ls ~/holoscan/venv 2>/dev/null && echo "exists" || echo "missing"
```

If missing:
```bash
python3 -m venv ~/holoscan/venv
```

Then activate:
```bash
source ~/holoscan/venv/bin/activate
```

## Step 2: Install

```bash
pip install holoscan-cu12   # or holoscan-cu13
```

## Step 3: Verify

The venv must be active for all commands below.

```bash
# Basic import — expected: version string, e.g. "4.1.0"
# The stack-size RuntimeWarning is harmless; ulimit -s 32768 suppresses it.
python3 -c "import holoscan; print(holoscan.__version__)"

# Fetch Python examples from GitHub at the installed version tag.
# These are official NVIDIA examples, fetched over HTTPS and pinned to the tag
# matching the installed wheel (v${SDK_VER}). Before running them, tell the user
# you're about to download and execute remote example scripts from this URL. If
# they decline or GitHub is unreachable, skip to browsing the examples in Step 4.
SDK_VER=$(python3 -c "import holoscan; print(holoscan.__version__)")
BASE="https://raw.githubusercontent.com/nvidia-holoscan/holoscan-sdk/v${SDK_VER}/examples"

# hello_world — expected: "Hello World!"
curl -fsSL "${BASE}/hello_world/python/hello_world.py" -o /tmp/hs_hello_world.py
ulimit -s 32768 && python3 /tmp/hs_hello_world.py

# video_replayer (10 frames, headless) — expected: "Graph execution finished."
# Always run headless: works with or without a display, avoids GUI failure modes over SSH.
curl -fsSL "${BASE}/video_replayer/python/video_replayer.py" -o /tmp/hs_video_replayer.py
curl -fsSL "${BASE}/video_replayer/python/video_replayer.yaml" -o /tmp/hs_video_replayer.yaml
python3 -c "
c = open('/tmp/hs_video_replayer.yaml').read()
c = c.replace('count: 0','count: 10').replace('repeat: true','repeat: false').replace('realtime: true','realtime: false')
c = c.replace('holoviz:\n  width: 854','holoviz:\n  headless: true\n  width: 854')
open('/tmp/hs_video_replayer_run.yaml','w').write(c)"
ulimit -s 32768 && HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data \
  python3 /tmp/hs_video_replayer.py --config /tmp/hs_video_replayer_run.yaml
```

Note: `video_replayer` needs the racerx data files. These ship with the Debian package at `/opt/nvidia/holoscan/data`. If the Debian package is not installed, run `sudo /opt/nvidia/holoscan/examples/download_example_data` first (requires the apt package to be installed for that script), or set `HOLOSCAN_INPUT_PATH` to wherever the data lives.

## Step 4: Remind the User

They must activate the venv in each new shell session:

```bash
source ~/holoscan/venv/bin/activate
ulimit -s 32768   # suppress stack-size warning
```

Then offer next steps:
- Explore Python examples at `https://github.com/nvidia-holoscan/holoscan-sdk/tree/v<VERSION>/examples`
- Walk through a specific example: `/explain-example`
- Start building a custom Holoscan application

## Troubleshooting

- **`pip install holoscan-cu12` errors with "externally-managed-environment".** Ubuntu 24.04 blocks system-wide pip. Create and activate the venv from Step 1 first.
- **`ImportError` / wrong CUDA at `import holoscan`.** Wheel variant doesn't match host CUDA. Uninstall and reinstall the matching one: `pip uninstall -y holoscan-cu13 && pip install holoscan-cu12` (or vice versa).
- **`RuntimeWarning: stack size ...`.** Harmless, but set `ulimit -s 32768` in the current shell to silence it.
- **Segmentation fault when running an example.** `ulimit -s 32768` wasn't set. Set it before `python3 ...`.
- **`video_replayer` can't find `racerx/`.** `HOLOSCAN_INPUT_PATH` isn't pointing at a directory containing it. Install the Debian package for `/opt/nvidia/holoscan/data`, or set `HOLOSCAN_INPUT_PATH` to wherever the data lives.
- **`source: no such file: ~/holoscan/venv/bin/activate` in a new shell.** Venv wasn't created or path differs. Re-run Step 1 or correct the path.

すべてのファイル

5件のファイル

holoscan-install-wheelをインストール

スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。

ZIPをダウンロード

リポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。

git clone https://github.com/NVIDIA/skills/tree/main/skills/holoscan-install-wheel # Copy SKILL.md to your .claude/skills/ directory

コピー コピー
クイックセットアップ: スキルフォルダを .claude/skills/ にコピーしてください。 Claude が自動的にそのスキルを検出して使用します。
リポジトリ NVIDIA/skills

関連スキル

algorithmic-art
更新された時間 2026年8月27日
systematic-debugging
更新された時間 2026年9月3日
tech-debt-tracker
更新された時間 2026年8月29日
continual-learning
更新された時間 2026年9月10日
OR