holoscan-install-debian
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHoloscan Debian/apt Installation
Holoscan Debian/apt 安装指南
Purpose
目的
Install the Holoscan SDK C++ runtime + headers on Ubuntu using NVIDIA's apt repo, selecting the right package for the host's CUDA driver and verifying with the bundled C++ examples.
holoscan-cuda-*在Ubuntu上通过NVIDIA的apt仓库安装Holoscan SDK C++运行时及头文件,为主机的CUDA驱动选择合适的包,并通过附带的C++示例进行验证。
holoscan-cuda-*Prerequisites
前提条件
- Ubuntu x86_64 (22.04 / 24.04) or ARM64 (Jetson / IGX) with an NVIDIA GPU and working driver ().
nvidia-smi - and network access to
sudoanddeveloper.download.nvidia.com.docs.nvidia.com - package (Step 2 installs it if missing).
cuda-keyring
- 搭载NVIDIA GPU且驱动正常运行(可通过验证)的Ubuntu x86_64(22.04 / 24.04)或ARM64(Jetson / IGX)系统。
nvidia-smi - 拥有权限,且能访问
sudo和developer.download.nvidia.com网络资源。docs.nvidia.com - 已安装包(若未安装,步骤2会自动安装)。
cuda-keyring
Limitations
限制说明
- No Python bindings from apt — pair with if the user needs Python.
/holoscan-install-wheel - Ubuntu-only. Other distros must use the container or wheel install.
- Package variant must match the host CUDA driver (vs
holoscan-cuda-12); wrong variant → "CUDA driver version is insufficient".holoscan-cuda-13
- apt安装包不包含Python绑定;若用户需要Python支持,请搭配/holoscan-install-wheel使用。
- 仅支持Ubuntu系统。其他发行版需使用容器或wheel安装方式。
- 包版本必须与主机CUDA驱动匹配(vs
holoscan-cuda-12);版本不匹配会导致“CUDA driver version is insufficient”错误。holoscan-cuda-13
Step 0: Consult the Official Install Instructions
步骤0:参考官方安装说明
Fetch the Debian/apt section of before installing. Extract:
https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html- Exact package names (,
holoscan-cuda-12,holoscan-cuda-13)holoscan - Supported Ubuntu versions
- The cuda-keyring URL for the right distro
If the doc disagrees with anything below, the doc wins.
Determine OS version and CUDA variant if not already known — run in parallel:
bash
lsb_release -a 2>/dev/null || cat /etc/os-release
nvidia-smi 2>&1 | head -5CUDA variant rule — pick the apt package:
| nvidia-smi CUDA Version | Package |
|---|---|
| 13.x+ | |
| 12.x (on IGX) | |
| 12.x (not on IGX) | |
| 12.x (nvgpu) | |
安装前,请查看中的Debian/apt章节内容,提取以下信息:
https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.html- 准确的包名(、
holoscan-cuda-12、holoscan-cuda-13)holoscan - 支持的Ubuntu版本
- 对应发行版的cuda-keyring下载链接
若本文内容与官方文档冲突,以官方文档为准。
若尚未知晓系统版本和CUDA适配版本,可并行运行以下命令查询:
bash
lsb_release -a 2>/dev/null || cat /etc/os-release
nvidia-smi 2>&1 | head -5CUDA版本适配规则——选择对应apt包:
| nvidia-smi显示的CUDA版本 | 对应包 |
|---|---|
| 13.x+ | |
| 12.x(IGX平台) | |
| 12.x(非IGX平台) | |
| 12.x(nvgpu环境) | |
Step 1: Prerequisites Check
步骤1:前提条件检查
bash
dpkg -l | grep cuda-keyring
dpkg -l | grep -E "holoscan-cuda-(12|13)|^ii holoscan "
apt-cache show holoscan-cuda-13 holoscan-cuda-12 2>/dev/null | grep -E "^(Package|Version)"Decision rules based on what Step 1 found:
- Skip the keyring step if is already installed.
cuda-keyring - Skip if the repo is already configured and the package is visible in
apt-get update.apt-cache show - Skip Step 2 entirely and proceed directly to Step 3 if the correct package variant is already installed (e.g. when targeting cu12).
holoscan-cuda-12
bash
dpkg -l | grep cuda-keyring
dpkg -l | grep -E "holoscan-cuda-(12|13)|^ii holoscan "
apt-cache show holoscan-cuda-13 holoscan-cuda-12 2>/dev/null | grep -E "^(Package|Version)"根据步骤1的检查结果执行对应操作:
- 若已安装,跳过密钥环安装步骤。
cuda-keyring - 若仓库已配置且能查询到对应包,跳过
apt-cache show步骤。apt-get update - 若已安装正确版本的包(例如目标为cu12时已安装),直接跳过步骤2,进入步骤3。
holoscan-cuda-12
Step 2: Install
步骤2:安装
Skip this step if the package is already installed (detected in Step 1) or if user is on IGX platform.
bash
undefined若步骤1检测到已安装对应包,或用户使用IGX平台,请跳过此步骤。
bash
undefinedIf cuda-keyring missing (adjust ubuntu2204/ubuntu2404 as needed) and not on IGX platform:
若未安装cuda-keyring(根据系统调整ubuntu2204/ubuntu2404)且非IGX平台:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb && sudo apt-get update
sudo apt-get install -y holoscan-cuda-12 # or holoscan-cuda-13
undefinedwget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb && sudo apt-get update
sudo apt-get install -y holoscan-cuda-12 # 或安装holoscan-cuda-13
undefinedStep 3: Verify
步骤3:验证
Set the env once for the rest of this step, then run the three C++ checks:
bash
HS=/opt/nvidia/holoscan
export LD_LIBRARY_PATH=$HS/lib
export HOLOSCAN_INPUT_PATH=$HS/data
ulimit -s 32768
ls $HS/examples/{hello_world,tensor_interop,video_replayer}/先设置环境变量,再执行三项C++验证:
bash
HS=/opt/nvidia/holoscan
export LD_LIBRARY_PATH=$HS/lib
export HOLOSCAN_INPUT_PATH=$HS/data
ulimit -s 32768
ls $HS/examples/{hello_world,tensor_interop,video_replayer}/hello_world — expected: "Hello World!"
hello_world — 预期输出: "Hello World!"
$HS/examples/hello_world/cpp/hello_world
$HS/examples/hello_world/cpp/hello_world
tensor_interop — expected: tensors doubling each pass, "Graph execution finished."
tensor_interop — 预期输出: 张量每次传递后翻倍,最终显示"Graph execution finished."
If "CUDA driver version is insufficient": swap package variant:
若出现"CUDA driver version is insufficient"错误:更换包版本:
sudo apt-get remove -y holoscan-cuda-13 && sudo apt-get install -y holoscan-cuda-12
sudo apt-get remove -y holoscan-cuda-13 && sudo apt-get install -y holoscan-cuda-12
$HS/examples/tensor_interop/cpp/tensor_interop
$HS/examples/tensor_interop/cpp/tensor_interop
video_replayer (10 frames, headless) — expected: Vulkan selects NVIDIA GPU, "Graph execution finished."
video_replayer(无界面模式,播放10帧)— 预期输出: Vulkan选择NVIDIA GPU,最终显示"Graph execution finished."
Always run headless: works with or without a display, avoids GUI failure modes over SSH.
始终使用无界面模式:无论有无显示器均可运行,避免SSH连接下的GUI故障。
ls $HS/data/racerx 2>/dev/null || sudo $HS/examples/download_example_data
python3 -c "
c=open('$HS/examples/video_replayer/cpp/video_replayer.yaml').read()
c=c.replace('count: 0','count: 10').replace('repeat: true','repeat: false').replace('realtime: true','realtime: false')
c=c.replace(' width: 854',' headless: true\n width: 854')
open('/tmp/vr.yaml','w').write(c)"
$HS/examples/video_replayer/cpp/video_replayer --config /tmp/vr.yaml
undefinedls $HS/data/racerx 2>/dev/null || sudo $HS/examples/download_example_data
python3 -c "
c=open('$HS/examples/video_replayer/cpp/video_replayer.yaml').read()
c=c.replace('count: 0','count: 10').replace('repeat: true','repeat: false').replace('realtime: true','realtime: false')
c=c.replace(' width: 854',' headless: true\n width: 854')
open('/tmp/vr.yaml','w').write(c)"
$HS/examples/video_replayer/cpp/video_replayer --config /tmp/vr.yaml
undefinedStep 4: Give the User the Reusable Env Snippet
步骤4:提供可复用的环境变量代码片段
Once verified, share this snippet with user and suggest adding it to their shell startup file (e.g., ) if they want it to persist across sessions:
~/.bashrcbash
export LD_LIBRARY_PATH=/opt/nvidia/holoscan/lib:${LD_LIBRARY_PATH}
export HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data
ulimit -s 32768Then offer next steps:
- Add Python support:
/holoscan-install-wheel - Explore examples:
ls /opt/nvidia/holoscan/examples/ - Walk through a specific example:
/explain-example - Start building a custom Holoscan application
验证通过后,可将以下代码片段分享给用户,建议添加到shell启动文件(如)中,以便在所有会话中生效:
~/.bashrcbash
export LD_LIBRARY_PATH=/opt/nvidia/holoscan/lib:${LD_LIBRARY_PATH}
export HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data
ulimit -s 32768之后可提供后续操作建议:
- 添加Python支持:执行/holoscan-install-wheel
- 探索示例:运行
ls /opt/nvidia/holoscan/examples/ - 查看特定示例讲解:执行/explain-example
- 开始构建自定义Holoscan应用
Troubleshooting
故障排查
- fails after apt install. Expected — the Debian package has been C++ only since v3.0.0. Run
python3 -c "import holoscan"to add Python bindings./holoscan-install-wheel - "CUDA driver version is insufficient" when running an example. Wrong package variant. Re-check CUDA Version and swap variants:
nvidia-smi(or vice versa).sudo apt-get remove -y holoscan-cuda-13 && sudo apt-get install -y holoscan-cuda-12 - .
E: Unable to locate package holoscan-cuda-12not installed or repo not yet pulled. Run the keyring +cuda-keyringblock in Step 2 (adjustapt-get update/ubuntu2204to match the host).ubuntu2404 - Segmentation fault when launching an example. not set in the current shell. Prepend it to the command (Step 3 pattern).
ulimit -s 32768 - .
error while loading shared libraries: libholoscan_core.sois unset. Use the env snippet from Step 4 —LD_LIBRARY_PATH.export LD_LIBRARY_PATH=/opt/nvidia/holoscan/lib - can't find data. Set
video_replayer, or runHOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/datato fetch thesudo /opt/nvidia/holoscan/examples/download_example_datadataset.racerx
- 在apt安装后执行失败。 此为正常现象——自v3.0.0版本起,Debian包仅包含C++组件。如需Python绑定,请执行/holoscan-install-wheel。
python3 -c "import holoscan" - 运行示例时出现"CUDA driver version is insufficient"错误。 包版本不匹配。重新检查显示的CUDA版本,更换对应包:
nvidia-smi(反之亦然)。sudo apt-get remove -y holoscan-cuda-13 && sudo apt-get install -y holoscan-cuda-12 - 出现错误。 未安装cuda-keyring或未拉取仓库资源。执行步骤2中的密钥环安装+
E: Unable to locate package holoscan-cuda-12代码块(根据主机系统调整apt-get update/ubuntu2204)。ubuntu2404 - 启动示例时出现Segmentation fault错误。 当前shell未设置。可在命令前添加该配置(参考步骤3的格式)。
ulimit -s 32768 - 出现错误。 未设置
error while loading shared libraries: libholoscan_core.so。使用步骤4中的环境变量代码片段——执行LD_LIBRARY_PATH。export LD_LIBRARY_PATH=/opt/nvidia/holoscan/lib - 无法找到数据。 设置
video_replayer,或执行HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data下载sudo /opt/nvidia/holoscan/examples/download_example_data数据集。racerx