Skip to content

Commit 8b496ab

Browse files
authored
Merge branch 'main' into vchang/ucx_ett_rmm_settings
2 parents c0f26f3 + fc9db3e commit 8b496ab

File tree

10 files changed

+63
-37
lines changed

10 files changed

+63
-37
lines changed

applications/adv_networking_bench/Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
17+
18+
# Note: duplicate of ../../operators/advanced_network to facilitate
19+
# the use of ./dev_container build_and_run adv_networking_bench
1720
ARG BASE_IMAGE
18-
ARG GPU_TYPE
1921

2022
FROM ${BASE_IMAGE} AS base
2123
ARG UBUNTU_VERSION=22.04
@@ -24,30 +26,27 @@ ARG CACHEBUST=1
2426
ARG TARGETARCH
2527
RUN echo "Using architecture ${TARGETARCH}"
2628

27-
2829
RUN apt update && apt install -y python3-pyelftools ninja-build meson libyaml-cpp-dev
2930
RUN pip3 install scipy loguru attrs
3031
WORKDIR /opt
3132

3233
ARG DEBIAN_FRONTEND=noninteractive
33-
ARG DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/x86_64
3434

3535
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
3636
DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/x86_64; \
3737
elif [ "$TARGETARCH" = "arm64" ]; then \
38-
DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/arm64; \
38+
DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/arm64-sbsa; \
3939
else \
4040
echo "Unknown architecture: $TARGETARCH"; \
4141
exit 1; \
4242
fi \
4343
&& echo "Using DOCA_REPO_LINK=${DOCA_REPO_LINK}" \
44-
&& apt install -y --no-install-recommends wget software-properties-common gpg-agent \
45-
&& wget -qO - ${DOCA_REPO_LINK}/GPG-KEY-Mellanox.pub | apt-key add - \
46-
&& add-apt-repository "deb [trusted=yes] ${DOCA_REPO_LINK} ./" \
44+
&& LOCAL_GPG_KEY_PATH="/usr/share/keyrings/mellanox-archive-keyring.gpg" \
45+
&& curl -fsSL ${DOCA_REPO_LINK}/GPG-KEY-Mellanox.pub | gpg --dearmor | tee ${LOCAL_GPG_KEY_PATH} \
46+
&& echo "deb [signed-by=${LOCAL_GPG_KEY_PATH}] ${DOCA_REPO_LINK} ./" | tee /etc/apt/sources.list.d/mellanox.list \
4747
&& apt update -y \
4848
&& apt install -y --no-install-recommends doca-sdk-aes-gcm doca-sdk-apsh doca-sdk-argp doca-sdk-comch doca-sdk-comm-channel doca-sdk-common doca-sdk-compress doca-sdk-devemu doca-sdk-dma doca-sdk-dpa doca-sdk-dpdk-bridge doca-sdk-erasure-coding doca-sdk-eth doca-sdk-flow doca-sdk-pcc doca-sdk-rdma doca-sdk-sha doca-sdk-telemetry-exporter doca-sdk-urom doca-apsh-config doca-bench doca-caps doca-comm-channel-admin doca-pcc-counters doca-sha-offload-engine doca-socket-relay doca-all doca-sdk-gpunetio libdoca-sdk-gpunetio-dev rdma-core flexio libyara8
4949

50-
5150
# ==============================
5251
# DOCA Target (inherits from base)
5352
# This stage is only built when --target doca is specified. It contains any DOCA-specific configurations.

applications/sam2/Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,32 @@
1616
# limitations under the License.
1717

1818

19-
FROM nvcr.io/nvidia/pytorch:24.06-py3 as pytorch
19+
FROM nvcr.io/nvidia/pytorch:24.06-py3 AS pytorch
2020

2121

2222
# Install dependencies
2323
RUN apt-get update && apt-get install -y \
24-
git \
24+
git \
2525
git-lfs \
2626
x11-apps \
2727
&& rm -rf /var/lib/apt/lists/*
2828

2929
# Set up Git LFS
3030
RUN git lfs install
3131

32+
3233
# Clone sam2
3334
WORKDIR /workspace
3435
ARG COMPUTE_CAPACITY
35-
RUN git clone https://github.com/facebookresearch/segment-anything-2.git \
36-
&& cd segment-anything-2 \
36+
RUN git clone https://github.com/facebookresearch/sam2.git \
37+
&& cd sam2 \
3738
&& python3 -m pip install --no-cache-dir -e . \
3839
&& python3 -m pip install --no-cache-dir -e ".[demo]" \
3940
&& cd checkpoints \
4041
&& ./download_ckpts.sh
4142
WORKDIR /workspace
4243

44+
4345
# Check the architecture and download the CUDA keyring
4446
RUN if [ $(uname -m) = "aarch64" ]; then ARCH=arm64 \
4547
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/sbsa/cuda-keyring_1.1-1_all.deb \
@@ -48,8 +50,8 @@ RUN if [ $(uname -m) = "aarch64" ]; then ARCH=arm64 \
4850
; else echo "Unsupported architecture"; fi
4951
RUN dpkg -i cuda-keyring_1.1-1_all.deb \
5052
&& apt-get update \
51-
&& apt-get -y install holoscan \
52-
&& export PYTHONPATH="/opt/nvidia/holoscan/python/lib"
53+
&& apt-get -y install holoscan
54+
5355

5456
# Setup Docker & NVIDIA Container Toolkit's apt repositories to enable DooD
5557
# for packaging & running applications with the CLI

applications/sam2/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ Determine your desired video device and edit the source device in [segment_one_t
4646
This application uses a custom Dockerfile based on a pytorch container.
4747
Build and run the application using
4848
```sh
49-
./dev_container build_and_run sam2 --docker_file applications/sam2/Dockerfile --img holohub:sam2
49+
./dev_container build_and_run sam2 --docker_file applications/sam2/Dockerfile --img holohub:sam2.1
5050
```
5151
Or first build the container, then launch it and run.
5252

5353
```sh
54-
./dev_container build --docker_file applications/sam2/Dockerfile --img holohub:sam2
54+
./dev_container build --docker_file applications/sam2/Dockerfile --img holohub:sam2.1
5555
```
5656
```sh
57-
./dev_container launch --img holohub:sam
57+
./dev_container launch --img holohub:sam2.1
5858
```
5959
```sh
60-
python holohub/applications/sam2/segment_one_thing.py
60+
./run launch sam2
6161
```
6262

6363
### x86 only

applications/sam2/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636

3737
"run": {
38-
"command": "python '<holohub_app_source>/segment_one_thing.py'",
38+
"command": "<holohub_app_source>/start.sh",
3939
"workdir": "holohub_bin"
4040
}
4141
}

applications/sam2/segment_one_thing.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ preprocessor:
3030
point_publisher:
3131
point_mover:
3232
- "width" : 1024
33-
"height": 1024
33+
"height": 1024
3434
"radius": 100
3535
"center_x": 512
3636
"center_y": 512
3737
"frequency": 0.2
3838

3939
sam2:
40-
checkpoint_path: "/workspace/segment-anything-2/checkpoints/sam2_hiera_large.pt"
41-
model_cfg: "sam2_hiera_l.yaml"
40+
checkpoint_path: "/workspace/sam2/checkpoints/sam2.1_hiera_large.pt"
41+
model_cfg: "configs/sam2.1/sam2.1_hiera_l.yaml"
4242

4343
# sam2:
44-
# checkpoint_path: "/workspace/segment-anything-2/checkpoints/sam2_hiera_small.pt"
45-
# model_cfg: "sam2_hiera_s.yaml"
44+
# checkpoint_path: "/workspace/sam2/checkpoints/sam2.1_hiera_small.pt"
45+
# model_cfg: "configs/sam2.1/sam2.1_hiera_s.yaml"
4646

4747
# sam2:
48-
# checkpoint_path: "/workspace/segment-anything-2/checkpoints/sam2_hiera_tiny.pt"
49-
# model_cfg: "sam2_hiera_t.yaml"
48+
# checkpoint_path: "/workspace/sam2/checkpoints/sam2.1_hiera_tiny.pt"
49+
# model_cfg: "configs/sam2.1/sam2.1_hiera_t.yaml"
5050

5151
postprocessor:
5252
slice_dim: 0
@@ -72,5 +72,3 @@ holoviz:
7272
# # [0.3, 0.3, 0.9, 0.75], #Blue RGB for SELLA with alpha=0.5
7373
# # [0.9, 0.9, 0.3, 0.75], #Yellow RGB for CLIVAL RECESS alpha=0.5 #https://rgbcolorpicker.com/0-1
7474
# ]
75-
76-

applications/sam2/start.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
# change the pythonpath
4+
export PYTHONPATH="${PYTHONPATH}:/workspace/sam2"
5+
export PYTHONPATH="${PYTHONPATH}:/opt/nvidia/holoscan/python/lib"
6+
7+
# launch the application
8+
python /workspace/holohub/applications/sam2/segment_one_thing.py

dev_container

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ build_and_run_desc() { c_echo 'Build and run a requested application in a Docker
874874
--run_args : Run the app with additional args
875875
--verbose : Print extra output to console
876876
--dryrun : View build and run commands without doing anything
877+
--parallel_jobs: Set the # of parallel build jobs, e.g. $(($(nproc)-1))
877878
'
878879
}
879880

@@ -892,6 +893,7 @@ build_and_run() {
892893
local run_app=1
893894
local install=""
894895
local configure_args=""
896+
local parallel_jobs=""
895897

896898
# Parse CLI arguments next
897899
while [[ $# -gt 0 ]]; do
@@ -1014,6 +1016,16 @@ build_and_run() {
10141016
exit 1
10151017
fi
10161018
;;
1019+
--parallel_jobs)
1020+
if [[ -n "$2" ]]; then
1021+
parallel_jobs="--parallel '$2'"
1022+
shift 2
1023+
else
1024+
echo "Error: --parallel_jobs requires a value"
1025+
build_and_run_desc
1026+
exit 1
1027+
fi
1028+
;;
10171029
*)
10181030
if [[ -z "$app_name" ]]; then
10191031
app_name="$1"
@@ -1057,7 +1069,7 @@ build_and_run() {
10571069
run_command ${SCRIPT_DIR}/dev_container build "${container_build_args[@]}"
10581070
if [[ $build_app == 1 ]]; then
10591071
c_echo "Building application..."
1060-
run_command ${SCRIPT_DIR}/dev_container launch $container_launch_args --docker_opts "$docker_opts" -- -c "./run build $app_name $install $extra_build_with $extra_build_args"
1072+
run_command ${SCRIPT_DIR}/dev_container launch $container_launch_args --docker_opts "$docker_opts" -- -c "./run build $app_name $install $parallel_jobs $extra_build_with $extra_build_args"
10611073
fi
10621074

10631075
if [[ $run_app == 1 ]]; then

gxf_extensions/emergent_source/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ target_link_libraries(gxf_emergent_source_lib
2828
CUDA::cuda_driver
2929
GXF::multimedia
3030
GXF::std
31+
holoscan::core
3132
yaml-cpp
3233
EmergentCamera
3334
)

operators/advanced_network/Dockerfile

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,27 @@ ARG CACHEBUST=1
2424
ARG TARGETARCH
2525
RUN echo "Using architecture ${TARGETARCH}"
2626

27-
2827
RUN apt update && apt install -y python3-pyelftools ninja-build meson libyaml-cpp-dev
2928
RUN pip3 install scipy loguru attrs
3029
WORKDIR /opt
3130

3231
ARG DEBIAN_FRONTEND=noninteractive
33-
ARG DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/x86_64
3432

3533
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
3634
DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/x86_64; \
3735
elif [ "$TARGETARCH" = "arm64" ]; then \
38-
DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/arm64-ssba; \
36+
DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/2.8.0/ubuntu22.04/arm64-sbsa; \
3937
else \
4038
echo "Unknown architecture: $TARGETARCH"; \
4139
exit 1; \
4240
fi \
4341
&& echo "Using DOCA_REPO_LINK=${DOCA_REPO_LINK}" \
44-
&& apt install -y --no-install-recommends wget software-properties-common gpg-agent \
45-
&& wget -qO - ${DOCA_REPO_LINK}/GPG-KEY-Mellanox.pub | apt-key add - \
46-
&& add-apt-repository "deb [trusted=yes] ${DOCA_REPO_LINK} ./" \
42+
&& LOCAL_GPG_KEY_PATH="/usr/share/keyrings/mellanox-archive-keyring.gpg" \
43+
&& curl -fsSL ${DOCA_REPO_LINK}/GPG-KEY-Mellanox.pub | gpg --dearmor | tee ${LOCAL_GPG_KEY_PATH} \
44+
&& echo "deb [signed-by=${LOCAL_GPG_KEY_PATH}] ${DOCA_REPO_LINK} ./" | tee /etc/apt/sources.list.d/mellanox.list \
4745
&& apt update -y \
4846
&& apt install -y --no-install-recommends doca-sdk-aes-gcm doca-sdk-apsh doca-sdk-argp doca-sdk-comch doca-sdk-comm-channel doca-sdk-common doca-sdk-compress doca-sdk-devemu doca-sdk-dma doca-sdk-dpa doca-sdk-dpdk-bridge doca-sdk-erasure-coding doca-sdk-eth doca-sdk-flow doca-sdk-pcc doca-sdk-rdma doca-sdk-sha doca-sdk-telemetry-exporter doca-sdk-urom doca-apsh-config doca-bench doca-caps doca-comm-channel-admin doca-pcc-counters doca-sha-offload-engine doca-socket-relay doca-all doca-sdk-gpunetio libdoca-sdk-gpunetio-dev rdma-core flexio libyara8
4947

50-
5148
# ==============================
5249
# DOCA Target (inherits from base)
5350
# This stage is only built when --target doca is specified. It contains any DOCA-specific configurations.

run

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,9 @@ build_desc() {
557557
echo " --configure-args <extra_args> : Additional configuration arguments"
558558
echo " multiple arguments can be passed between quotes"
559559
echo " or using several --configure-args in the command line"
560+
echo " --parallel <jobs> : Build in parallel using the given number of jobs."
561+
echo " Only needed to override the native build tool's default."
562+
echo " Example: --parallel $(($(nproc)-1))"
560563
echo ""
561564
echo "Prior to the first build use './run setup' to install the required dependencies"
562565
echo ""
@@ -619,6 +622,7 @@ build() {
619622
local build_path="${CMAKE_BUILD_PATH}"
620623
local benchmark=false
621624
local install=false
625+
local parallel_jobs=""
622626

623627
for i in "${!ARGS[@]}"; do
624628
arg="${ARGS[i]}"
@@ -650,6 +654,10 @@ build() {
650654
elif [ "$arg" = "--buildpath" ]; then
651655
build_path="${ARGS[i+1]}"
652656
skipnext=1
657+
elif [ "$arg" = "--parallel" ]; then
658+
parallel_jobs="${ARGS[i+1]}"
659+
echo "Setting the number of parallel build jobs: ${ARGS[i+1]}"
660+
skipnext=1
653661
elif [[ $arg = -* ]]; then
654662
print_error "Unknown option $arg"
655663
exit 1
@@ -692,7 +700,8 @@ build() {
692700
run_command cmake -S . -B ${build_path} ${cmake_extra_args} -DCMAKE_BUILD_TYPE=${build_type} ${holoscan_sdk} ${application}
693701
ret=$?
694702
check_exit_code $ret "Error building application."
695-
run_command cmake --build ${build_path} -j
703+
# Job concurrency determined by the underlying build tool unless a number is specified
704+
run_command cmake --build ${build_path} -j ${parallel_jobs}
696705
ret=$?
697706
check_exit_code $ret "Error building application."
698707

0 commit comments

Comments
 (0)