@@ -75,45 +75,26 @@ RUN --mount=type=bind,source=${HOLOSCAN_DEB_LOCAL_PATH},target=/tmp/holoscan.deb
7575FROM hsdk-${HOLOSCAN_DEB_SRC} AS hsdk-installed
7676
7777# ==============================================================
78- # common -deps: common dependencies for the advanced network lib
78+ # base -deps: base dependencies for the advanced network lib
7979# ==============================================================
80- FROM hsdk-installed AS common -deps
80+ FROM hsdk-installed AS base -deps
8181
8282ARG TARGETARCH
83- ARG DOCA_VERSION=2.8.0
8483ARG CACHEBUST=1
8584ARG DEBIAN_FRONTEND=noninteractive
8685
8786WORKDIR /opt
8887
89- # Configure the DOCA APT repository
90- RUN if [ "${TARGETARCH}" = "amd64" ]; then \
91- DOCA_ARCH="x86_64" ; \
92- elif [ "$TARGETARCH" = "arm64" ]; then \
93- DOCA_ARCH="arm64-sbsa" ; \
94- else \
95- echo "Unknown architecture: $TARGETARCH" ; \
96- exit 1; \
97- fi \
98- && DISTRO=$(. /etc/os-release && echo ${ID}${VERSION_ID}) \
99- && DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/${DOCA_VERSION}/${DISTRO}/${DOCA_ARCH} \
100- && echo "Using DOCA_REPO_LINK=${DOCA_REPO_LINK}" \
101- && LOCAL_GPG_KEY_PATH="/usr/share/keyrings/mellanox-archive-keyring.gpg" \
102- && curl -fsSL ${DOCA_REPO_LINK}/GPG-KEY-Mellanox.pub | gpg --dearmor | tee ${LOCAL_GPG_KEY_PATH} > /dev/null \
103- && echo "deb [signed-by=${LOCAL_GPG_KEY_PATH}] ${DOCA_REPO_LINK} ./" | tee /etc/apt/sources.list.d/mellanox.list
104-
105- # APT installs
88+ # APT installs for base dependencies (no DOCA/GPUNetIO packages)
10689# - cublas, cufft, cusolver, curand dev libs: for matx
10790# - ninja-build: for cmake build
108- # - pkgconf: to import dpdk and doca in CMake
109- # - mlnx-dpdk-dev: for dpdk and gpunetio backends
110- # - libdoca-sdk-dma-dev: for gpunetio backend (dependency of doca-gpunetio module)
111- # - libdoca-sdk-gpunetio-dev: for gpunetio backend (doca-gpunetio module)
112- # - libdoca-sdk-eth-dev: for gpunetio backend (doca-eth module)
113- # - libdoca-sdk-flow-dev: for gpunetio backend (doca-flow module)
114- # - mlnx-ofed-kernel-utils: utilities, including ibdev2netdev used by tune_system.py
91+ # - pkgconf: to import dpdk in CMake
92+ # - meson: for building DPDK
93+ # - python3-pyelftools: required for DPDK build
94+ # - libnuma-dev: NUMA support for DPDK
95+ # - libibverbs-dev, librdmacm-dev: RDMA/ibverbs support for Mellanox NICs
96+ # - libmlx5-1: Mellanox ConnectX driver
11597# - ibverbs-utils: utilities
116- # - python3-pyelftools: used by some mlnx tools
11798# - python3-dev: for building python bindings
11899RUN apt-get update && apt-get install -y --no-install-recommends \
119100 libcublas-dev-12-6 \
@@ -122,14 +103,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
122103 libcurand-dev-12-6 \
123104 ninja-build \
124105 pkgconf \
125- mlnx-dpdk-dev \
126- libdoca-sdk-dma-dev \
127- libdoca-sdk-gpunetio-dev \
128- libdoca-sdk-eth-dev \
129- libdoca-sdk-flow-dev \
130- mlnx-ofed-kernel-utils \
131- ibverbs-utils \
106+ meson \
132107 python3-pyelftools \
108+ libnuma-dev \
109+ libibverbs-dev \
110+ librdmacm-dev \
111+ libmlx5-1 \
112+ ibverbs-utils \
133113 python3-dev \
134114 && rm -rf /var/lib/apt/lists/*
135115
@@ -142,25 +122,107 @@ RUN python3 -m pip install --no-cache-dir \
142122 pyyaml \
143123 scapy
144124
125+ # ==============================================================
126+ # dpdk-build: Build upstream DPDK from source
127+ # ==============================================================
128+ FROM base-deps AS dpdk-build
129+
130+ ARG TARGETARCH
131+ # DPDK version to download and build
132+ ARG DPDK_VERSION=24.11.3
133+ ARG DPDK_BUILD_DIR=/opt/dpdk-build
134+ ARG DPDK_INSTALL_PREFIX=/usr/local
135+ ARG DOCA_VERSION=2.8.0
136+ ARG DEBIAN_FRONTEND=noninteractive
137+
138+ WORKDIR /tmp
139+
140+ # Download DPDK source from official repository
141+ ADD https://fast.dpdk.org/rel/dpdk-${DPDK_VERSION}.tar.xz /tmp/
142+ RUN tar xf dpdk-${DPDK_VERSION}.tar.xz
143+
144+ # Build and install DPDK using meson/ninja
145+ WORKDIR /tmp/dpdk-stable-${DPDK_VERSION}
146+ RUN meson setup ${DPDK_BUILD_DIR} \
147+ --prefix=${DPDK_INSTALL_PREFIX} \
148+ -Denable_kmods=false \
149+ -Dtests=false \
150+ -Denable_docs=false \
151+ -Ddisable_drivers=baseband/*,bus/ifpga/*,common/cpt,common/dpaax,common/iavf,common/octeontx,common/octeontx2,crypto/nitrox,net/ark,net/atlantic,net/avp,net/axgbe,net/bnx2x,net/bnxt,net/cxgbe,net/e1000,net/ena,net/enic,net/fm10k,net/hinic,net/hns3,net/i40e,net/ixgbe,vdpa/ifc,net/igc,net/liquidio,net/netvsc,net/nfp,net/qede,net/sfc,net/thunderx,net/vdev_netvsc,net/vmxnet3,regex/octeontx2 \
152+ && cd ${DPDK_BUILD_DIR} \
153+ && ninja \
154+ && meson install \
155+ && ldconfig \
156+ && rm -rf /tmp/dpdk-stable-${DPDK_VERSION} /tmp/dpdk-stable-${DPDK_VERSION}.tar.xz ${DPDK_BUILD_DIR} /tmp/dpdk_patches
157+
158+ # Configure the DOCA APT repository for mlnx-ofed-kernel-utils
159+ # (needed for ibdev2netdev utility used by tune_system.py)
160+ RUN if [ "${TARGETARCH}" = "amd64" ]; then \
161+ DOCA_ARCH="x86_64" ; \
162+ elif [ "$TARGETARCH" = "arm64" ]; then \
163+ DOCA_ARCH="arm64-sbsa" ; \
164+ else \
165+ echo "Unknown architecture: $TARGETARCH" ; \
166+ exit 1; \
167+ fi \
168+ && DISTRO=$(. /etc/os-release && echo ${ID}${VERSION_ID}) \
169+ && DOCA_REPO_LINK=https://linux.mellanox.com/public/repo/doca/${DOCA_VERSION}/${DISTRO}/${DOCA_ARCH} \
170+ && echo "Using DOCA_REPO_LINK=${DOCA_REPO_LINK}" \
171+ && LOCAL_GPG_KEY_PATH="/usr/share/keyrings/mellanox-archive-keyring.gpg" \
172+ && curl -fsSL ${DOCA_REPO_LINK}/GPG-KEY-Mellanox.pub | gpg --dearmor | tee ${LOCAL_GPG_KEY_PATH} > /dev/null \
173+ && echo "deb [signed-by=${LOCAL_GPG_KEY_PATH}] ${DOCA_REPO_LINK} ./" | tee /etc/apt/sources.list.d/mellanox.list
174+
175+ # Install mlnx-ofed-kernel-utils (utilities including ibdev2netdev used by tune_system.py)
176+ RUN apt-get update && apt-get install -y --no-install-recommends \
177+ mlnx-ofed-kernel-utils \
178+ && rm -rf /var/lib/apt/lists/*
179+
180+ WORKDIR /opt
181+
145182# ==============================
146- # DOCA Target
147- # This stage is only built when --target doca is specified. It contains any DOCA-specific configurations.
183+ # DPDK Target (Default)
184+ # This is the default target for users who only need DPDK support.
185+ # GPUNetIO/DOCA is NOT included.
148186# ==============================
149- FROM common-deps AS doca
150- # DOCA-specific installation or steps (if needed)
187+ FROM dpdk-build AS dpdk
188+ # DPDK is ready to use, no additional steps needed
189+
190+ # ==============================================================
191+ # gpunetio-deps: Add DOCA SDK packages for GPUNetIO support
192+ # ==============================================================
193+ FROM dpdk-build AS gpunetio-deps
194+
195+ ARG DEBIAN_FRONTEND=noninteractive
196+
197+ # Install DOCA SDK packages required for GPUNetIO
198+ # (DOCA repo is already configured in dpdk-build stage)
199+ # - libdoca-sdk-dma-dev: for gpunetio backend (dependency of doca-gpunetio module)
200+ # - libdoca-sdk-gpunetio-dev: for gpunetio backend (doca-gpunetio module)
201+ # - libdoca-sdk-eth-dev: for gpunetio backend (doca-eth module)
202+ # - libdoca-sdk-flow-dev: for gpunetio backend (doca-flow module)
203+ RUN apt-get update && apt-get install -y --no-install-recommends \
204+ libdoca-sdk-dma-dev \
205+ libdoca-sdk-gpunetio-dev \
206+ libdoca-sdk-eth-dev \
207+ libdoca-sdk-flow-dev \
208+ && rm -rf /var/lib/apt/lists/*
151209
152210# ==============================
153- # DPDK Target
154- # This stage is only built when --target dpdk is specified. It contains any DPDK-specific configurations.
211+ # GPUNetIO Target
212+ # This stage is built when --target gpunetio is specified.
213+ # It includes DOCA packages required for GPUNetIO support.
155214# ==============================
156- FROM common -deps AS dpdk
157- # DPDK-specific installation or steps (if needed)
215+ FROM gpunetio -deps AS gpunetio
216+ # GPUNetIO is ready to use with DOCA support
158217
159218# ==============================
160219# Rivermax Target
161220# This stage is only built when --target rivermax is specified. It installs and configures Rivermax SDK.
221+ # Note: Rivermax does not require DPDK - extends from base-deps directly.
162222# ==============================
163- FROM common-deps AS rivermax
223+ FROM base-deps AS rivermax
224+
225+ ARG TARGETARCH
164226
165227# Define Rivermax-specific build arguments and environment variables
166228ARG RIVERMAX_VERSION=1.70.32
@@ -227,7 +289,9 @@ RUN cd rivermax-dev-kit && \
227289 cmake --build build -j $(nproc)
228290
229291# ==============================
230- # Default stage: common-deps
231- # If no target is specified, the common-deps stage will be built by default.
292+ # Default stage: dpdk
293+ # If no target is specified, the dpdk stage will be built by default.
294+ # This provides upstream DPDK support without DOCA dependencies.
295+ # Use --target gpunetio if you need DOCA GPUNetIO support.
232296# ==============================
233- FROM common-deps
297+ FROM dpdk
0 commit comments