holoscan-install-source
NVIDIA/skills
소스 코드 내의 Docker 기반 빌드 스크립트를 사용하여 Holoscan SDK를 빌드하고, CMake 기반 애플리케이션을 위한 로컬 설치 디렉터리를 생성합니다.
...모든 것을 확장하십시오Holoscan SDK — 소스 코드로부터 빌드하기
목적
소스 트리에서 Holoscan SDK를 빌드합니다 nvidia-holoscan/holoscan-sdk 소스 트리에서 ./run 스크립트(Docker 컨테이너 내에서 빌드됨)를 사용하여 소스 트리에서 Holoscan SDK를 빌드하고, CMake 의존성으로 사용할 수 있는 로컬 설치 트리를 생성합니다.
필수 조건
- NVIDIA GPU 및 드라이버가 설치된 Linux 호스트 (
nvidia-smi). git, NVIDIA Container Toolkit이 설치된 Docker (docker run --gpus all사용 가능), 그리고docker-buildx-plugin.- 빌드 컨테이너 및 빌드/설치 디렉터리를 위한 약 20 GB의 여유 디스크 공간.
- 처음 빌드 시 10~30분이 소요됩니다.
제한 사항
- 공개된 패키지(Conda / 컨테이너 / apt / wheel)로는 해결할 수 없는 경우(디버그 심볼, 사용자 정의 CMake 옵션 또는 지원되지 않는 구성)에만 권장됩니다.
- 여전히 Docker가 필요합니다.
./run스크립트가 컨테이너 내에서 빌드하므로, 이는 진정한 베어메탈 빌드가 아닙니다. - aarch64로 크로스 컴파일하려면
qemu-user-static호스트에 설치되어 있어야 합니다.
0단계: 공식 설치 지침 참조
항상 다음 문서의 “소스 코드로부터 빌드하기” 섹션을 https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html (및 링크된 GitHub README.md / DEVELOP.md )의 "소스 코드 빌드" 섹션을 반드시 참조하십시오. 요약: 필수 ./run 플래그, 지원되는 브랜치/태그, 해당 릴리스에 명시된 Dockerfile 패치, 그리고 검증을 위해 권장되는 테스트 이름을 확인하십시오. 문서와 아래 내용 간에 상충되는 부분이 있을 경우, 문서의 내용이 우선합니다.
1단계: 필수 조건
git 및 Docker(GPU 패스스루 지원)가 설치되어 있는지 확인하세요:
git --version
docker --version
docker run --rm --gpus all ubuntu:22.04 nvidia-smi
- Docker가 설치되어 있지 않은 경우 → https://docs.docker.com/engine/install/에서 설치 방법을 참조하십시오
- GPU 패스스루가 실패할 경우 → 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 - Docker buildx가 없는 경우:
sudo apt-get install docker-buildx-plugin
2단계: 저장소 복제
필요한 경우 리포지토리를 ~/holoscan/holoscan-sdk로 클론하세요
mkdir -p ~/holoscan/
git clone https://github.com/nvidia-holoscan/holoscan-sdk.git
cd ~/holoscan/holoscan-sdk
특정 릴리스 태그를 빌드하려면(안정성을 위해 권장):
git tag | grep -E '^v[0-9]' | sort -V | tail -5 # list recent tags
git checkout v # e.g. v4.1.0
3단계: 빌드
이 ./run build 스크립트는 컨테이너 생성, CMake 구성, 컴파일 및 설치를 한 번에 처리합니다. 첫 실행 시에는 이 과정이 10~30분이 소요된다는 점을 사용자에게 알려주세요(베이스 이미지 다운로드 및 컴파일 포함).
./run build
일반적인 옵션:
| 플래그 | 용도 |
|---|---|
--type debug |
디버그 빌드 (심볼 포함, 최적화 없음) |
--type RelWithDebInfo |
릴리스 + 디버그 심볼 |
--arch aarch64 |
ARM64용 크로스 컴파일 ( sudo apt install qemu-user-static) |
--gpu igpu |
Jetson/IGX용 iGPU 빌드 필요 |
--dryrun |
실행하지 않고 명령어 미리 보기 |
옵션을 변경한 후 CMake 캐시 오류가 발생하는 경우:
./run clear_cache && ./run build
출력 결과는 다음 폴더에 저장되며, 다음 명령어로 확인할 수 있습니다. ./run get_build_dir 및 ./run get_install_dir
- 빌드 디렉터리:
build-cu- / - 설치 디렉터리:
install-cu.- /
4단계: 테스트 실행
다음 테스트를 실행합니다
- 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
./run test
필요한 6가지 테스트를 한 번에 실행하려면, 단일 따옴표로 묶은 정규식을 사용하십시오( | 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 test --name
./run test --options "-R '' --output-on-failure"
./run test --verbose
중요: 정규식 문자열에 | —가 포함되어 있는 경우 정규식 문자열을 항상 작은따옴표로 묶어야 합니다. 따옴표를 생략하면 bash가 | 를 파이프로 해석하여 다음 오류와 함께 명령이 실패합니다. command not found.
예상 결과: 모든 테스트가 통과됩니다. 실패한 항목이 있으면 이를 기록하고, 진행하기 전에 사용자에게 보고하십시오.
5단계: 애플리케이션을 설치 디렉터리로 지정하기
빌드가 완료되면 애플리케이션은 설치 트리를 CMake 의존성으로 사용할 수 있습니다. 사용자에게 다음 경로를 제공하십시오:
/path/to/holoscan-sdk/install-cu-/
사용자는 Holoscan_ROOT 또는 CMAKE_PREFIX_PATH 이 디렉터리로 설정할 수 있습니다.
문제 해결
| 증상 | 해결 방법 |
|---|---|
bash: 테스트 실행 시 |
정규 표현식에 다음 내용이 포함되어 있는 경우 | — 작은 따옴표로 묶으세요: --options "-R ' |
| 옵션 변경 후 발생하는 CMake 캐시 오류 | ./run clear_cache && ./run build |
| Docker buildx를 찾을 수 없음 | sudo apt-get install docker-buildx-plugin |
| 빌드 컨테이너 내에서 GPU가 인식되지 않음 | NVIDIA Container Toolkit을 확인하고 다시 실행하십시오 sudo nvidia-ctk runtime configure --runtime=docker |
| 크로스 컴파일 실패 (aarch64) | 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` |
모든 파일
5개 파일holoscan-install-source 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/NVIDIA/skills/tree/main/skills/holoscan-install-source # Copy SKILL.md to your .claude/skills/ directory
복사





집
