Option
HeimHeim Skill DevOps und CI/CD holoscan-install-source

holoscan-install-source

NVIDIA/skills NVIDIA/skills

Kompilieren Sie das Holoscan-SDK aus dem Quellcode mithilfe des im Quellcode-Verzeichnis enthaltenen Docker-basierten Build-Skripts, wodurch ein lokaler Installationsbaum für CMake-basierte Anwendungen erstellt wird.

...Alle erweitern
0
Zeit aktualisiert 25. September 2026

Holoscan SDK – Aus dem Quellcode kompilieren

Zweck

Kompilieren Sie das Holoscan SDK aus dem nvidia-holoscan/holoscan-sdk Quellcode-Baum mithilfe des zugehörigen ./run Skript (das in einem Docker-Container kompiliert) und erstellen Sie einen lokalen Installationsbaum, der als CMake-Abhängigkeit verwendet werden kann.

Voraussetzungen

  • Linux-Host mit NVIDIA-GPU + Treiber (nvidia-smi).
  • git, Docker mit NVIDIA Container Toolkit (docker run --gpus all funktioniert) sowie docker-buildx-plugin.
  • ca. 20 GB freier Speicherplatz für den Build-Container sowie die Build- und Installationsverzeichnisse.
  • 10–30 Minuten für einen sauberen Erstbuild.

Einschränkungen

  • Nur empfehlenswert, wenn veröffentlichte Pakete (Conda / Container / apt / wheel) nicht passen – Debug-Symbole, benutzerdefinierte CMake-Optionen oder nicht unterstützte Konfigurationen.
  • Erfordert weiterhin Docker – die ./run Skript führt den Build innerhalb eines Containers durch; es handelt sich nicht um einen echten Bare-Metal-Build.
  • Für die Cross-Kompilierung auf aarch64 ist qemu-user-static auf dem Host.

Schritt 0: Lesen Sie die offiziellen Installationsanweisungen

Rufen Sie immer den Abschnitt „Build from Source“ von https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html (sowie die verlinkte GitHub-Seite README.md / DEVELOP.md für das ausgewählte Tag) ein, bevor Sie mit dem Kompilieren beginnen. Auszug: erforderliche ./run Flags für die Zielarchitektur und die CUDA-Hauptversion, die unterstützten Branches/Tags, alle für die Version angegebenen Dockerfile-Patches sowie die zur Verifizierung empfohlenen Testnamen. Sollten die Anleitungen im Widerspruch zu den folgenden Angaben stehen, haben die Anleitungen Vorrang.

Schritt 1: Voraussetzungen

Überprüfen Sie, ob Git und Docker (mit GPU-Passthrough) verfügbar sind:

git --version
docker --version
docker run --rm --gpus all ubuntu:22.04 nvidia-smi
  • Falls Docker fehlt → Hilfe zur Installation unter https://docs.docker.com/engine/install/
  • Wenn der GPU-Passthrough fehlschlägt → NVIDIA Container Toolkit installieren:
    curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
    curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
      | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
      | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
    sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
    sudo nvidia-ctk runtime configure --runtime=docker && sudo systemctl restart docker
    
  • Falls Docker buildx fehlt: sudo apt-get install docker-buildx-plugin

Schritt 2: Repository klonen

Klonen Sie das Repository bei Bedarf nach ~/holoscan/holoscan-sdk

mkdir -p ~/holoscan/
git clone https://github.com/nvidia-holoscan/holoscan-sdk.git
cd ~/holoscan/holoscan-sdk

So erstellen Sie ein bestimmtes Release-Tag (aus Stabilitätsgründen empfohlen):

git tag | grep -E '^v[0-9]' | sort -V | tail -5   # list recent tags
git checkout v                             # e.g. v4.1.0

Schritt 3: Erstellen

Das ./run build Skript übernimmt die Erstellung des Containers, die CMake-Konfiguration, die Kompilierung und die Installation in einem Schritt. Weisen Sie den Benutzer darauf hin, dass dies beim ersten Durchlauf 10–30 Minuten dauert (Herunterladen des Basis-Images + Kompilieren).

./run build

Gängige Optionen:

Flag Zweck
--type debug Debug-Build (Symbole, keine Optimierung)
--type RelWithDebInfo Release + Debug-Symbole
--arch aarch64 Cross-Kompilierung für ARM64 (erfordert sudo apt install qemu-user-static)
--gpu igpu iGPU-Build für Jetson/IGX
--dryrun Befehle in der Vorschau anzeigen, ohne sie auszuführen

Falls nach dem Ändern von Optionen CMake-Cache-Fehler auftreten:

./run clear_cache && ./run build

Die Ausgabe wird in diesen Ordnern gespeichert und kann mit ./run get_build_dir und ./run get_install_dir

  • Build-Verzeichnis: build-cu-/
  • Installationsverzeichnis: install-cu-/.

Schritt 4: Tests ausführen

Führen Sie die folgenden Tests aus

  • EXAMPLE_CPP_HELLO_WORLD_TEST
  • EXAMPLE_PYTHON_HELLO_WORLD_TEST
  • EXAMPLE_CPP_TENSOR_INTEROP_TEST
  • EXAMPLE_PYTHON_TENSOR_INTEROP_TEST
  • EXAMPLE_CPP_VIDEO_REPLAYER_TEST
  • BEISPIEL_PYTHON_VIDEO_REPLAYER_TEST
./run test

Um alle sechs erforderlichen Tests auf einmal auszuführen, verwenden Sie einen regulären Ausdruck in einfachen Anführungszeichen (der | muss in Anführungszeichen gesetzt werden, damit bash sie nicht als Pipe interpretiert):

./run test --options "-R 'EXAMPLE_CPP_HELLO_WORLD_TEST|EXAMPLE_PYTHON_HELLO_WORLD_TEST|EXAMPLE_CPP_TENSOR_INTEROP_TEST|EXAMPLE_PYTHON_TENSOR_INTEROP_TEST|EXAMPLE_CPP_VIDEO_REPLAYER_TEST|EXAMPLE_PYTHON_VIDEO_REPLAYER_TEST' --output-on-failure"

Führen Sie einen bestimmten Test anhand des Namens oder eines regulären Ausdrucks aus:

./run test --name 
./run test --options "-R '' --output-on-failure"
./run test --verbose

Wichtig: Setzen Sie den regulären Ausdruck immer in einfache Anführungszeichen, wenn er | – ohne Anführungszeichen interpretiert bash | als Pipe, und der Befehl schlägt mit command not found.

Erwartet: Alle Tests werden bestanden. Notieren Sie etwaige Fehler und melden Sie diese dem Benutzer, bevor Sie fortfahren.

Schritt 5: Anwendungen auf den Installationsbaum verweisen

Nach der Erstellung können Anwendungen den Installationsbaum als CMake-Abhängigkeit verwenden. Geben Sie dem Benutzer diesen Pfad an:

/path/to/holoscan-sdk/install-cu-/

Er kann Holoscan_ROOT oder CMAKE_PREFIX_PATH auf dieses Verzeichnis setzen, wenn er seine eigenen Anwendungen erstellt.

Fehlerbehebung

Symptom Behebung
bash: : command not found beim Ausführen von Tests Der reguläre Ausdruck enthält | — setzen Sie sie in einfache Anführungszeichen: --options "-R ''"
CMake-Cache-Fehler nach Änderung einer Option ./run clear_cache && ./run build
Docker buildx nicht gefunden sudo apt-get install docker-buildx-plugin
GPU im Build-Container nicht sichtbar NVIDIA Container Toolkit überprüfen und erneut ausführen sudo nvidia-ctk runtime configure --runtime=docker
Cross-Kompilierung schlägt fehl (aarch64) Installieren Sie qemu: sudo apt-get install qemu-user-static
Auf GitHub ansehen
---
name: holoscan-install-source
description: Build the Holoscan SDK from source using its in-tree Docker-based build script, producing a local install tree for CMake-based applications.
license: Apache-2.0
---

# Holoscan SDK — Build from Source

## Purpose

Build the Holoscan SDK from the `nvidia-holoscan/holoscan-sdk` source tree using its `./run` script (which builds inside a Docker container), producing a local install tree consumable as a CMake dependency.

## Prerequisites

- Linux host with NVIDIA GPU + driver (`nvidia-smi`).
- `git`, Docker with NVIDIA Container Toolkit (`docker run --gpus all` works), and `docker-buildx-plugin`.
- ~20 GB free disk for the build container + build/install trees.
- 10–30 min for a clean first build.

## Limitations

- Only recommended when published packages (Conda / container / apt / wheel) don't fit — debug symbols, custom CMake options, or unsupported configs.
- Still requires Docker — the `./run` script builds inside a container; this is not a true bare-metal build.
- Cross-compiling to aarch64 needs `qemu-user-static` on the host.

## Step 0: Consult the Official Install Instructions

Always fetch the "Build from Source" section of `https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html` (and the linked GitHub `README.md` / `DEVELOP.md` for the chosen tag) before building. Extract: required `./run` flags for the target architecture and CUDA major, supported branches/tags, any Dockerfile patches called out for the release, and the test names recommended for verification. If the doc disagrees with anything below, the doc wins.

## Step 1: Prerequisites

Check that git and Docker (with GPU passthrough) are available:

```bash
git --version
docker --version
docker run --rm --gpus all ubuntu:22.04 nvidia-smi
```

- If Docker is missing → help install from https://docs.docker.com/engine/install/
- If GPU passthrough fails → install NVIDIA Container Toolkit:
  ```bash
  curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
  curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list \
    | sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' \
    | sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
  sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
  sudo nvidia-ctk runtime configure --runtime=docker && sudo systemctl restart docker
  ```
- If Docker buildx is missing: `sudo apt-get install docker-buildx-plugin`

## Step 2: Clone the Repository

Clone repo to ~/holoscan/holoscan-sdk if needed

```bash
mkdir -p ~/holoscan/
git clone https://github.com/nvidia-holoscan/holoscan-sdk.git
cd ~/holoscan/holoscan-sdk
```

To build a specific release tag (recommended for stability):

```bash
git tag | grep -E '^v[0-9]' | sort -V | tail -5   # list recent tags
git checkout v<VERSION>                             # e.g. v4.1.0
```

## Step 3: Build

The `./run build` script handles container creation, CMake configuration, compilation, and install in one step. Warn the user this takes **10–30 minutes** on first run (downloads base image + compiles).

```bash
./run build
```

Common options:

| Flag | Purpose |
|------|---------|
| `--type debug` | Debug build (symbols, no optimization) |
| `--type RelWithDebInfo` | Release + debug symbols |
| `--arch aarch64` | Cross-compile for ARM64 (needs `sudo apt install qemu-user-static`) |
| `--gpu igpu` | iGPU build for Jetson/IGX |
| `--dryrun` | Preview commands without executing |

If CMake cache errors occur after changing options:

```bash
./run clear_cache && ./run build
```

Output lands in these folders, and can be retrieved with `./run get_build_dir` and `./run get_install_dir`
* Build dir: `build-cu<N>-<arch>/`
* Install dir: `install-cu<N>-<arch>/`.

## Step 4: Run Tests

Run the following tests
* EXAMPLE_CPP_HELLO_WORLD_TEST
* EXAMPLE_PYTHON_HELLO_WORLD_TEST
* EXAMPLE_CPP_TENSOR_INTEROP_TEST
* EXAMPLE_PYTHON_TENSOR_INTEROP_TEST
* EXAMPLE_CPP_VIDEO_REPLAYER_TEST
* EXAMPLE_PYTHON_VIDEO_REPLAYER_TEST

```bash
./run test
```

To run all six required tests at once, use a single-quoted regex (the `|` must be quoted to prevent bash from treating it as a pipe):

```bash
./run test --options "-R 'EXAMPLE_CPP_HELLO_WORLD_TEST|EXAMPLE_PYTHON_HELLO_WORLD_TEST|EXAMPLE_CPP_TENSOR_INTEROP_TEST|EXAMPLE_PYTHON_TENSOR_INTEROP_TEST|EXAMPLE_CPP_VIDEO_REPLAYER_TEST|EXAMPLE_PYTHON_VIDEO_REPLAYER_TEST' --output-on-failure"
```

Run a specific test by name or regex:

```bash
./run test --name <test_name>
./run test --options "-R '<regex>' --output-on-failure"
./run test --verbose
```

**Important:** Always single-quote the regex string when it contains `|` — without quotes, bash interprets `|` as a pipe and the command fails with `command not found`.

Expected: all tests pass. Note any failures and report them to the user before continuing.

## Step 5: Point Applications at the Install Tree

Once built, applications can use the install tree as a CMake dependency. Give the user this path:

```
/path/to/holoscan-sdk/install-cu<N>-<arch>/
```

They can set `Holoscan_ROOT` or `CMAKE_PREFIX_PATH` to this directory when building their own applications.

## Troubleshooting

| Symptom | Fix |
|---------|-----|
| `bash: <TEST_NAME>: command not found` when running tests | The regex contains `\|` — wrap it in single quotes: `--options "-R '<regex>'"` |
| CMake cache errors after option change | `./run clear_cache && ./run build` |
| Docker buildx not found | `sudo apt-get install docker-buildx-plugin` |
| GPU not visible inside build container | Verify NVIDIA Container Toolkit and re-run `sudo nvidia-ctk runtime configure --runtime=docker` |
| Cross-compile fails (aarch64) | Install qemu: `sudo apt-get install qemu-user-static` |

holoscan-install-source installieren

Laden Sie die Skill-Dateien herunter und entpacken Sie sie in Ihr Verzeichnis „.claude/skills/“.

ZIP herunterladen

Klonen Sie das Repository und kopieren Sie die Skill-Dateien in Ihr Projekt.

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

Kopieren Kopieren
Schnelle Einrichtung: Kopiere den Skill-Ordner nach .claude/skills/ Claude erkennt den Skill automatisch und nutzt ihn.
Repository NVIDIA/skills

Ähnliche Skills

Verification &amp; Quality Assurance
Zeit aktualisiert 29. Juni 2026
klingai-upgrade-migration
Zeit aktualisiert 3. Juli 2026
base44-cli
Zeit aktualisiert 29. Juni 2026
Railway CLI Management
Zeit aktualisiert 2. Juli 2026
OR