holoscan-cli 3.6.0__py3-none-any.whl → 3.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of holoscan-cli might be problematic. Click here for more details.

@@ -14,6 +14,7 @@
14
14
  # limitations under the License.
15
15
  import json
16
16
  import logging
17
+ import os
17
18
  from typing import Any, Optional
18
19
 
19
20
  import requests
@@ -36,8 +37,9 @@ class ArtifactSources:
36
37
  HoloscanVersion = None
37
38
  ManifestFileUrl = None
38
39
 
39
- def __init__(self) -> None:
40
+ def __init__(self, cuda_version: int) -> None:
40
41
  self._logger = logging.getLogger("common")
42
+ self._cuda_version = cuda_version
41
43
  try:
42
44
  ArtifactSources.HoloscanVersion = ".".join(
43
45
  str(i) for i in Version(__version__).release[0:3]
@@ -48,7 +50,10 @@ class ArtifactSources:
48
50
  "a Holoscan SDK version to use."
49
51
  ) from ex
50
52
 
51
- ArtifactSources.ManifestFileUrl = f"https://raw.githubusercontent.com/nvidia-holoscan/holoscan-cli/refs/heads/main/releases/{ArtifactSources.HoloscanVersion}/artifacts.json" # noqa: E501
53
+ if self._cuda_version == 12:
54
+ ArtifactSources.ManifestFileUrl = f"https://raw.githubusercontent.com/nvidia-holoscan/holoscan-cli/refs/heads/main/releases/{ArtifactSources.HoloscanVersion}/artifacts-cu12.json" # noqa: E501
55
+ else:
56
+ ArtifactSources.ManifestFileUrl = f"https://raw.githubusercontent.com/nvidia-holoscan/holoscan-cli/refs/heads/main/releases/{ArtifactSources.HoloscanVersion}/artifacts.json" # noqa: E501
52
57
 
53
58
  @property
54
59
  def holoscan_versions(self) -> list[str]:
@@ -82,6 +87,12 @@ class ArtifactSources:
82
87
  "Downloading manifest files from non-HTTPS servers is not supported."
83
88
  )
84
89
  else:
90
+ if os.path.isdir(uri):
91
+ if self._cuda_version == 12:
92
+ uri = os.path.join(uri, "artifacts-cu12.json")
93
+ else:
94
+ uri = os.path.join(uri, "artifacts.json")
95
+
85
96
  self._logger.info(f"Using CLI manifest file from {uri}...")
86
97
  with open(uri) as file:
87
98
  temp = json.load(file)
@@ -116,7 +127,7 @@ class ArtifactSources:
116
127
  )
117
128
 
118
129
  def _download_manifest_internal(self, url, headers=None):
119
- self._logger.info("Downloading CLI manifest file...")
130
+ self._logger.info(f"Downloading CLI manifest file from {url}...")
120
131
  manifest = requests.get(url, headers=headers)
121
132
 
122
133
  try:
@@ -69,6 +69,9 @@ class Constants:
69
69
 
70
70
  RESOURCE_SHARED_MEMORY_KEY = "sharedMemory"
71
71
 
72
+ # Include "holoscan" for backward compatibility; remove post 3.7.0 release
73
+ PYPI_PACKAGE_NAMES = ["holoscan-cu12", "holoscan-cu13", "holoscan"]
74
+
72
75
 
73
76
  class SDK:
74
77
  """
@@ -21,6 +21,7 @@ from typing import Optional
21
21
  from packaging.version import Version
22
22
 
23
23
  from .artifact_sources import ArtifactSources
24
+ from .constants import Constants
24
25
  from .enum_types import SdkType
25
26
  from .exceptions import FailedToDetectSDKVersionError, InvalidSdkError
26
27
 
@@ -125,32 +126,37 @@ def detect_holoscan_version(sdk_version: Optional[Version] = None) -> str:
125
126
  if sdk_version is not None:
126
127
  return sdk_version.base_version
127
128
  else:
128
- try:
129
- ver_str = importlib.metadata.version("holoscan").title()
130
- ver = Version(ver_str)
131
- ver_str = ".".join(str(i) for i in ver.release)
132
-
133
- if len(ver.release) == 1 and ver.major == ver.release[0]:
134
- ver_str = ver_str + ".0.0"
135
- elif (
136
- len(ver.release) == 2
137
- and ver.major == ver.release[0]
138
- and ver.minor == ver.release[1]
139
- ):
140
- ver_str = ver_str + ".0"
141
- elif (
142
- len(ver.release) == 4
143
- and ver.major == ver.release[0]
144
- and ver.minor == ver.release[1]
145
- and ver.micro == ver.release[2]
146
- ):
147
- ver_str = f"{ver.release[0]}.{ver.release[1]}.{ver.release[2]}"
148
-
149
- return ver_str
150
- except Exception as ex:
129
+ # Scan for installed packages with prefix "holoscan"
130
+ holoscan_pkgs = [
131
+ dist.metadata["Name"]
132
+ for dist in importlib.metadata.distributions()
133
+ if dist.metadata["Name"].lower() in Constants.PYPI_PACKAGE_NAMES
134
+ ]
135
+ if not holoscan_pkgs:
151
136
  raise FailedToDetectSDKVersionError(
152
- "Failed to detect installed Holoscan PyPI version.", ex
153
- ) from ex
137
+ "No installed Holoscan PyPI package found."
138
+ )
139
+ ver_str = importlib.metadata.version(holoscan_pkgs[0]).title()
140
+ ver = Version(ver_str)
141
+ ver_str = ".".join(str(i) for i in ver.release)
142
+
143
+ if len(ver.release) == 1 and ver.major == ver.release[0]:
144
+ ver_str = ver_str + ".0.0"
145
+ elif (
146
+ len(ver.release) == 2
147
+ and ver.major == ver.release[0]
148
+ and ver.minor == ver.release[1]
149
+ ):
150
+ ver_str = ver_str + ".0"
151
+ elif (
152
+ len(ver.release) == 4
153
+ and ver.major == ver.release[0]
154
+ and ver.minor == ver.release[1]
155
+ and ver.micro == ver.release[2]
156
+ ):
157
+ ver_str = f"{ver.release[0]}.{ver.release[1]}.{ver.release[2]}"
158
+
159
+ return ver_str
154
160
 
155
161
 
156
162
  def detect_monaideploy_version(sdk_version: Optional[Version] = None) -> str:
@@ -54,7 +54,7 @@ class PackagingArguments:
54
54
 
55
55
  self._platforms: list[PlatformParameters]
56
56
  self._build_parameters = PackageBuildParameters()
57
- self._artifact_sources = ArtifactSources()
57
+ self._artifact_sources = ArtifactSources(args.cuda)
58
58
 
59
59
  if args.source is not None:
60
60
  self._artifact_sources.load(args.source)
@@ -27,7 +27,10 @@ from ..common.dockerutils import (
27
27
  create_and_get_builder,
28
28
  docker_export_tarball,
29
29
  )
30
- from ..common.exceptions import WrongApplicationPathError
30
+ from ..common.exceptions import (
31
+ IncompatiblePlatformConfigurationError,
32
+ WrongApplicationPathError,
33
+ )
31
34
  from .parameters import PackageBuildParameters, PlatformBuildResults, PlatformParameters
32
35
 
33
36
 
@@ -203,6 +206,7 @@ Building image for: {platform_parameters.platform.value}
203
206
  Architecture: {platform_parameters.platform_arch.value}
204
207
  Base Image: {platform_parameters.base_image}
205
208
  Build Image: {platform_parameters.build_image if platform_parameters.build_image is not None else "N/A"}
209
+ CUDA Version: {platform_parameters.cuda_version}
206
210
  Cache: {'Disabled' if self._build_parameters.no_cache else 'Enabled'}
207
211
  Configuration: {platform_parameters.platform_config.value}
208
212
  Holoscan SDK Package: {platform_parameters.holoscan_sdk_file if platform_parameters.holoscan_sdk_file is not None else "N/A"}
@@ -354,7 +358,15 @@ Building image for: {platform_parameters.platform.value}
354
358
  """
355
359
  )
356
360
 
357
- jinja_template = jinja_env.get_template("Dockerfile.jinja2")
361
+ if platform_parameters.cuda_version == 12:
362
+ jinja_template = jinja_env.get_template("Dockerfile-cu12.jinja2")
363
+ elif platform_parameters.cuda_version == 13:
364
+ jinja_template = jinja_env.get_template("Dockerfile.jinja2")
365
+ else:
366
+ raise IncompatiblePlatformConfigurationError(
367
+ f"Invalid CUDA version: {platform_parameters.cuda_version}"
368
+ )
369
+
358
370
  return jinja_template.render(
359
371
  {
360
372
  **self._build_parameters.to_jinja,
@@ -59,6 +59,14 @@ def create_package_parser(
59
59
  type=valid_existing_path,
60
60
  help="Holoscan application configuration file (.yaml)",
61
61
  )
62
+ parser.add_argument(
63
+ "--cuda",
64
+ type=int,
65
+ default=13,
66
+ choices=[12, 13],
67
+ help="set the version of the CUDA that is used to build the application. "
68
+ "Valid values: 12, 13. (default: 13)",
69
+ )
62
70
  parser.add_argument(
63
71
  "--docs",
64
72
  "-d",
@@ -36,6 +36,7 @@ class PlatformParameters:
36
36
  platform: Platform,
37
37
  tag: str,
38
38
  version: str,
39
+ cuda_version: int = 13,
39
40
  ) -> None:
40
41
  self._logger = logging.getLogger("platform.parameters")
41
42
  self._platform = SDK.INTERNAL_PLATFORM_MAPPINGS[platform][0]
@@ -67,6 +68,7 @@ class PlatformParameters:
67
68
  self._data["custom_base_image"] = False
68
69
  self._data["custom_holoscan_sdk"] = False
69
70
  self._data["custom_monai_deploy_sdk"] = False
71
+ self._data["cuda_version"] = cuda_version
70
72
  self._data["target_arch"] = "aarch64" if self._arch == Arch.arm64 else "x86_64"
71
73
  self._data["cuda_deb_arch"] = "sbsa" if self._arch == Arch.arm64 else "x86_64"
72
74
  self._data["holoscan_deb_arch"] = (
@@ -128,6 +130,10 @@ class PlatformParameters:
128
130
  def build_image(self, value: str):
129
131
  self._data["build_image"] = value
130
132
 
133
+ @property
134
+ def cuda_version(self) -> int:
135
+ return self._data["cuda_version"]
136
+
131
137
  @property
132
138
  def holoscan_sdk_file(self) -> Optional[Path]:
133
139
  return self._data["holoscan_sdk_file"]
@@ -76,7 +76,9 @@ class Platform:
76
76
 
77
77
  platforms = []
78
78
  for platform in args.platform:
79
- platform_parameters = PlatformParameters(platform, args.tag, version)
79
+ platform_parameters = PlatformParameters(
80
+ platform, args.tag, version, args.cuda
81
+ )
80
82
 
81
83
  (
82
84
  platform_parameters.custom_base_image,
@@ -90,6 +92,7 @@ class Platform:
90
92
  holoscan_sdk_version,
91
93
  application_type,
92
94
  args.build_image,
95
+ platform_parameters.cuda_version,
93
96
  )
94
97
 
95
98
  (
@@ -187,7 +190,10 @@ class Platform:
187
190
  f"""No base image found for the selected configuration:
188
191
  Platform: {platform_parameters.platform}
189
192
  Configuration: {platform_parameters.platform_config}
190
- Version: {sdk_version}"""
193
+ Version: {sdk_version}
194
+ CUDA Version: {platform_parameters.cuda_version}
195
+ Try to use a different CUDA version with '--cuda' option.
196
+ """
191
197
  ) from ex
192
198
 
193
199
  def _find_build_image(
@@ -196,6 +202,7 @@ class Platform:
196
202
  sdk_version: str,
197
203
  application_type: ApplicationType,
198
204
  build_image: Optional[str] = None,
205
+ cuda_version: int = 13,
199
206
  ) -> Optional[str]:
200
207
  """
201
208
  Ensure user provided build image exists or locate the build image to use based on the
@@ -206,6 +213,7 @@ class Platform:
206
213
  sdk_version (str): SDK version
207
214
  application_type (ApplicationType): application type
208
215
  build_image (Optional[str]): user provided build image
216
+ cuda_version (int): CUDA version
209
217
 
210
218
  Returns:
211
219
  (str): build image for building the image based on the given platform and SDK version.
@@ -229,6 +237,8 @@ class Platform:
229
237
  f"\n Platform: {platform_parameters.platform.value}"
230
238
  f"\n Configuration: {platform_parameters.platform_config.value}"
231
239
  f"\n Version: {sdk_version}"
240
+ f"\n CUDA Version: {cuda_version}"
241
+ "\n Try to use a different CUDA version with '--cuda' option."
232
242
  ) from ex
233
243
  else:
234
244
  return None
@@ -0,0 +1,399 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ ARG GPU_TYPE=dgpu
17
+ ARG LIBTORCH_VERSION=2.8.0
18
+ ARG LIBTORCH_VISION_VERSION="0.23.0"
19
+
20
+ {% if application_type == 'CppCMake' %}
21
+ # Build C++ application in the builder stage
22
+ FROM {{ build_image }} AS builder
23
+ ENV DEBIAN_FRONTEND=noninteractive
24
+
25
+ RUN apt-get update && \
26
+ apt-get install -y --no-install-recommends jq
27
+
28
+ WORKDIR /src
29
+ COPY ./app/* /src
30
+
31
+ RUN mkdir -p /install/.cmake/api/v1/query/ && \
32
+ touch /install/.cmake/api/v1/query/codemodel-v2
33
+ RUN cd /src && \
34
+ cmake -S . -DHOLOHUB_DOWNLOAD_DATASETS=OFF {{ cmake_args }} -B /install && \
35
+ cmake --build /install -j && \
36
+ export OUTNAME=$(cat $(find /install/.cmake/api/v1/reply -type f | xargs grep -l "nameOnDisk") | jq -r '.nameOnDisk') && \
37
+ cd /install && \
38
+ if [ "${OUTNAME}" != "{{ command_filename }}" ]; then mv ./${OUTNAME} ./{{ command_filename }}; fi
39
+
40
+ RUN rm /install/CMakeCache.txt /install/Makefile /install/cmake_install.cmake && \
41
+ rm -r /install/CMakeFiles/ /install/.cmake/
42
+ {% endif %}
43
+
44
+
45
+
46
+ FROM {{ base_image }} AS base
47
+
48
+ RUN apt-get update \
49
+ && apt-get install -y --no-install-recommends --no-install-suggests \
50
+ curl \
51
+ jq \
52
+ && rm -rf /var/lib/apt/lists/*
53
+
54
+ {% if 'onnx' in includes %}
55
+ # Collect onnx dependencies
56
+ FROM base AS onnx-dependencies
57
+ ARG GPU_TYPE
58
+ ARG ONNX_RUNTIME_VERSION=1.22.1
59
+
60
+ WORKDIR /opt/onnxruntime
61
+
62
+ # Download onnx binaries
63
+ RUN CUDA_MAJOR_MINOR=12.6 \
64
+ && echo "Downloading from https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/onnxruntime/onnxruntime-${ONNX_RUNTIME_VERSION}-cuda-${CUDA_MAJOR_MINOR}-$(uname -m).tar.gz" \
65
+ && curl -S -L -# -o ort.tgz \
66
+ https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/onnxruntime/onnxruntime-${ONNX_RUNTIME_VERSION}-cuda-${CUDA_MAJOR_MINOR}-$(uname -m).tar.gz
67
+ RUN mkdir -p ${ONNX_RUNTIME_VERSION} \
68
+ && tar -xf ort.tgz -C ${ONNX_RUNTIME_VERSION} --strip-components 2 --no-same-owner --no-same-permissions \
69
+ && rm -f ort.tgz
70
+ WORKDIR /
71
+ # End collect onnx dependencies
72
+ {% endif %}
73
+
74
+ FROM base AS release
75
+ ENV DEBIAN_FRONTEND=noninteractive
76
+ ENV TERM=xterm-256color
77
+
78
+ ARG GPU_TYPE
79
+ ARG UNAME
80
+ ARG UID
81
+ ARG GID
82
+ ARG LIBTORCH_VERSION
83
+ ARG LIBTORCH_VISION_VERSION
84
+
85
+ RUN mkdir -p /etc/holoscan/ \
86
+ && mkdir -p /opt/holoscan/ \
87
+ && mkdir -p {{ working_dir }} \
88
+ && mkdir -p {{ app_dir }} \
89
+ && mkdir -p {{ full_input_path }} \
90
+ && mkdir -p {{ full_output_path }}
91
+
92
+ LABEL base="{{ base_image }}"
93
+ LABEL tag="{{ tag }}"
94
+ LABEL org.opencontainers.image.title="{{ title }}"
95
+ LABEL org.opencontainers.image.version="{{ version }}"
96
+ LABEL org.nvidia.holoscan="{{ holoscan_sdk_version }}"
97
+
98
+ {% if sdk_type == 'monai-deploy' %}
99
+ LABEL org.monai.deploy.app-sdk="{{ monai_deploy_app_sdk_version }}"
100
+ {% endif %}
101
+
102
+ ENV HOLOSCAN_INPUT_PATH={{ full_input_path }}
103
+ ENV HOLOSCAN_OUTPUT_PATH={{ full_output_path }}
104
+ ENV HOLOSCAN_WORKDIR={{ working_dir }}
105
+ ENV HOLOSCAN_APPLICATION={{ app_dir }}
106
+ ENV HOLOSCAN_TIMEOUT={{ timeout }}
107
+ ENV HOLOSCAN_MODEL_PATH={{ models_dir }}
108
+ ENV HOLOSCAN_DOCS_PATH={{ docs_dir }}
109
+ ENV HOLOSCAN_CONFIG_PATH={{ config_file_path }}
110
+ ENV HOLOSCAN_APP_MANIFEST_PATH={{ app_json }}
111
+ ENV HOLOSCAN_PKG_MANIFEST_PATH={{ pkg_json }}
112
+ ENV HOLOSCAN_LOGS_PATH={{ logs_dir }}
113
+ ENV HOLOSCAN_VERSION={{ holoscan_sdk_version }}
114
+
115
+ # Update NV GPG repo key
116
+ # https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
117
+ RUN rm -f /etc/apt/sources.list.d/cuda*.list \
118
+ && curl -OL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/{{ cuda_deb_arch }}/cuda-keyring_1.1-1_all.deb \
119
+ && dpkg -i cuda-keyring_1.1-1_all.deb \
120
+ && rm -f cuda-keyring_1.1-1_all.deb \
121
+ && apt-get update
122
+
123
+ {% if 'debug' in includes %}
124
+ # Install debugging tools
125
+ RUN apt-get update \
126
+ && apt-get install -y --no-install-recommends --no-install-suggests \
127
+ build-essential \
128
+ ccache \
129
+ gdb \
130
+ strace \
131
+ sudo \
132
+ && rm -rf /var/lib/apt/lists/*
133
+ ### End install debugging tools
134
+ {% endif %}
135
+
136
+
137
+ {% if 'holoviz' in includes %}
138
+ # Install Holoviz dependencies
139
+ RUN apt-get update \
140
+ && apt-get install --no-install-recommends --no-install-suggests --allow-downgrades --allow-change-held-packages -y \
141
+ libvulkan1="1.3.275.0-*" \
142
+ # X11 support \
143
+ libgl1="1.7.0-*" \
144
+ # Wayland support \
145
+ libwayland-client0="1.22.0-*" \
146
+ libwayland-egl1="1.22.0-*" \
147
+ libxkbcommon0="1.6.0-*" \
148
+ libdecor-0-plugin-1-cairo="0.2.2-*" \
149
+ libegl1="1.7.0-*" \
150
+ && rm -rf /var/lib/apt/lists/*
151
+ # End install Holoviz dependencies
152
+ {% endif %}
153
+
154
+
155
+ {% if 'torch' in includes %}
156
+ # Install torch dependencies
157
+ ENV PYTHON_VERSION=3.12.3-*
158
+ ENV PYTHON_PIP_VERSION=24.0+dfsg-*
159
+ ENV LIBTORCH=/opt/libtorch
160
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIBTORCH}
161
+
162
+ RUN apt update \
163
+ && apt-get install -y --no-install-recommends --no-install-suggests \
164
+ python3-minimal=${PYTHON_VERSION} \
165
+ libpython3-stdlib=${PYTHON_VERSION} \
166
+ python3=${PYTHON_VERSION} \
167
+ python3-venv=${PYTHON_VERSION} \
168
+ python3-pip=${PYTHON_PIP_VERSION} \
169
+ python3-dev \
170
+ libjpeg-turbo8="2.1.5-*" \
171
+ libnuma1="2.0.18-*" \
172
+ libhwloc15="2.10.0-*" \
173
+ libopenblas0="0.3.26+ds-*" \
174
+ libevent-core-2.1-7 \
175
+ libevent-pthreads-2.1-7 \
176
+ $([ "${GPU_TYPE}" != "igpu" ] && echo "cuda-cupti-$(echo ${CUDA_VERSION} | sed 's/\./-/g' | cut -d- -f1,2)") \
177
+ $([ "${GPU_TYPE}" != "igpu" ] && echo "libcudnn9-cuda-$(echo ${CUDA_VERSION} | cut -d. -f1)") \
178
+ && rm -rf /var/lib/apt/lists/*
179
+
180
+ RUN rm -rf /usr/lib/python3.12/EXTERNALLY-MANAGED \
181
+ && if [ "${GPU_TYPE}" = "igpu" ]; then \
182
+ PYTORCH_WHEEL_VERSION="${LIBTORCH_VERSION}"; \
183
+ INDEX_URL="https://pypi.jetson-ai-lab.io/jp6/cu129"; \
184
+ else \
185
+ PYTORCH_WHEEL_VERSION="${LIBTORCH_VERSION}+cu129"; \
186
+ INDEX_URL="https://download.pytorch.org/whl"; \
187
+ fi; \
188
+ echo "Installing torch==${PYTORCH_WHEEL_VERSION} from $INDEX_URL"; \
189
+ python3 -m pip install --break-system-packages --force-reinstall torch==${PYTORCH_WHEEL_VERSION} torchvision==${LIBTORCH_VISION_VERSION} torchaudio --index-url $INDEX_URL; \
190
+ if ! find /usr/local/lib/python3.12/dist-packages/torch -name libtorch_cuda.so | grep -q .; then \
191
+ echo "libtorch_cuda.so not found, torch installation failed"; \
192
+ exit 1; \
193
+ fi
194
+ # Set up Holoscan SDK container libtorch to be found with ldconfig for app C++ build and runtime
195
+ RUN echo $(python3 -c "import torch; print(torch.__path__[0])")/lib > /etc/ld.so.conf.d/libtorch.conf \
196
+ && ldconfig \
197
+ && ldconfig -p | grep -q "libtorch.so"
198
+ WORKDIR /
199
+ ### End install torch dependencies
200
+ {% endif %}
201
+
202
+
203
+ {% if 'onnx' in includes %}
204
+ # Install onnx dependencies
205
+ ENV ONNX_RUNTIME=/opt/onnxruntime
206
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${ONNX_RUNTIME}
207
+
208
+ # Copy ONNX Runtime
209
+ COPY --from=onnx-dependencies ${ONNX_RUNTIME} ${ONNX_RUNTIME}
210
+
211
+ {% if gpu_type == "dgpu" %}
212
+ RUN apt-get update \
213
+ && apt-get install --no-install-recommends --no-install-suggests --allow-downgrades -y \
214
+ libnvinfer10="10.9.0.34-1+cuda12.8" \
215
+ libnvinfer-plugin10="10.9.0.34-1+cuda12.8" \
216
+ libnvonnxparsers10="10.9.0.34-1+cuda12.8" \
217
+ libcusparselt0="0.7.1.0-*" \
218
+ libcudnn9-cuda-12 \
219
+ && rm -rf /var/lib/apt/lists/* \
220
+ && rm -f /usr/lib/*/libcudnn*train.so*
221
+ {% endif %}
222
+ ### End install onnx dependencies
223
+ {% endif %}
224
+
225
+ {% if health_probe is defined %}
226
+ # Install gRPC health probe
227
+ RUN curl -L -o /bin/grpc_health_probe {{ health_probe | pprint }} \
228
+ && chmod +x /bin/grpc_health_probe && ls -l /bin/grpc_health_probe
229
+
230
+ HEALTHCHECK --interval=10s --timeout=1s \
231
+ CMD /bin/grpc_health_probe -addr=:8765 || exit 1
232
+
233
+ # End install gRPC health probe
234
+ {% endif %}
235
+
236
+ {% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
237
+ {% if not 'torch' in includes %}
238
+ # If torch is installed, we can skip installing Python
239
+ ENV PYTHON_VERSION=3.12.3-*
240
+ ENV PYTHON_PIP_VERSION=24.0+dfsg-*
241
+
242
+ RUN apt update \
243
+ && apt-get install -y --no-install-recommends --no-install-suggests \
244
+ python3-minimal=${PYTHON_VERSION} \
245
+ libpython3-stdlib=${PYTHON_VERSION} \
246
+ python3=${PYTHON_VERSION} \
247
+ python3-venv=${PYTHON_VERSION} \
248
+ python3-pip=${PYTHON_PIP_VERSION} \
249
+ && rm -rf /var/lib/apt/lists/*
250
+ {% endif %}
251
+
252
+ {% if holoscan_deb_arch == "arm64" %}
253
+ # Requires python3-dev on aarch64
254
+ RUN apt update \
255
+ && apt-get install -y --no-install-recommends --no-install-suggests \
256
+ gcc \
257
+ python3-dev \
258
+ && rm -rf /var/lib/apt/lists/*
259
+ {% endif %}
260
+
261
+ {% endif %}
262
+
263
+ {% if application_type == 'CppCMake' or application_type == 'Binary' %}
264
+
265
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nvidia/holoscan/lib
266
+
267
+ RUN if [ "{{ holoscan_deb_arch }}" = "arm64" ]; then \
268
+ GDR_REPO_ARCH=aarch64 ; \
269
+ else \
270
+ GDR_REPO_ARCH=x64 ; \
271
+ fi \
272
+ && curl -O https://developer.download.nvidia.com/compute/redist/gdrcopy/CUDA%2012.8/ubuntu24_04/${GDR_REPO_ARCH}/libgdrapi_2.5.1-1_{{ holoscan_deb_arch }}.Ubuntu24_04.deb \
273
+ && dpkg -i libgdrapi_2.5.1-1_{{ holoscan_deb_arch }}.Ubuntu24_04.deb \
274
+ && rm -f libgdrapi_2.5.1-1_{{ holoscan_deb_arch }}.Ubuntu24_04.deb \
275
+ && rm -rf /var/lib/apt/lists/*
276
+
277
+ {% if custom_holoscan_sdk == True %}
278
+
279
+ # Use user-specified Holoscan SDK Debian Package
280
+ COPY ./{{ holoscan_sdk_filename }} /tmp/{{ holoscan_sdk_filename }}
281
+ RUN apt-get update \
282
+ && apt-get install -y --no-install-recommends --no-install-suggests \
283
+ /tmp/{{ holoscan_sdk_filename }} \
284
+ && rm -rf /var/lib/apt/lists/*
285
+ {% else %}
286
+
287
+ # Install Holoscan SDK from NVIDIA APT repository
288
+ # Holoscan: available versions (https://pypi.org/project/holoscan/#history)
289
+ RUN apt-get install -y --no-install-recommends --no-install-suggests \
290
+ holoscan={{ holoscan_sdk_filename }} \
291
+ # && apt-get remove -y g++ g++-11 gcc gcc-11 gcc-11-base build-essential \
292
+ && apt-get purge -y cuda-keyring \
293
+ && rm -rf /var/lib/apt/lists/*
294
+ {% endif %}
295
+
296
+ {% endif %}
297
+
298
+
299
+ {% if holoscan_deb_arch == "arm64" %}
300
+ # Requires libnuma on aarch64
301
+ RUN apt update \
302
+ && apt-get install -y --no-install-recommends --no-install-suggests \
303
+ libnuma1="2.0.18-*" \
304
+ && rm -rf /var/lib/apt/lists/*
305
+ {% endif %}
306
+
307
+ RUN if id "ubuntu" >/dev/null 2>&1; then touch /var/mail/ubuntu && chown ubuntu /var/mail/ubuntu && userdel -r ubuntu; fi
308
+ RUN groupadd -f -g $GID $UNAME
309
+ RUN useradd -rm -d /home/$UNAME -s /bin/bash -g $GID -G sudo -u $UID $UNAME
310
+ RUN chown -R holoscan {{ working_dir }} && \
311
+ chown -R holoscan {{ full_input_path }} && \
312
+ chown -R holoscan {{ full_output_path }}
313
+
314
+ # Set the working directory
315
+ WORKDIR {{ working_dir }}
316
+
317
+ # Copy HAP/MAP tool script
318
+ COPY ./tools {{ working_dir }}/tools
319
+ RUN chmod +x {{ working_dir }}/tools
320
+
321
+ # Remove EXTERNALLY-MANAGED directory
322
+ RUN rm -rf /usr/lib/python3.12/EXTERNALLY-MANAGED
323
+
324
+ # Set the working directory
325
+ WORKDIR {{ working_dir }}
326
+
327
+ USER $UNAME
328
+
329
+ ENV PATH=/home/${UNAME}/.local/bin:/opt/nvidia/holoscan/bin:$PATH
330
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/${UNAME}/.local/lib/python3.12/site-packages/holoscan/lib
331
+
332
+ {% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
333
+ COPY ./pip/requirements.txt /tmp/requirements.txt
334
+
335
+ RUN pip install --upgrade pip
336
+ RUN pip install --no-cache-dir --user -r /tmp/requirements.txt
337
+
338
+ {% if sdk_type == 'holoscan' %}
339
+ # Install Holoscan SDK
340
+
341
+ {% if custom_holoscan_sdk == True %}
342
+ # Copy user-specified Holoscan SDK wheel file
343
+ COPY ./{{ holoscan_sdk_filename }} /tmp/{{ holoscan_sdk_filename }}
344
+ RUN pip install /tmp/{{ holoscan_sdk_filename }}
345
+
346
+ {% else %}
347
+ # Install Holoscan SDK wheel from PyPI
348
+ RUN pip install holoscan-cu12=={{holoscan_sdk_filename}}
349
+ {% endif %}
350
+ {% else %}
351
+
352
+ # Install MONAI Deploy App SDK
353
+ {% if custom_monai_deploy_sdk == True %}
354
+ # Copy user-specified MONAI Deploy SDK file
355
+ COPY ./{{ monai_deploy_sdk_filename }} /tmp/{{ monai_deploy_sdk_filename }}
356
+ RUN pip install /tmp/{{ monai_deploy_sdk_filename }}
357
+ {% else %}
358
+
359
+ # Install MONAI Deploy from PyPI org
360
+ RUN pip install monai-deploy-app-sdk=={{ monai_deploy_app_sdk_version }}
361
+
362
+ {% endif %}
363
+ {% endif %}
364
+ {% endif %}
365
+
366
+ {% if models is defined %}
367
+ COPY ./models {{ models_dir }}
368
+ {% endif %}
369
+
370
+ {% if docs is defined %}
371
+ COPY ./docs {{ docs_dir }}
372
+ {% endif %}
373
+
374
+ COPY ./map/app.json {{ app_json }}
375
+ COPY ./app.config {{ config_file_path }}
376
+ COPY ./map/pkg.json {{ pkg_json }}
377
+
378
+ {% if application_type == 'CppCMake' %}
379
+ COPY --from=builder /install {{ app_dir }}
380
+ {% else %}
381
+ COPY ./app {{ app_dir }}
382
+ {% endif %}
383
+
384
+ {% if additional_lib_paths != '' %}
385
+
386
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{{ additional_lib_paths }}:{{ lib_dir }}
387
+ COPY ./lib {{ lib_dir }}
388
+
389
+ {% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
390
+ ENV PYTHONPATH=$PYTHONPATH:{{ additional_lib_paths }}:{{ lib_dir }}
391
+ {% endif %}
392
+
393
+ {% endif %}
394
+
395
+ {% if input_data != None %}
396
+ COPY ./input $HOLOSCAN_INPUT_PATH
397
+ {% endif %}
398
+
399
+ ENTRYPOINT ["/var/holoscan/tools"]
@@ -1,21 +1,22 @@
1
- {#
2
- SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3
- SPDX-License-Identifier: Apache-2.0
4
-
5
- Licensed under the Apache License, Version 2.0 (the "License");
6
- you may not use this file except in compliance with the License.
7
- You may obtain a copy of the License at
8
-
9
- http://www.apache.org/licenses/LICENSE-2.0
10
-
11
- Unless required by applicable law or agreed to in writing, software
12
- distributed under the License is distributed on an "AS IS" BASIS,
13
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- See the License for the specific language governing permissions and
15
- limitations under the License.
16
- #}
1
+ # SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
17
15
 
18
16
  ARG GPU_TYPE=dgpu
17
+ ARG LIBTORCH_VERSION_ARM64="2.9.0.dev20250828+cu130"
18
+ ARG LIBTORCH_VERSION_AMD64="2.9.0.dev20250829+cu130"
19
+ ARG LIBTORCH_VISION_VERSION="0.24.0.dev20250829"
19
20
 
20
21
  {% if application_type == 'CppCMake' %}
21
22
  # Build C++ application in the builder stage
@@ -51,95 +52,26 @@ RUN apt-get update \
51
52
  jq \
52
53
  && rm -rf /var/lib/apt/lists/*
53
54
 
54
- {% if 'torch' in includes %}
55
- # Collect torch dependencies: libtorch, torchvision
56
- FROM base AS torch-dependencies
57
-
58
- ARG GPU_TYPE
59
- ARG TORCHVISION_VERSION=0.20.0_24.08
60
- ARG LIBTORCH_VERSION=2.5.0_24.08
61
-
62
- # Install openmpi
63
- RUN apt update && \
64
- apt-get install -y --no-install-recommends --no-install-suggests \
65
- bzip2 \
66
- libopenmpi3t64=4.1.6-* \
67
- && rm -rf /var/lib/apt/lists/*
68
-
69
- # Download libtorch
70
- WORKDIR /opt/libtorch/
71
- RUN ARCH={{ target_arch }} && if [ "$ARCH" = "aarch64" ]; then ARCH="aarch64-${GPU_TYPE}"; fi && \
72
- curl -S -# -o libtorch.tgz -L \
73
- https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/libtorch/libtorch-${LIBTORCH_VERSION}-${ARCH}.tar.gz
74
- RUN mkdir -p ${LIBTORCH_VERSION} && \
75
- tar -xf libtorch.tgz -C ${LIBTORCH_VERSION} --strip-components 1 && \
76
- rm -f libtorch.tgz && \
77
- find . -type f -name "*Config.cmake" -exec sed -i '/kineto/d' {} +
78
-
79
- # Download torchvision
80
- WORKDIR /opt/torchvision/
81
- RUN ARCH={{ target_arch }} && if [ "$ARCH" = "aarch64" ]; then ARCH="aarch64-${GPU_TYPE}"; fi && \
82
- curl -S -# -o torchvision.tgz -L \
83
- https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/torchvision/torchvision-${TORCHVISION_VERSION}-${ARCH}.tar.gz
84
- RUN mkdir -p ${TORCHVISION_VERSION}
85
- RUN tar -xf torchvision.tgz -C ${TORCHVISION_VERSION} --strip-components 1 && \
86
- rm -f torchvision.tgz
87
-
88
- # Download HPCX for libucc.so.1
89
- WORKDIR /opt/hpcx
90
- RUN curl -S -# -o hpcx.tbz -L \
91
- https://www.mellanox.com/downloads/hpc/hpc-x/v2.15/hpcx-v2.15-gcc-inbox-ubuntu22.04-cuda12-gdrcopy2-nccl2.17-{{target_arch}}.tbz && \
92
- tar -xvjf hpcx.tbz hpcx-v2.15-gcc-inbox-ubuntu22.04-cuda12-gdrcopy2-nccl2.17-{{target_arch}}/ucc/lib/libucc.so.1.0.0 && \
93
- rm -f hpcx.tbz && \
94
- find . -name libucc.so.1.0.0 -exec mv -f {} /opt/hpcx/libucc.so.1 \;
95
-
96
- # End collect torch dependencies
97
- {% endif %}
98
-
99
-
100
55
  {% if 'onnx' in includes %}
101
56
  # Collect onnx dependencies
102
57
  FROM base AS onnx-dependencies
103
58
  ARG GPU_TYPE
104
- ARG ONNX_RUNTIME_VERSION=1.18.1_38712740_24.08-cuda-12.6
59
+ ARG ONNX_RUNTIME_VERSION=1.22.1
105
60
 
106
61
  WORKDIR /opt/onnxruntime
107
62
 
108
63
  # Download onnx binaries
109
- RUN curl -S -L -# -o ort.tar.gz \
110
- https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/onnxruntime/onnxruntime-${ONNX_RUNTIME_VERSION}-$(uname -m).tar.gz
111
- RUN mkdir -p ${ONNX_RUNTIME_VERSION}
112
- RUN ls -l && tar -xvzf ort.tar.gz -C ${ONNX_RUNTIME_VERSION} --strip-components 2 && \
113
- rm -f ort.tar.gz
64
+ RUN CUDA_MAJOR_MINOR=$(echo ${CUDA_VERSION} | cut -d. -f1-2) \
65
+ && echo "Downloading from https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/onnxruntime/onnxruntime-${ONNX_RUNTIME_VERSION}-cuda-${CUDA_MAJOR_MINOR}-$(uname -m).tar.gz" \
66
+ && curl -S -L -# -o ort.tgz \
67
+ https://edge.urm.nvidia.com/artifactory/sw-holoscan-thirdparty-generic-local/onnxruntime/onnxruntime-${ONNX_RUNTIME_VERSION}-cuda-${CUDA_MAJOR_MINOR}-$(uname -m).tar.gz
68
+ RUN mkdir -p ${ONNX_RUNTIME_VERSION} \
69
+ && tar -xf ort.tgz -C ${ONNX_RUNTIME_VERSION} --strip-components 2 --no-same-owner --no-same-permissions \
70
+ && rm -f ort.tgz
114
71
  WORKDIR /
115
72
  # End collect onnx dependencies
116
73
  {% endif %}
117
74
 
118
- # FROM base AS mofed-installer
119
- # ARG MOFED_VERSION=23.10-2.1.3.1
120
-
121
- # # In a container, we only need to install the user space libraries, though the drivers are still
122
- # # needed on the host.
123
- # # Note: MOFED's installation is not easily portable, so we can't copy the output of this stage
124
- # # to our final stage, but must inherit from it. For that reason, we keep track of the build/install
125
- # # only dependencies in the `MOFED_DEPS` variable (parsing the output of `--check-deps-only`) to
126
- # # remove them in that same layer, to ensure they are not propagated in the final image.
127
- # WORKDIR /opt/nvidia/mofed
128
- # ARG MOFED_INSTALL_FLAGS="--dpdk --with-mft --user-space-only --force --without-fw-update"
129
- # RUN UBUNTU_VERSION=$(cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d= -f2) \
130
- # && OFED_PACKAGE="MLNX_OFED_LINUX-${MOFED_VERSION}-ubuntu${UBUNTU_VERSION}-$(uname -m)" \
131
- # && curl -S -# -o ${OFED_PACKAGE}.tgz -L \
132
- # https://www.mellanox.com/downloads/ofed/MLNX_OFED-${MOFED_VERSION}/${OFED_PACKAGE}.tgz \
133
- # && tar xf ${OFED_PACKAGE}.tgz \
134
- # && MOFED_INSTALLER=$(find . -name mlnxofedinstall -type f -executable -print) \
135
- # && MOFED_DEPS=$(${MOFED_INSTALLER} ${MOFED_INSTALL_FLAGS} --check-deps-only 2>/dev/null | tail -n1 | cut -d' ' -f3-) \
136
- # && apt-get update \
137
- # && apt-get install --no-install-recommends -y ${MOFED_DEPS} \
138
- # && ${MOFED_INSTALLER} ${MOFED_INSTALL_FLAGS} \
139
- # && rm -r * \
140
- # && apt-get remove -y ${MOFED_DEPS} && apt-get autoremove -y \
141
- # && rm -rf /var/lib/apt/lists/*
142
-
143
75
  FROM base AS release
144
76
  ENV DEBIAN_FRONTEND=noninteractive
145
77
  ENV TERM=xterm-256color
@@ -148,6 +80,9 @@ ARG GPU_TYPE
148
80
  ARG UNAME
149
81
  ARG UID
150
82
  ARG GID
83
+ ARG LIBTORCH_VERSION_ARM64
84
+ ARG LIBTORCH_VERSION_AMD64
85
+ ARG LIBTORCH_VISION_VERSION
151
86
 
152
87
  RUN mkdir -p /etc/holoscan/ \
153
88
  && mkdir -p /opt/holoscan/ \
@@ -179,6 +114,14 @@ ENV HOLOSCAN_PKG_MANIFEST_PATH={{ pkg_json }}
179
114
  ENV HOLOSCAN_LOGS_PATH={{ logs_dir }}
180
115
  ENV HOLOSCAN_VERSION={{ holoscan_sdk_version }}
181
116
 
117
+ # Update NV GPG repo key
118
+ # https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
119
+ RUN rm -f /etc/apt/sources.list.d/cuda*.list \
120
+ && curl -OL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/{{ cuda_deb_arch }}/cuda-keyring_1.1-1_all.deb \
121
+ && dpkg -i cuda-keyring_1.1-1_all.deb \
122
+ && rm -f cuda-keyring_1.1-1_all.deb \
123
+ && apt-get update
124
+
182
125
  {% if 'debug' in includes %}
183
126
  # Install debugging tools
184
127
  RUN apt-get update \
@@ -197,15 +140,15 @@ RUN apt-get update \
197
140
  # Install Holoviz dependencies
198
141
  RUN apt-get update \
199
142
  && apt-get install --no-install-recommends --no-install-suggests --allow-downgrades --allow-change-held-packages -y \
200
- libvulkan1="1.3.275.0-*" \
201
- # X11 support \
202
- libgl1="1.7.0-*" \
203
- # Wayland support \
204
- libwayland-client0="1.22.0-*" \
205
- libwayland-egl1="1.22.0-*" \
206
- libxkbcommon0="1.6.0-*" \
207
- libdecor-0-plugin-1-cairo="0.2.2-*" \
208
- libegl1="1.7.0-*" \
143
+ libvulkan1="1.3.275.0-*" \
144
+ # X11 support \
145
+ libgl1="1.7.0-*" \
146
+ # Wayland support \
147
+ libwayland-client0="1.22.0-*" \
148
+ libwayland-egl1="1.22.0-*" \
149
+ libxkbcommon0="1.6.0-*" \
150
+ libdecor-0-plugin-1-cairo="0.2.2-*" \
151
+ libegl1="1.7.0-*" \
209
152
  && rm -rf /var/lib/apt/lists/*
210
153
  # End install Holoviz dependencies
211
154
  {% endif %}
@@ -215,66 +158,50 @@ RUN apt-get update \
215
158
  # Install torch dependencies
216
159
  ENV PYTHON_VERSION=3.12.3-*
217
160
  ENV PYTHON_PIP_VERSION=24.0+dfsg-*
161
+ ENV LIBTORCH=/opt/libtorch
162
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIBTORCH}
218
163
 
219
164
  RUN apt update \
220
- && apt-get install -y --no-install-recommends --no-install-suggests \
165
+ && apt-get install -y --no-install-recommends --no-install-suggests \
221
166
  python3-minimal=${PYTHON_VERSION} \
222
167
  libpython3-stdlib=${PYTHON_VERSION} \
223
168
  python3=${PYTHON_VERSION} \
224
169
  python3-venv=${PYTHON_VERSION} \
225
170
  python3-pip=${PYTHON_PIP_VERSION} \
171
+ python3-dev \
226
172
  libjpeg-turbo8="2.1.5-*" \
227
173
  libnuma1="2.0.18-*" \
228
174
  libhwloc15="2.10.0-*" \
229
175
  libopenblas0="0.3.26+ds-*" \
230
176
  libevent-core-2.1-7 \
231
177
  libevent-pthreads-2.1-7 \
232
- cuda-cupti-12-8 \
233
- libcudnn9-cuda-12 \
234
- && rm -rf /var/lib/apt/lists/*
235
-
236
- # Install NVIDIA Performance Libraries on arm64 dGPU platform
237
- # as a runtime requirement for the Holoinfer `libtorch` backend (2.5.0).
238
- {% if target_arch == "aarch64" and gpu_type == "dgpu" %}
239
- RUN curl -L https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/sbsa/cuda-keyring_1.1-1_all.deb -O \
240
- && dpkg -i cuda-keyring_1.1-1_all.deb \
241
- && apt-get update \
242
- && apt-get install --no-install-recommends -y \
243
- nvpl-blas=0.2.0.1-* \
244
- nvpl-lapack=0.2.2.1-* \
178
+ cuda-cupti-$(echo ${CUDA_VERSION} | sed 's/\./-/g' | cut -d- -f1,2) \
179
+ libcudnn9-cuda-$(echo ${CUDA_VERSION} | cut -d. -f1) \
245
180
  && rm -rf /var/lib/apt/lists/*
246
- ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/sbsa-linux-gnu/
247
- {% endif %}
248
-
249
- # mkl - dependency for libtorch plugin on x86_64 (match pytorch container version)
250
- RUN if [ "{{ cuda_deb_arch }}" = "x86_64" ]; then \
251
- rm -rf /usr/lib/python3.12/EXTERNALLY-MANAGED \
252
- && python3 -m pip install --no-cache-dir \
253
- mkl==2021.1.1 \
254
- && \
255
- # Clean up duplicate libraries from mkl/tbb python wheel install which makes copies for symlinks.
256
- # Only keep the *.so.X libs, remove the *.so and *.so.X.Y libs
257
- # This can be removed once upgrading to an MKL pip wheel that fixes the symlinks
258
- find /usr/local/lib -maxdepth 1 -type f -regex '.*\/lib\(tbb\|mkl\).*\.so\(\.[0-9]+\.[0-9]+\)?' -exec rm -v {} +; \
181
+ RUN rm -rf /usr/lib/python3.12/EXTERNALLY-MANAGED \
182
+ && if [ "${GPU_TYPE}" = "igpu" ]; then \
183
+ echo "Torch installation is not supported for iGPU."; \
184
+ exit 1; \
185
+ else \
186
+ INDEX_URL="https://download.pytorch.org/whl/nightly/cu130"; \
187
+ if [ "${GPU_TYPE}" = "dgpu" ]; then \
188
+ if [ $(uname -m) = "aarch64" ]; then \
189
+ LIBTORCH_VERSION="${LIBTORCH_VERSION_ARM64}"; \
190
+ else \
191
+ LIBTORCH_VERSION="${LIBTORCH_VERSION_AMD64}"; \
192
+ fi; \
193
+ fi; \
194
+ fi; \
195
+ echo "Installing torch==${LIBTORCH_VERSION} from $INDEX_URL"; \
196
+ python3 -m pip install --break-system-packages --force-reinstall torch==${LIBTORCH_VERSION} torchvision==${LIBTORCH_VISION_VERSION} torchaudio --index-url $INDEX_URL; \
197
+ if ! find /usr/local/lib/python3.12/dist-packages/torch -name libtorch_cuda.so | grep -q .; then \
198
+ echo "libtorch_cuda.so not found, torch installation failed"; \
199
+ exit 1; \
259
200
  fi
260
-
261
- # Copy Libtorch
262
- ARG LIBTORCH_VERSION=2.5.0_24.08
263
- ENV LIBTORCH=/opt/libtorch/${LIBTORCH_VERSION}/lib
264
- COPY --from=torch-dependencies ${LIBTORCH} ${LIBTORCH}
265
-
266
- # Copy TorchVision
267
- ARG TORCHVISION_VERSION=0.20.0_24.08
268
- ENV TORCHVISION=/opt/torchvision/${TORCHVISION_VERSION}/lib
269
- COPY --from=torch-dependencies ${TORCHVISION} ${TORCHVISION}
270
-
271
- ENV HPCX=/opt/hpcx/lib
272
- COPY --from=torch-dependencies /opt/hpcx/libucc.so.1 ${LIBTORCH}/libucc.so.1
273
- COPY --from=torch-dependencies /usr/lib/{{target_arch}}-linux-gnu/libmpi.so.40 ${LIBTORCH}/libmpi.so.40
274
- COPY --from=torch-dependencies /usr/lib/{{target_arch}}-linux-gnu/libopen-rte.so.40 ${LIBTORCH}/libopen-rte.so.40
275
- COPY --from=torch-dependencies /usr/lib/{{target_arch}}-linux-gnu/libopen-pal.so.40 ${LIBTORCH}/libopen-pal.so.40
276
-
277
- ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${LIBTORCH}:${TORCHVISION}:${HPCX}
201
+ # Set up Holoscan SDK container libtorch to be found with ldconfig for app C++ build and runtime
202
+ RUN echo $(python3 -c "import torch; print(torch.__path__[0])")/lib > /etc/ld.so.conf.d/libtorch.conf \
203
+ && ldconfig \
204
+ && ldconfig -p | grep -q "libtorch.so"
278
205
  WORKDIR /
279
206
  ### End install torch dependencies
280
207
  {% endif %}
@@ -282,27 +209,31 @@ WORKDIR /
282
209
 
283
210
  {% if 'onnx' in includes %}
284
211
  # Install onnx dependencies
285
- ARG ONNX_RUNTIME_VERSION=1.18.1_38712740_24.08-cuda-12.6
286
- ENV ONNX_RUNTIME=/opt/onnxruntime/${ONNX_RUNTIME_VERSION}/lib
212
+ ENV ONNX_RUNTIME=/opt/onnxruntime
287
213
  ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${ONNX_RUNTIME}
288
214
 
289
215
  # Copy ONNX Runtime
290
216
  COPY --from=onnx-dependencies ${ONNX_RUNTIME} ${ONNX_RUNTIME}
291
217
 
218
+
219
+ # CLARAHOLOS-1689 requires libnvinfer_plugin
292
220
  {% if gpu_type == "dgpu" %}
221
+
293
222
  RUN apt-get update \
223
+ && CUDA_MAJOR_VERSION=$(echo ${CUDA_VERSION} | cut -d. -f1) \
224
+ && TRT_VERSION_VAR_NAME="TENSORRT_CU${CUDA_MAJOR_VERSION}" \
225
+ && TRT_VERSION=$(apt-cache madison libnvinfer10 | grep "+cuda${CUDA_MAJOR_VERSION}" | head -n 1 | awk '{print $3}') \
294
226
  && apt-get install --no-install-recommends --no-install-suggests --allow-downgrades -y \
295
- libnvinfer10="10.9.0.34-1+cuda12.8" \
296
- libnvinfer-plugin10="10.9.0.34-1+cuda12.8" \
297
- libnvonnxparsers10="10.9.0.34-1+cuda12.8" \
298
- libcusparselt0="0.7.1.0-*" \
299
- libcudnn9-cuda-12 \
300
- && rm -rf /var/lib/apt/lists/* \
301
- && rm -f /usr/lib/*/libcudnn*train.so*
227
+ libnvinfer10="${TRT_VERSION}" \
228
+ libnvinfer-plugin10="${TRT_VERSION}" \
229
+ libnvonnxparsers10="${TRT_VERSION}" \
230
+ libcusparselt0 \
231
+ libcudnn9-cuda-${CUDA_MAJOR_VERSION} \
232
+ && rm -f /usr/lib/*/libcudnn*train.so* \
233
+ && rm -rf /var/lib/apt/lists/*
302
234
  {% endif %}
303
235
  ### End install onnx dependencies
304
236
  {% endif %}
305
-
306
237
  {% if health_probe is defined %}
307
238
  # Install gRPC health probe
308
239
  RUN curl -L -o /bin/grpc_health_probe {{ health_probe | pprint }} \
@@ -345,30 +276,24 @@ RUN apt update \
345
276
 
346
277
  ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/nvidia/holoscan/lib
347
278
 
348
- # Update NV GPG repo key
349
- # https://developer.nvidia.com/blog/updating-the-cuda-linux-gpg-repository-key/
350
- RUN curl -OL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/{{ cuda_deb_arch }}/cuda-keyring_1.1-1_all.deb \
351
- && dpkg -i cuda-keyring_1.1-1_all.deb \
352
- && rm -f cuda-keyring_1.1-1_all.deb \
353
- && apt-get update
354
-
355
279
  RUN if [ "{{ holoscan_deb_arch }}" = "arm64" ]; then \
356
280
  GDR_REPO_ARCH=aarch64 ; \
357
281
  else \
358
282
  GDR_REPO_ARCH=x64 ; \
359
283
  fi \
360
- && curl -O https://developer.download.nvidia.com/compute/redist/gdrcopy/CUDA%2012.2/ubuntu22_04/${GDR_REPO_ARCH}/libgdrapi_2.4-1_{{ holoscan_deb_arch }}.Ubuntu22_04.deb \
361
- && dpkg -i libgdrapi_2.4-1_{{ holoscan_deb_arch }}.Ubuntu22_04.deb \
362
- && rm -f libgdrapi_2.4-1_{{ holoscan_deb_arch }}.Ubuntu22_04.deb
284
+ && curl -O https://developer.download.nvidia.com/compute/redist/gdrcopy/CUDA%2013.0/ubuntu24_04/${GDR_REPO_ARCH}/libgdrapi_2.5.1-1_{{ holoscan_deb_arch }}.Ubuntu24_04.deb \
285
+ && dpkg -i libgdrapi_2.5.1-1_{{ holoscan_deb_arch }}.Ubuntu24_04.deb \
286
+ && rm -f libgdrapi_2.5.1-1_{{ holoscan_deb_arch }}.Ubuntu24_04.deb \
287
+ && rm -rf /var/lib/apt/lists/*
363
288
 
364
289
  {% if custom_holoscan_sdk == True %}
365
290
 
366
291
  # Use user-specified Holoscan SDK Debian Package
367
292
  COPY ./{{ holoscan_sdk_filename }} /tmp/{{ holoscan_sdk_filename }}
368
- RUN apt-get install -y --no-install-recommends --no-install-suggests \
293
+ RUN apt-get update \
294
+ && apt-get install -y --no-install-recommends --no-install-suggests \
369
295
  /tmp/{{ holoscan_sdk_filename }} \
370
296
  && rm -rf /var/lib/apt/lists/*
371
-
372
297
  {% else %}
373
298
 
374
299
  # Install Holoscan SDK from NVIDIA APT repository
@@ -378,7 +303,6 @@ RUN apt-get install -y --no-install-recommends --no-install-suggests \
378
303
  # && apt-get remove -y g++ g++-11 gcc gcc-11 gcc-11-base build-essential \
379
304
  && apt-get purge -y cuda-keyring \
380
305
  && rm -rf /var/lib/apt/lists/*
381
-
382
306
  {% endif %}
383
307
 
384
308
  {% endif %}
@@ -415,7 +339,7 @@ WORKDIR {{ working_dir }}
415
339
  USER $UNAME
416
340
 
417
341
  ENV PATH=/home/${UNAME}/.local/bin:/opt/nvidia/holoscan/bin:$PATH
418
- ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/${UNAME}/.local/lib/python3.10/site-packages/holoscan/lib
342
+ ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/${UNAME}/.local/lib/python3.12/site-packages/holoscan/lib
419
343
 
420
344
  {% if application_type == 'PythonModule' or application_type == 'PythonFile' %}
421
345
  COPY ./pip/requirements.txt /tmp/requirements.txt
@@ -433,7 +357,7 @@ RUN pip install /tmp/{{ holoscan_sdk_filename }}
433
357
 
434
358
  {% else %}
435
359
  # Install Holoscan SDK wheel from PyPI
436
- RUN pip install holoscan=={{holoscan_sdk_filename}}
360
+ RUN pip install holoscan-cu13=={{holoscan_sdk_filename}}
437
361
  {% endif %}
438
362
  {% else %}
439
363
 
@@ -1,8 +1,9 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: holoscan-cli
3
- Version: 3.6.0
3
+ Version: 3.7.0
4
4
  Summary: Command line interface for packaging and running Holoscan applications.
5
5
  License: Apache-2.0
6
+ License-File: LICENSE
6
7
  Keywords: AI,holoscan,medical,streaming,HPC,nvidia,docker,container
7
8
  Author: NVIDIA
8
9
  Maintainer: mocsharp
@@ -58,10 +59,10 @@ You will need a platform supported by [NVIDIA Holoscan SDK](https://docs.nvidia.
58
59
 
59
60
  Holoscan CLI is delivered as a Python package and can be installed from PyPI.org using one of the following commands:
60
61
 
61
- | Holoscan SDK Version | Installation Command |
62
- | -------------------- | -------------------------- |
63
- | 2.8 or earlier | `pip install holoscan` |
64
- | 2.9 or later | `pip install holoscan-cli` |
62
+ | Holoscan SDK Version | Installation Command | CUDA Version |
63
+ | -------------------- | -------------------------- | ------------ |
64
+ | 2.8 or earlier | `pip install holoscan` | 12.6 |
65
+ | 2.9 or later | `pip install holoscan-cli` | 12.6 |
65
66
 
66
67
  ## Build From Source
67
68
 
@@ -1,28 +1,29 @@
1
1
  holoscan_cli/__init__.py,sha256=caPPFDAjPzNIAzHAtpWRuWy9GshNEetcN8FQiMmNsQQ,1092
2
2
  holoscan_cli/__main__.py,sha256=sOdEmgaajrtrtVeg39MuW15BU8moal9Vz2HDcWZM__U,4891
3
3
  holoscan_cli/common/argparse_types.py,sha256=KXbg09yaB73SyorWV0tLYRl-e8gydmzZVnuOlr-_kd0,5948
4
- holoscan_cli/common/artifact_sources.py,sha256=LIz2OFZmCJNRCn5_qkyncEaEjwwpAbzZzBAlE3tnSjs,5728
5
- holoscan_cli/common/constants.py,sha256=4yXMmz-PzHth5Qy4zt4E5bvpG6eQN3KQrjhyagRFDGw,4866
4
+ holoscan_cli/common/artifact_sources.py,sha256=_XCDqvUIlL1_P8E_ezELqQ_57OlbKv7Nkcb32qd5XZk,6303
5
+ holoscan_cli/common/constants.py,sha256=vjfcY2gN4Kdeb3Jj1axLcrtvg-93TO0Hx3omOtqrWLk,5018
6
6
  holoscan_cli/common/dockerutils.py,sha256=lbDt_TCB8b74FRJljvpV3s_zVD-E4FoH2-3rI8O_BbM,17684
7
7
  holoscan_cli/common/enum_types.py,sha256=qdqMum01uM0-qrF2jyk1GYGoh76xBJsBUX9cvxVbVtA,1711
8
8
  holoscan_cli/common/exceptions.py,sha256=ubN33Av69Xm_CUVC_5DeKx_zO8qfIc_T-_S18xDQguE,2999
9
- holoscan_cli/common/sdk_utils.py,sha256=5rJqz8JZFecVmSU10_dSO4_My0X-FleUY_eHmzd-4js,6528
9
+ holoscan_cli/common/sdk_utils.py,sha256=xiMV4LSRvAnlR3pIQdMPt3l21yADDkLQ8AdXeVQD3aA,6723
10
10
  holoscan_cli/common/utils.py,sha256=3plIFGMWy8WcRB2lL4fTqINlE1CyBkm9CDrIVA1qPDU,3796
11
11
  holoscan_cli/logging.json,sha256=0tfLHoqV5_xH_q4m9gQufHYfYezocFVJxtlEj6UR3qI,809
12
12
  holoscan_cli/nics/__init__.py,sha256=IMHmlnYvJxjlJGi1UxwRG0deK4w9M7-_WWDoCqKcjJE,737
13
13
  holoscan_cli/nics/nics.py,sha256=xcpo8uwQDJ7-46rPR-BEAWkyKHZOZ19gl9ahuxLNphs,1258
14
14
  holoscan_cli/package-source.json,sha256=-Cheb17hJqV7-CJktvj9RATIM_oA00k6_VPpFkIlPAc,1326
15
15
  holoscan_cli/packager/__init__.py,sha256=8uVz-FlG2vJV7Cz8ICOajioBbI9An5h-dRtSrkMCXZo,744
16
- holoscan_cli/packager/arguments.py,sha256=Ko98jIOURjcybM7ty3CSzHWWc67gm4wvVOj2GZtgADI,5855
16
+ holoscan_cli/packager/arguments.py,sha256=VpVfe07AhvtE_IVH36Z93_zEtMdG5AogkaID0Nmkvtw,5864
17
17
  holoscan_cli/packager/config_reader.py,sha256=oE0Tnp7v9dh_qAj6nPap-_R-YGLpYKGh09_FSV9oqVA,7352
18
- holoscan_cli/packager/container_builder.py,sha256=bGGcN2YjRFfvJiLsL_DjznomwkPtrdjcVnTteMz9NX0,18560
18
+ holoscan_cli/packager/container_builder.py,sha256=TfNj9Mm3W56oYdWIX7pgMwysFbbd7bbk_yORkAWHr2Y,19033
19
19
  holoscan_cli/packager/manifest_files.py,sha256=jueQMgZzQ9DhP2KGC1YdndDNwJl3ECunEKicBb3Z9Mc,5957
20
20
  holoscan_cli/packager/models.py,sha256=t3HXROo-obN5iNjKOkp8JvL6WuGP4QSRVZzET6V1wmI,3758
21
- holoscan_cli/packager/package_command.py,sha256=U3hu0mA8dWyZwN7zzm7hptam8tJDJeG4jLMGLTg7Lqk,6743
21
+ holoscan_cli/packager/package_command.py,sha256=XhiFRBr7T_7_hrznP2kgXiT6RAL8D87gJyfHBECYUvk,6986
22
22
  holoscan_cli/packager/packager.py,sha256=tUM5k-tlvUMq-LzAokub77s_D_6NDJlnRkXSZIuYnmk,4728
23
- holoscan_cli/packager/parameters.py,sha256=fSox76djvwV0Qf9q66FJIVbJheYQjtVpxMKCTnaAEQI,19166
24
- holoscan_cli/packager/platforms.py,sha256=H9AMr83YkW_Vx8cpp6qJLDCLqa2lcVnSAfkKc6vl6iU,16721
25
- holoscan_cli/packager/templates/Dockerfile.jinja2,sha256=UyRNcZhNWVRj1qaEav0HgIzuepoYhUL4CPaJQ0oZJog,17329
23
+ holoscan_cli/packager/parameters.py,sha256=i4ieE3L5HShO2nB8qYqpjzvvyysysvTgevjyJSvt2HA,19340
24
+ holoscan_cli/packager/platforms.py,sha256=ZoWroz8qgH8ave_nYpIRF32FgTsjgD1CVeohqYwWSIo,17201
25
+ holoscan_cli/packager/templates/Dockerfile-cu12.jinja2,sha256=l385Xp9rDuUjF0wP8A47N5nrkCJh3sinPg_zAGv1whU,13573
26
+ holoscan_cli/packager/templates/Dockerfile.jinja2,sha256=44IzrfvPyKUmrBgBI6N7wvrrze9bqI2t2zbr-ElBYbk,14112
26
27
  holoscan_cli/packager/templates/dockerignore,sha256=zzBkA9eWgPW4KWyObuYjp13bv_m24AnFUgoENGNhMcY,1755
27
28
  holoscan_cli/packager/templates/tools.sh,sha256=DnBs-XGWmxSz4XyspSMYwBajDXqUWQgUYD0HxtDw-88,13566
28
29
  holoscan_cli/py.typed,sha256=Z4hkVtwnqwhmVXOMES05WQZWjt4_rFEuditXTouPUJQ,684
@@ -32,8 +33,8 @@ holoscan_cli/runner/run_command.py,sha256=CnSyyq0y9rv6kkRtSOi3kOGHuRDLv2RDQ3JUWZ
32
33
  holoscan_cli/runner/runner.py,sha256=9TqvzBL5z1boGQXvlBiPiuuMDMg7dQlo40YXO1Le604,10521
33
34
  holoscan_cli/version/__init__.py,sha256=1pf-RBR16STdFXsh82bYly_lUyv1MgxuczbLOTDJRto,743
34
35
  holoscan_cli/version/version.py,sha256=1jAgChi39oEl9Rl0BDc30PPJMYeo7m5bMGPBGlRSX2M,1976
35
- holoscan_cli-3.6.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
36
- holoscan_cli-3.6.0.dist-info/METADATA,sha256=nPfiimMQUetPpXQYMN89IwMCkxcrSOTPk0oOBNxLvZ4,3967
37
- holoscan_cli-3.6.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
- holoscan_cli-3.6.0.dist-info/entry_points.txt,sha256=ZbJklrhFtmmhqcGvGizL_4Pf9FTRgmZ11LblKPbj8yo,95
39
- holoscan_cli-3.6.0.dist-info/RECORD,,
36
+ holoscan_cli-3.7.0.dist-info/METADATA,sha256=8I4NGalAtN8P40f7agQQ-pynzi97fopzfMbjMdeLtIo,4049
37
+ holoscan_cli-3.7.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
38
+ holoscan_cli-3.7.0.dist-info/entry_points.txt,sha256=ZbJklrhFtmmhqcGvGizL_4Pf9FTRgmZ11LblKPbj8yo,95
39
+ holoscan_cli-3.7.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
40
+ holoscan_cli-3.7.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.3
2
+ Generator: poetry-core 2.2.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any