holoscan-install-wheel
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseHoloscan pip Wheel Installation
Holoscan pip Wheel 安装
Purpose
目的
Install the Holoscan SDK Python bindings via the / pip wheel into a virtual environment, and verify with and .
holoscan-cu12holoscan-cu13hello_worldvideo_replayer通过/ pip wheel将Holoscan SDK Python绑定安装到虚拟环境中,并使用和进行验证。
holoscan-cu12holoscan-cu13hello_worldvideo_replayerPrerequisites
前提条件
- Linux x86_64 with NVIDIA GPU + driver ().
nvidia-smi - CUDA Toolkit on matching the host CUDA major (12 or 13).
PATH - Python 3.10–3.13 with available.
venv - Network access to PyPI and .
docs.nvidia.com
- 搭载NVIDIA GPU及驱动(可通过查看)的Linux x86_64系统。
nvidia-smi - 系统中配置有与主机CUDA主版本(12或13)匹配的CUDA Toolkit。
PATH - 已安装Python 3.10–3.13且支持功能。
venv - 可访问PyPI和的网络环境。
docs.nvidia.com
Limitations
限制说明
- Python only. For C++ headers/libs, pair with .
/holoscan-install-debian - and
holoscan-cu12are mutually exclusive — wheel must match host CUDA driver.holoscan-cu13 - data ships only with the Debian package; without it, set
video_replayerto a directory containingHOLOSCAN_INPUT_PATH.racerx/ - is recommended in every shell that runs Holoscan — without it some apps emit a stack-size warning or, in rarer cases, segfault.
ulimit -s 32768
- 仅支持Python环境。若需C++头文件/库,请搭配使用。
/holoscan-install-debian - 和
holoscan-cu12互斥——安装的wheel版本必须与主机CUDA驱动匹配。holoscan-cu13 - 的数据仅随Debian包提供;若未安装Debian包,请将
video_replayer设置为包含HOLOSCAN_INPUT_PATH目录的路径。racerx/ - 建议在所有运行Holoscan的shell中执行——否则部分应用会发出栈大小警告,极少数情况下可能出现段错误。
ulimit -s 32768
Step 0: Consult the Official Install Instructions
步骤0:查阅官方安装说明
Always fetch the pip-wheel section of before installing. Extract: exact wheel package names (, ), the supported Python range for the current release, prerequisites that must be on (CUDA Toolkit), and any optional extras (LibTorch / ONNX Runtime version pins). If the doc disagrees with anything below, the doc wins.
https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.htmlholoscan-cu12holoscan-cu13PATHYou need the CUDA variant already determined. If not known, run first.
nvidia-smi 2>&1 | head -5CUDA variant rule — pick the pip package:
| nvidia-smi CUDA Version | pip package |
|---|---|
| 13.x+ | |
| 12.x (any GPU) | |
Prerequisites: CUDA Toolkit on PATH, Python 3.10–3.13. Optional extras: LibTorch 2.11.0+, ONNX Runtime 1.22.0+.
Always install into a Python virtual environment — this avoids system-package conflicts and is required on Ubuntu 24.04 (which blocks system-wide pip entirely).
安装前请务必查看中的pip wheel章节。重点提取:准确的wheel包名称(、)、当前版本支持的Python版本范围、必须配置在中的前提条件(CUDA Toolkit)以及可选的额外依赖(LibTorch/ONNX Runtime版本限制)。若本文档与官方说明存在冲突,以官方说明为准。
https://docs.nvidia.com/holoscan/sdk-user-guide/sdk_installation.htmlholoscan-cu12holoscan-cu13PATH您需要先确定CUDA版本变体。若不确定,请先运行查看。
nvidia-smi 2>&1 | head -5CUDA版本变体选择规则——对应pip包:
| nvidia-smi显示的CUDA版本 | pip包名称 |
|---|---|
| 13.x+ | |
| 12.x(任意GPU) | |
前提条件:中已配置CUDA Toolkit,Python版本为3.10–3.13。可选额外依赖:LibTorch 2.11.0+、ONNX Runtime 1.22.0+。
PATH请始终安装到Python虚拟环境中——这可避免系统包冲突,且在Ubuntu 24.04中是必需的(该系统完全禁止全局pip安装)。
Step 1: Create and Activate the venv
步骤1:创建并激活虚拟环境
Check if one exists first:
bash
ls ~/holoscan/venv 2>/dev/null && echo "exists" || echo "missing"If missing:
bash
python3 -m venv ~/holoscan/venvThen activate:
bash
source ~/holoscan/venv/bin/activate先检查虚拟环境是否已存在:
bash
ls ~/holoscan/venv 2>/dev/null && echo "exists" || echo "missing"若不存在:
bash
python3 -m venv ~/holoscan/venv然后激活:
bash
source ~/holoscan/venv/bin/activateStep 2: Install
步骤2:安装Holoscan
bash
pip install holoscan-cu12 # or holoscan-cu13bash
pip install holoscan-cu12 # 或 holoscan-cu13Step 3: Verify
步骤3:验证安装
The venv must be active for all commands below.
bash
undefined以下所有命令均需在虚拟环境激活状态下执行。
bash
undefinedBasic import — expected: version string, e.g. "4.1.0"
基础导入测试——预期输出:版本字符串,例如 "4.1.0"
The stack-size RuntimeWarning is harmless; ulimit -s 32768 suppresses it.
栈大小RuntimeWarning无危害;执行ulimit -s 32768可消除该警告。
python3 -c "import holoscan; print(holoscan.version)"
python3 -c "import holoscan; print(holoscan.version)"
Fetch Python examples from GitHub at the installed version tag.
从GitHub获取与已安装版本标签匹配的Python示例。
These are official NVIDIA examples, fetched over HTTPS and pinned to the tag
这些是NVIDIA官方示例,通过HTTPS获取并固定到与已安装wheel匹配的标签(v${SDK_VER})。
matching the installed wheel (v${SDK_VER}). Before running them, tell the user
运行前请告知用户您即将从此URL下载并执行远程示例脚本。若用户拒绝或无法访问GitHub,可跳至步骤4浏览示例。
you're about to download and execute remote example scripts from this URL. If
—
they decline or GitHub is unreachable, skip to browsing the examples in Step 4.
—
SDK_VER=$(python3 -c "import holoscan; print(holoscan.version)")
BASE="https://raw.githubusercontent.com/nvidia-holoscan/holoscan-sdk/v${SDK_VER}/examples"
SDK_VER=$(python3 -c "import holoscan; print(holoscan.version)")
BASE="https://raw.githubusercontent.com/nvidia-holoscan/holoscan-sdk/v${SDK_VER}/examples"
hello_world — expected: "Hello World!"
hello_world测试——预期输出:"Hello World!"
curl -fsSL "${BASE}/hello_world/python/hello_world.py" -o /tmp/hs_hello_world.py
ulimit -s 32768 && python3 /tmp/hs_hello_world.py
curl -fsSL "${BASE}/hello_world/python/hello_world.py" -o /tmp/hs_hello_world.py
ulimit -s 32768 && python3 /tmp/hs_hello_world.py
video_replayer (10 frames, headless) — expected: "Graph execution finished."
video_replayer测试(10帧,无头模式)——预期输出:"Graph execution finished."
Always run headless: works with or without a display, avoids GUI failure modes over SSH.
始终以无头模式运行:无论有无显示器均可正常工作,避免SSH连接下的GUI故障。
curl -fsSL "${BASE}/video_replayer/python/video_replayer.py" -o /tmp/hs_video_replayer.py
curl -fsSL "${BASE}/video_replayer/python/video_replayer.yaml" -o /tmp/hs_video_replayer.yaml
python3 -c "
c = open('/tmp/hs_video_replayer.yaml').read()
c = c.replace('count: 0','count: 10').replace('repeat: true','repeat: false').replace('realtime: true','realtime: false')
c = c.replace('holoviz:\n width: 854','holoviz:\n headless: true\n width: 854')
open('/tmp/hs_video_replayer_run.yaml','w').write(c)"
ulimit -s 32768 && HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data
python3 /tmp/hs_video_replayer.py --config /tmp/hs_video_replayer_run.yaml
python3 /tmp/hs_video_replayer.py --config /tmp/hs_video_replayer_run.yaml
Note: `video_replayer` needs the racerx data files. These ship with the Debian package at `/opt/nvidia/holoscan/data`. If the Debian package is not installed, run `sudo /opt/nvidia/holoscan/examples/download_example_data` first (requires the apt package to be installed for that script), or set `HOLOSCAN_INPUT_PATH` to wherever the data lives.curl -fsSL "${BASE}/video_replayer/python/video_replayer.py" -o /tmp/hs_video_replayer.py
curl -fsSL "${BASE}/video_replayer/python/video_replayer.yaml" -o /tmp/hs_video_replayer.yaml
python3 -c "
c = open('/tmp/hs_video_replayer.yaml').read()
c = c.replace('count: 0','count: 10').replace('repeat: true','repeat: false').replace('realtime: true','realtime: false')
c = c.replace('holoviz:\n width: 854','holoviz:\n headless: true\n width: 854')
open('/tmp/hs_video_replayer_run.yaml','w').write(c)"
ulimit -s 32768 && HOLOSCAN_INPUT_PATH=/opt/nvidia/holoscan/data
python3 /tmp/hs_video_replayer.py --config /tmp/hs_video_replayer_run.yaml
python3 /tmp/hs_video_replayer.py --config /tmp/hs_video_replayer_run.yaml
注意:`video_replayer`需要racerx数据文件。这些文件随Debian包提供,路径为`/opt/nvidia/holoscan/data`。若未安装Debian包,请先运行`sudo /opt/nvidia/holoscan/examples/download_example_data`(需要已安装apt包才能使用该脚本),或将`HOLOSCAN_INPUT_PATH`设置为数据所在的目录。Step 4: Remind the User
步骤4:提醒用户注意事项
They must activate the venv in each new shell session:
bash
source ~/holoscan/venv/bin/activate
ulimit -s 32768 # suppress stack-size warningThen offer next steps:
- Explore Python examples at
https://github.com/nvidia-holoscan/holoscan-sdk/tree/v<VERSION>/examples - Walk through a specific example:
/explain-example - Start building a custom Holoscan application
用户在每个新的shell会话中都必须激活虚拟环境:
bash
source ~/holoscan/venv/bin/activate
ulimit -s 32768 # 消除栈大小警告然后可提供后续操作建议:
- 浏览Python示例:
https://github.com/nvidia-holoscan/holoscan-sdk/tree/v<VERSION>/examples - 查看具体示例讲解:
/explain-example - 开始构建自定义Holoscan应用
Troubleshooting
故障排查
- errors with "externally-managed-environment". Ubuntu 24.04 blocks system-wide pip. Create and activate the venv from Step 1 first.
pip install holoscan-cu12 - / wrong CUDA at
ImportError. Wheel variant doesn't match host CUDA. Uninstall and reinstall the matching one:import holoscan(or vice versa).pip uninstall -y holoscan-cu13 && pip install holoscan-cu12 - . Harmless, but set
RuntimeWarning: stack size ...in the current shell to silence it.ulimit -s 32768 - Segmentation fault when running an example. wasn't set. Set it before
ulimit -s 32768.python3 ... - can't find
video_replayer.racerx/isn't pointing at a directory containing it. Install the Debian package forHOLOSCAN_INPUT_PATH, or set/opt/nvidia/holoscan/datato wherever the data lives.HOLOSCAN_INPUT_PATH - in a new shell. Venv wasn't created or path differs. Re-run Step 1 or correct the path.
source: no such file: ~/holoscan/venv/bin/activate
- 执行时出现"externally-managed-environment"错误。 Ubuntu 24.04禁止全局pip安装,请先完成步骤1创建并激活虚拟环境。
pip install holoscan-cu12 - 导入Holoscan时出现/CUDA版本不匹配。 Wheel版本与主机CUDA版本不匹配。卸载当前版本并重新安装匹配版本:
ImportError(反之亦然)。pip uninstall -y holoscan-cu13 && pip install holoscan-cu12 - 出现警告。 该警告无危害,但可在当前shell中执行
RuntimeWarning: stack size ...消除。ulimit -s 32768 - 运行示例时出现段错误。 未设置,请在执行
ulimit -s 32768前设置该参数。python3 ... - 无法找到
video_replayer目录。racerx/未指向包含该目录的路径。安装Debian包以获取HOLOSCAN_INPUT_PATH,或修改/opt/nvidia/holoscan/data为数据所在目录。HOLOSCAN_INPUT_PATH - 在新shell中执行错误。 虚拟环境未创建或路径错误,请重新执行步骤1或修正路径。
source: no such file: ~/holoscan/venv/bin/activate