holoscan-install-source
NVIDIA/skills
Compila el SDK de Holoscan a partir del código fuente utilizando su script de compilación integrado basado en Docker, lo que generará un árbol de instalación local para aplicaciones basadas en CMake.
...Expandir todoSDK de Holoscan — Compilar desde el código fuente
Objetivo
Compilar el SDK de Holoscan a partir del nvidia-holoscan/holoscan-sdk árbol de código fuente utilizando su ./run script (que se compila dentro de un contenedor de Docker), generando un árbol de instalación local que se puede utilizar como dependencia de CMake.
Requisitos previos
- Ordenador host con Linux, GPU NVIDIA y controlador (
nvidia-smi). git, Docker con NVIDIA Container Toolkit (docker run --gpus allfunciona) ydocker-buildx-plugin.- unos 20 GB de espacio libre en disco para el contenedor de compilación y los árboles de compilación/instalación.
- Entre 10 y 30 minutos para una primera compilación limpia.
Limitaciones
- Solo se recomienda cuando los paquetes publicados (Conda / contenedor / apt / wheel) no son adecuados — símbolos de depuración, opciones personalizadas de CMake o configuraciones no compatibles.
- Sigue siendo necesario Docker: las
./runscript se compila dentro de un contenedor; no se trata de una compilación auténtica en hardware desnudo. - La compilación cruzada para aarch64 requiere
qemu-user-staticen el host.
Paso 0: Consulta las instrucciones oficiales de instalación
Consulta siempre la sección «Compilar desde el código fuente» de https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html (y el GitHub vinculado README.md / DEVELOP.md de la etiqueta elegida) antes de compilar. Extracto: ./run para la arquitectura de destino y la versión principal de CUDA, las ramas/etiquetas compatibles, cualquier parche de Dockerfile indicado para la versión y los nombres de las pruebas recomendadas para la verificación. Si la documentación discrepa de cualquier punto de lo que se indica a continuación, prevalecerá la documentación.
Paso 1: Requisitos previos
Comprueba que git y Docker (con paso directo de la GPU) estén disponibles:
git --version
docker --version
docker run --rm --gpus all ubuntu:22.04 nvidia-smi
- Si falta Docker → ayuda para la instalación en https://docs.docker.com/engine/install/
- Si falla el paso a través de la GPU → instala NVIDIA Container Toolkit:
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 - Si falta Docker buildx:
sudo apt-get install docker-buildx-plugin
Paso 2: Clonar el repositorio
Clona el repositorio en ~/holoscan/holoscan-sdk si es necesario
mkdir -p ~/holoscan/
git clone https://github.com/nvidia-holoscan/holoscan-sdk.git
cd ~/holoscan/holoscan-sdk
Para compilar una etiqueta de versión específica (recomendado por motivos de estabilidad):
git tag | grep -E '^v[0-9]' | sort -V | tail -5 # list recent tags
git checkout v # e.g. v4.1.0
Paso 3: Compilar
El ./run build script se encarga de la creación del contenedor, la configuración de CMake, la compilación y la instalación en un solo paso. Avisa al usuario de que esto tarda entre 10 y 30 minutos la primera vez que se ejecuta (descarga la imagen base y compila).
./run build
Opciones habituales:
| Parámetro | Finalidad |
|---|---|
--type debug |
Compilación de depuración (símbolos, sin optimización) |
--type RelWithDebInfo |
Versión final + símbolos de depuración |
--arch aarch64 |
Compilación cruzada para ARM64 (requiere sudo apt install qemu-user-static) |
--gpu igpu |
una compilación con iGPU para Jetson/IGX |
--dryrun |
Previsualizar comandos sin ejecutarlos |
Si se producen errores de caché de CMake tras cambiar las opciones:
./run clear_cache && ./run build
Los resultados se guardan en estas carpetas y se pueden recuperar con ./run get_build_dir y ./run get_install_dir
- Directorio de compilación:
build-cu- / - Directorio de instalación:
install-cu.- /
Paso 4: Ejecutar pruebas
Ejecuta las siguientes pruebas
- EXAMPLE_CPP_HELLO_WORLD_TEST
- EXAMPLE_PYTHON_HELLO_WORLD_TEST
- EXAMPLE_CPP_TENSOR_INTEROP_TEST
- EJEMPLO_PYTHON_TENSOR_INTEROP_PRUEBA
- PRUEBA_DE_REPRODUCTOR_DE_VÍDEO_EN_CPP
- EJEMPLO_PYTHON_PRUEBA_DEL_REPRODUCTOR_DE_VÍDEO
./run test
Para ejecutar las seis pruebas obligatorias a la vez, utiliza una expresión regular entre comillas simples (el | debe ir entre comillas para evitar que bash la interprete como una tubería):
./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"
Ejecuta una prueba específica por nombre o mediante una expresión regular:
./run test --name
./run test --options "-R '' --output-on-failure"
./run test --verbose
Importante: Pon siempre entre comillas simples la cadena de expresión regular cuando contenga | — sin comillas, bash la interpreta | como una tubería y el comando falla con el mensaje command not found.
Resultado esperado: todas las pruebas se superan. Anota cualquier fallo e informa de ellos al usuario antes de continuar.
Paso 5: Dirigir las aplicaciones al árbol de instalación
Una vez compiladas, las aplicaciones pueden utilizar el árbol de instalación como dependencia de CMake. Indica al usuario esta ruta:
/path/to/holoscan-sdk/install-cu-/
Pueden establecer Holoscan_ROOT o CMAKE_PREFIX_PATH a este directorio al compilar sus propias aplicaciones.
Solución de problemas
| Síntoma | Solución |
|---|---|
bash: al ejecutar pruebas |
La expresión regular contiene | — envuélvela entre comillas simples: --options "-R ' |
| Errores en la caché de CMake tras cambiar una opción | ./run clear_cache && ./run build |
| No se encuentra Docker buildx | sudo apt-get install docker-buildx-plugin |
| La GPU no es visible dentro del contenedor de compilación | Comprueba NVIDIA Container Toolkit y vuelve a ejecutarlo sudo nvidia-ctk runtime configure --runtime=docker |
| Fallo en la compilación cruzada (aarch64) | Instala qemu: sudo apt-get install qemu-user-static |
---
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` |
Todos los archivos
5 archivosInstalar holoscan-install-source
Descarga y descomprime los archivos de habilidades en tu directorio .claude/skills/.
Descargar ZIPClona el repositorio y copia los archivos de la habilidad a tu proyecto.
git clone https://github.com/NVIDIA/skills/tree/main/skills/holoscan-install-source # Copy SKILL.md to your .claude/skills/ directory
Copiar





Hogar
