Skip to content

Commit 6c3323c

Browse files
guptaNswatielezar
authored andcommitted
Add an nvbandwidth sample
This change adds an nvbandwidth sample that can be used to test both single and multi-node GPU interconnectivity. The multi-arch images are generated with the following image root: nvcr.io/ghcr.io/nvidia/k8s-samples:nvbandwidth Signed-off-by: Swati Gupta <[email protected]> Signed-off-by: Evan Lezar <[email protected]>
1 parent b24fcc2 commit 6c3323c

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

.github/workflows/image.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
default: true
2828

2929
jobs:
30-
build:
30+
build-cuda-samples:
3131
runs-on: linux-amd64-cpu4
3232
strategy:
3333
matrix:
@@ -38,11 +38,15 @@ jobs:
3838
- vectorAdd
3939
- nbody
4040
- deviceQuery
41+
- nvbandwidth
4142
exclude:
4243
- dist: ubi9
4344
sample: deviceQuery
4445
- dist: ubi9
4546
sample: nbody
47+
- dist: ubi9
48+
sample: nvbandwidth
49+
4650
steps:
4751
- uses: actions/checkout@v4
4852
name: Check out code
@@ -62,7 +66,7 @@ jobs:
6266
username: ${{ github.actor }}
6367
password: ${{ secrets.GITHUB_TOKEN }}
6468

65-
- name: Build image
69+
- name: Build cuda sample image
6670
env:
6771
IMAGE_NAME: ghcr.io/nvidia/k8s-samples
6872
VERSION: ${{ inputs.version }}

deployments/container/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ endif
8686
endif
8787

8888
build-%: DIST = $(*)
89-
ifeq ($(SAMPLE),nbody)
89+
# For the following samples, we use specific Dockerfiles:
90+
ifeq ($(SAMPLE),$(filter $(SAMPLE),nbody nvbandwidth))
9091
build-%: DOCKERFILE = $(CURDIR)/deployments/container/$(SAMPLE)/Dockerfile
9192
else
9293
build-%: DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile.$(DOCKERFILE_SUFFIX)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM nvcr.io/nvidia/cuda:12.6.2-devel-ubuntu22.04 AS builder
16+
17+
ENV DEBIAN_FRONTEND=noninteractive
18+
19+
RUN apt-get update && apt-get install -y --no-install-recommends \
20+
build-essential \
21+
git \
22+
cmake \
23+
g++ \
24+
gcc \
25+
make \
26+
libboost-program-options-dev \
27+
openmpi-bin \
28+
openmpi-common \
29+
libopenmpi-dev && \
30+
rm -rf /var/lib/apt/lists/*
31+
32+
WORKDIR /bandwidthtest
33+
34+
ARG NVBANDWIDTH_VERSION=v0.7
35+
36+
RUN git clone --branch ${NVBANDWIDTH_VERSION} --depth 1 --single-branch https://github.com/NVIDIA/nvbandwidth.git && \
37+
cd nvbandwidth && \
38+
cmake -DMULTINODE=1 . && \
39+
make -j$(nproc)
40+
41+
FROM mpioperator/openmpi:v0.6.0
42+
43+
COPY --from=builder /bandwidthtest/nvbandwidth/nvbandwidth /usr/bin
44+

0 commit comments

Comments
 (0)