holoscan-install-container
NVIDIA/skills
Téléchargez et vérifiez le conteneur officiel du SDK Holoscan depuis NGC, en sélectionnant la balise CUDA/arch adaptée au GPU hôte et en effectuant des tests à l'aide des exemples Python et C++ fournis.
...Développer toutInstallation du conteneur Holoscan NGC
Objectif
Télécharger et vérifier le conteneur officiel du SDK Holoscan depuis NGC (nvcr.io/nvidia/clara-holoscan/holoscan), en sélectionnant la balise CUDA/arch adaptée au GPU hôte et en validant le tout à l'aide des exemples Python et C++ fournis.
Prérequis
- Hôte Linux équipé d’un GPU NVIDIA et d’un pilote fonctionnel (
nvidia-smi). - Docker doit être installé et l'utilisateur doit faire partie du groupe
docker(ou disposer des droitssudo). - NVIDIA Container Toolkit doit être installé (la commande «
docker run --gpus all» doit fonctionner). - Environ 10 à 20 Go d'espace disque libre pour le téléchargement de l'image.
- Accès réseau à
nvcr.ioetdocs.nvidia.com.
Restrictions
- Les images de conteneurs ne couvrent que la matrice de balises ci-dessous — aucun environnement Conda/pip n’y est inclus.
- Les exemples d’interface graphique nécessitent un transfert X11 ; cette compétence exécute Holoviz en mode sans affichage pour éviter cela.
- Le suffixe de balise doit correspondre au GPU/pilote de l’hôte (cuda13 / cuda12-dgpu / cuda12-igpu) — un suffixe incorrect entraîne des échecs d’initialisation de CUDA.
Instructions
- Dépôt de conteneurs :
nvcr.io/nvidia/clara-holoscan/holoscan. - La page de documentation disponible à l’adresse https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html fait autorité — consultez-la en cas de divergence avec les informations ci-dessous.
- Suivez les étapes ci-dessous dans l’ordre : choisissez le tag, vérifiez le passthrough GPU et effectuez un pull, vérifiez à l’aide des six exemples, puis transmettez la commande de lancement.
Étape 1 : Choisissez la balise
Balise = , par exemple v4.1.0-cuda13. Récupérez la version actuelle du SDK sur la page de documentation ci-dessus ; choisissez le suffixe à partir de nvidia-smi (le champ « CUDA Version », en haut à droite de l'en-tête du tableau) :
nvidia-smi Version CUDA |
Suffixe |
|---|---|
| 13.x+ | cuda13 |
| 12.x, GPU Ampere/Ada | cuda12-dgpu |
| 12.x, iGPU ARM64 (nvgpu) | cuda12-igpu |
Le message « Mode de compatibilité ascendante CUDA ACTIVÉ » s'affiche normalement (il ne s'agit pas d'une erreur) lorsque le conteneur utilise une version mineure de CUDA plus récente que celle prise en charge par le pilote hôte. Le shim de compatibilité ascendante permet au runtime CUDA du conteneur de fonctionner avec l'ancien pilote hôte au sein de la même version majeure.
Étape 2 : Vérifiez le passthrough du GPU, puis effectuez un pull
docker run --rm --gpus all ubuntu:22.04 nvidia-smi 2>&1 | tail -5
Si Docker n’est pas installé → installez-le à partir de https://docs.docker.com/engine/install/. Si le passthrough du GPU échoue → installez le NVIDIA Container Toolkit en suivant les instructions sur https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html, puis réessayez.
Téléchargement (~10–20 Go — avertir l'utilisateur avant de commencer) :
docker pull nvcr.io/nvidia/clara-holoscan/holoscan:
Étape 3 : Vérification à l’aide de six exemples
Les tests couvrent : la liaison Python seule (1a), le runtime C++ seul (1b, 2a), Python + Holoviz/Vulkan (2b, 3a) et C++ + Holoviz/Vulkan (3b). Les exemples Holoviz s’exécutent toujours en mode « headless » (ajoutez « headless: true » dans le fichier YAML) — cela fonctionne qu’un écran soit connecté ou non et évite les défaillances de l’interface graphique via SSH.
IMG=nvcr.io/nvidia/clara-holoscan/holoscan :
RUN=(docker run --rm --runtime=nvidia --gpus all --cap-add CAP_SYS_PTRACE --ipc=host --ulimit memlock=-1 --ulimit stack=67108864)
# 1a. hello_world (Python) — attend « Hello World ! »
"${RUN[@]}" "$IMG" bash -c \
"ulimit -s 32768 && python3 /opt/nvidia/holoscan/examples/hello_world/python/hello_world.py"
# 1b. hello_world (C++) — résultat attendu : « Hello World ! »
"${RUN[@]}" "$IMG" bash -c \
"ulimit -s 32768 && /opt/nvidia/holoscan/examples/hello_world/cpp/hello_world"
# 2a. tensor_interop (C++) — résultat attendu : les tenseurs doublent à chaque passage, « Graph execution finished. »
"${RUN[@]}" "$IMG" bash -c \
"ulimit -s 32768 && /opt/nvidia/holoscan/examples/tensor_interop/cpp/tensor_interop"
# 2b. tensor_interop (Python, 10 images) — Holoviz, en mode headless. Le fichier YAML ne comporte pas
# de champ « headless » par défaut ; il faut donc en ajouter un sous `holoviz:`. On s'attend à
# « message reçu (nombre : 10) ».
"${RUN[@]}" "$IMG" bash -c "
ulimit -s 32768
sed -e 's/count: 0/count: 10/' \
-e 's/repeat: true/repeat: false/' \
-e 's/realtime: true/realtime: false/' \
-e 's/^holoviz:/holoviz:\n headless: true/' \
/opt/nvidia/holoscan/examples/tensor_interop/python/tensor_interop.yaml > /tmp/ti.yaml
cd /opt/nvidia/holoscan/examples/tensor_interop/python
python3 tensor_interop.py --config /tmp/ti.yaml
"
# 3a. video_replayer (Python, 10 images) — Holoviz, en mode headless. Ajoutez `headless: true`
# sous `holoviz:` (au-dessus de `width: 854`). La même commande sed fonctionne pour le fichier YAML C++ de l'exemple 3b —
# les deux fichiers partagent la même structure de section `holoviz:`.
"${RUN[@]}" "$IMG" bash -c "
ulimit -s 32768
sed -e 's/count: 0/count: 10/' \
-e 's/repeat: true/repeat: false/' \
-e 's/realtime: true/realtime: false/' \
-e 's/^ width: 854/ headless: true\n width: 854/' \
/opt/nvidia/holoscan/examples/video_replayer/python/video_replayer.yaml > /tmp/vr.yaml
cd /opt/nvidia/holoscan/examples/video_replayer/python
HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data python3 video_replayer.py --config /tmp/vr.yaml
"
# 3b. video_replayer (C++, 10 images) — même injection sans interface graphique que 3a. Le fichier YAML de C++
# code en dur `directory: "../data/racerx"`, mais HOLOSCAN_INPUT_PATH
# le remplace ; nous n’avons donc pas besoin de modifier ce champ.
"${RUN[@]}" "$IMG" bash -c "
ulimit -s 32768
sed -e 's/count: 0/count: 10/' \
-e 's/repeat: true/repeat: false/' \
-e 's/realtime: true/realtime: false/' \
-e 's/^ width: 854/ headless: true\n width: 854/' \
/opt/nvidia/holoscan/examples/video_replayer/cpp/video_replayer.yaml > /tmp/vr_cpp.yaml
cd /opt/nvidia/holoscan/examples/video_replayer/cpp
HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data ./video_replayer --config /tmp/vr_cpp.yaml
"
Étape 4 : Commande de lancement
- Consultez la page https://catalog.ngc.nvidia.com/orgs/nvidia/teams/clara-holoscan/containers/holoscan.
- Expliquez à l’utilisateur les options Docker ci-dessous.
- Renvoyez l’utilisateur vers ce lien pour connaître d’autres options (par exemple, comment monter des périphériques vidéo V4L2).
docker run -it --rm \
--runtime=nvidia --gpus all --cap-add CAP_SYS_PTRACE \
--ipc=host --ulimit memlock=-1 --ulimit stack=67108864 \
nvcr.io/nvidia/clara-holoscan/holoscan:
# Exemples : /opt/nvidia/holoscan/examples/
# Monter des fichiers : -v /host/path:/container/path
# Exemples d'interface graphique : ajoutez -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY
Suivant :
- Explorer :
ls /opt/nvidia/holoscan/examples/ - Suivez le guide pas à pas :
/holoscan-explain-example
Dépannage
docker : Réponse d'erreur du démon : impossible de sélectionner le pilote de périphérique « nvidia ».NVIDIA Container Toolkit est manquant ou n'est pas configuré. Installez-le en suivant le lien de l'étape 2, puis redémarrez Docker.- Échec de l'initialisation de CUDA à l'intérieur du conteneur. Le suffixe de balise ne correspond pas à celui de l'hôte. Vérifiez à nouveau la version CUDA
via nvidia-smiet le tableau de l'étape 1. - Erreur de segmentation lors du lancement d’un exemple. La commande `
ulimit -s 32768` n’a pas été appliquée à l’intérieur du conteneur. Utilisez le modèle`bash -c "ulimit -s 32768 && ..."`indiqué à l’étape 3. - L'exemple Holoviz se bloque / aucune fenêtre n'apparaît via SSH. Le fichier YAML n'a pas été modifié pour inclure «
headless: true». Utilisez l'injectionsedindiquée à l'étape 3. video_replayerne parvient pas à trouver les données. DéfinissezHOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data— cela remplace le chemin d'accès codé en dur dans le fichier YAML.
---
name: holoscan-install-container
description: Pull and verify the official Holoscan SDK container from NGC, selecting the correct CUDA/arch tag for the host GPU and validating with bundled Python and C++ examples.
license: Apache-2.0
---
# Holoscan NGC Container Installation
## Purpose
Pull and verify the official Holoscan SDK container from NGC (`nvcr.io/nvidia/clara-holoscan/holoscan`), selecting the right CUDA/arch tag for the host GPU and validating with the bundled Python and C++ examples.
## Prerequisites
- Linux host with an NVIDIA GPU and a working driver (`nvidia-smi`).
- Docker installed and the user in the `docker` group (or `sudo`).
- NVIDIA Container Toolkit installed (`docker run --gpus all` works).
- ~10–20 GB free disk for the image pull.
- Network access to `nvcr.io` and `docs.nvidia.com`.
## Limitations
- Container images cover only the tag matrix below — no Conda/pip env inside.
- GUI examples require X11 forwarding; this skill runs Holoviz headless to avoid that.
- Tag suffix must match the host GPU/driver (cuda13 / cuda12-dgpu / cuda12-igpu) — wrong suffix → CUDA init failures.
## Instructions
- Container repo: `nvcr.io/nvidia/clara-holoscan/holoscan`.
- The doc page at https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html is canonical — fetch it if anything below disagrees.
- Work through the steps below in order: pick the tag, verify GPU passthrough and pull, verify with the six examples, then hand off the launch command.
## Step 1: Pick the tag
Tag = `<version>-<suffix>`, e.g. `v4.1.0-cuda13`. Get the current SDK version from the doc page above; pick the suffix from `nvidia-smi` (the "CUDA Version" field, top-right of the table header):
| `nvidia-smi` CUDA Version | Suffix |
|---|---|
| 13.x+ | `cuda13` |
| 12.x, Ampere/Ada dGPU | `cuda12-dgpu` |
| 12.x, ARM64 iGPU (nvgpu) | `cuda12-igpu` |
The "CUDA Forward Compatibility mode ENABLED" banner is expected — not an error — when the container ships a newer CUDA minor version than the host driver supports. The forward-compat shim lets the container's CUDA runtime work against the older host driver within the same major version.
## Step 2: Verify GPU passthrough, then pull
```bash
docker run --rm --gpus all ubuntu:22.04 nvidia-smi 2>&1 | tail -5
```
If Docker is missing → install from https://docs.docker.com/engine/install/. If GPU passthrough fails → install the NVIDIA Container Toolkit per https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html, then retry.
Pull (~10–20 GB — warn the user before starting):
```bash
docker pull nvcr.io/nvidia/clara-holoscan/holoscan:<TAG>
```
## Step 3: Verify with six examples
Tests cover: bare Python binding (1a), bare C++ runtime (1b, 2a), Python + Holoviz/Vulkan (2b, 3a), and C++ + Holoviz/Vulkan (3b). Holoviz examples always run headless (inject `headless: true` into the YAML) — this works whether or not a display is attached and avoids GUI failure modes over SSH.
```bash
IMG=nvcr.io/nvidia/clara-holoscan/holoscan:<TAG>
RUN=(docker run --rm --runtime=nvidia --gpus all --cap-add CAP_SYS_PTRACE --ipc=host --ulimit memlock=-1 --ulimit stack=67108864)
# 1a. hello_world (Python) — expect "Hello World!"
"${RUN[@]}" "$IMG" bash -c \
"ulimit -s 32768 && python3 /opt/nvidia/holoscan/examples/hello_world/python/hello_world.py"
# 1b. hello_world (C++) — expect "Hello World!"
"${RUN[@]}" "$IMG" bash -c \
"ulimit -s 32768 && /opt/nvidia/holoscan/examples/hello_world/cpp/hello_world"
# 2a. tensor_interop (C++) — expect tensors doubling each pass, "Graph execution finished."
"${RUN[@]}" "$IMG" bash -c \
"ulimit -s 32768 && /opt/nvidia/holoscan/examples/tensor_interop/cpp/tensor_interop"
# 2b. tensor_interop (Python, 10 frames) — Holoviz, headless. The YAML has no
# headless field by default, so inject one under `holoviz:`. Expect
# "message received (count: 10)".
"${RUN[@]}" "$IMG" bash -c "
ulimit -s 32768
sed -e 's/count: 0/count: 10/' \
-e 's/repeat: true/repeat: false/' \
-e 's/realtime: true/realtime: false/' \
-e 's/^holoviz:/holoviz:\n headless: true/' \
/opt/nvidia/holoscan/examples/tensor_interop/python/tensor_interop.yaml > /tmp/ti.yaml
cd /opt/nvidia/holoscan/examples/tensor_interop/python
python3 tensor_interop.py --config /tmp/ti.yaml
"
# 3a. video_replayer (Python, 10 frames) — Holoviz, headless. Inject `headless: true`
# under `holoviz:` (above `width: 854`). Same sed works for the C++ YAML in 3b —
# both files share the same `holoviz:` section shape.
"${RUN[@]}" "$IMG" bash -c "
ulimit -s 32768
sed -e 's/count: 0/count: 10/' \
-e 's/repeat: true/repeat: false/' \
-e 's/realtime: true/realtime: false/' \
-e 's/^ width: 854/ headless: true\n width: 854/' \
/opt/nvidia/holoscan/examples/video_replayer/python/video_replayer.yaml > /tmp/vr.yaml
cd /opt/nvidia/holoscan/examples/video_replayer/python
HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data python3 video_replayer.py --config /tmp/vr.yaml
"
# 3b. video_replayer (C++, 10 frames) — same headless injection as 3a. The C++
# YAML hard-codes `directory: "../data/racerx"`, but HOLOSCAN_INPUT_PATH
# overrides it, so we don't need to patch that field.
"${RUN[@]}" "$IMG" bash -c "
ulimit -s 32768
sed -e 's/count: 0/count: 10/' \
-e 's/repeat: true/repeat: false/' \
-e 's/realtime: true/realtime: false/' \
-e 's/^ width: 854/ headless: true\n width: 854/' \
/opt/nvidia/holoscan/examples/video_replayer/cpp/video_replayer.yaml > /tmp/vr_cpp.yaml
cd /opt/nvidia/holoscan/examples/video_replayer/cpp
HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data ./video_replayer --config /tmp/vr_cpp.yaml
"
```
## Step 4: Launch command
- Read https://catalog.ngc.nvidia.com/orgs/nvidia/teams/clara-holoscan/containers/holoscan.
- Explain the docker flags below to the user.
- Refer the user to that link for additional flags (e.g., how to mount V4L2 video devices).
```bash
docker run -it --rm \
--runtime=nvidia --gpus all --cap-add CAP_SYS_PTRACE \
--ipc=host --ulimit memlock=-1 --ulimit stack=67108864 \
nvcr.io/nvidia/clara-holoscan/holoscan:<TAG>
# Examples: /opt/nvidia/holoscan/examples/
# Mount files: -v /host/path:/container/path
# GUI examples: add -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY
```
Next:
- Explore: `ls /opt/nvidia/holoscan/examples/`
- Walk through one: `/holoscan-explain-example`
## Troubleshooting
- **`docker: Error response from daemon: could not select device driver "nvidia"`.** NVIDIA Container Toolkit is missing or not configured. Install per the link in Step 2 and restart Docker.
- **CUDA init failure inside the container.** Tag suffix doesn't match the host. Re-check `nvidia-smi` CUDA Version and the table in Step 1.
- **Segmentation fault when launching an example.** `ulimit -s 32768` wasn't applied inside the container. Use the `bash -c "ulimit -s 32768 && ..."` pattern shown in Step 3.
- **Holoviz example hangs / no window over SSH.** YAML wasn't patched to `headless: true`. Use the `sed` injection shown in Step 3.
- **`video_replayer` can't find data.** Set `HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data` — overrides the YAML's hard-coded path.
Tous les fichiers
5 fichiersInstaller holoscan-install-container
Téléchargez et décompressez les fichiers de compétences dans votre répertoire .claude/skills/.
Télécharger le ZIPClonez le dépôt et copiez les fichiers de compétence dans votre projet.
git clone https://github.com/NVIDIA/skills/tree/main/skills/holoscan-install-container # Copy SKILL.md to your .claude/skills/ directory
Copier





Maison
