Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCA 2.6 from public repo #1588

Merged
merged 11 commits into from
Apr 5, 2024
3 changes: 0 additions & 3 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ FROM conda_env as base_extended
# Add one or more optional dependencies to the base environment
ARG MORPHEUS_ROOT_HOST
ARG MORPHEUS_SUPPORT_DOCA="FALSE"
ARG DOCA_REPO_HOST
ARG DOCA_VERSION=2.6.0-0.0.1

# Set this environment variable so it auto builds DOCA
ENV MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA}

Expand Down
3 changes: 0 additions & 3 deletions docker/build_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ DOCKER_EXTRA_ARGS=${DOCKER_EXTRA_ARGS:-""}
CUDA_MAJOR_VER=${CUDA_MAJOR_VER:-12}
CUDA_MINOR_VER=${CUDA_MINOR_VER:-1}
CUDA_REV_VER=${CUDA_REV_VER:-1}
DOCA_REPO_HOST=${DOCA_REPO_HOST:-""}
FROM_IMAGE=${FROM_IMAGE:-"nvidia/cuda"}
LINUX_DISTRO=${LINUX_DISTRO:-ubuntu}
LINUX_VER=${LINUX_VER:-22.04}
Expand All @@ -47,7 +46,6 @@ DOCKER_ARGS="${DOCKER_ARGS} --target ${DOCKER_TARGET}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg CUDA_MAJOR_VER=${CUDA_MAJOR_VER}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg CUDA_MINOR_VER=${CUDA_MINOR_VER}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg CUDA_REV_VER=${CUDA_REV_VER}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg DOCA_REPO_HOST=${DOCA_REPO_HOST}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg FROM_IMAGE=${FROM_IMAGE}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg LINUX_DISTRO=${LINUX_DISTRO}"
DOCKER_ARGS="${DOCKER_ARGS} --build-arg LINUX_VER=${LINUX_VER}"
Expand All @@ -66,7 +64,6 @@ echo "Building morpheus:${DOCKER_TAG} with args..."
echo " CUDA_MAJOR_VER : ${CUDA_MAJOR_VER}"
echo " CUDA_MINOR_VER : ${CUDA_MINOR_VER}"
echo " CUDA_REV_VER : ${CUDA_REV_VER}"
echo " DOCA_REPO_HOST : ${DOCA_REPO_HOST}"
echo " FROM_IMAGE : ${FROM_IMAGE}"
echo " LINUX_DISTRO : ${LINUX_DISTRO}"
echo " LINUX_VER : ${LINUX_VER}"
Expand Down
68 changes: 58 additions & 10 deletions docker/optional_deps/doca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
set -e

MORPHEUS_SUPPORT_DOCA=${MORPHEUS_SUPPORT_DOCA:-OFF}
LINUX_DISTRO=${LINUX_DISTRO}
LINUX_VER=${LINUX_VER}
DOCA_VERSION="2.6.0"

# Exit early if nothing to do
if [[ ${MORPHEUS_SUPPORT_DOCA} != @(TRUE|ON) ]]; then
exit 0
fi

DOCA_REPO_HOST=${DOCA_REPO_HOST:?"Must set \$DOCA_REPO_HOST to build DOCA."}
DOCA_VERSION=${DOCA_VERSION:-2.6.0-0.0.1}
WORKING_DIR=$1

echo "Installing DOCA using directory: ${WORKING_DIR}"
Expand All @@ -33,15 +34,62 @@ DEB_DIR=${WORKING_DIR}/deb

mkdir -p ${DEB_DIR}

# Download all files with -nc to skip download if its already there
wget -nc -P ${DEB_DIR} https://${DOCA_REPO_HOST}/doca-repo-2.6.0/doca-repo-2.6.0-0.0.1-240205-083002-daily/doca-host-repo-ubuntu2204_2.6.0-0.0.1-240205-083002-daily.2.6.0058.1.24.01.0.3.3.1_amd64.deb
# Install the doca host repo
dpkg -i ${DEB_DIR}/doca-host-repo*.deb
DOCA_REPO_LINK="https://linux.mellanox.com/public/repo/doca/${DOCA_VERSION}"
# ${LINUX_DISTRO}${LINUX_VER}
DOCA_REPO="${DOCA_REPO_LINK}/ubuntu22.04"
DOCA_REPO_ARCH="x86_64"
DOCA_UPSTREAM_REPO="${DOCA_REPO}/${DOCA_REPO_ARCH}"

# Install all other packages
apt-get update
# apt-get install -y libjson-c-dev meson cmake pkg-config
apt-get install -y doca-sdk doca-runtime doca-gpu doca-gpu-dev
# Upgrade the base packages (diff between image and Canonical upstream repo)
apt update -y
apt upgrade -y
# Cleanup apt
rm -rf /var/lib/apt/lists/*
apt autoremove -y

# Configure DOCA Repository, and install packages
apt update -y
# Install wget & Add the DOCA public repository
apt install -y --no-install-recommends wget software-properties-common gpg-agent
wget -qO - ${DOCA_UPSTREAM_REPO}/GPG-KEY-Mellanox.pub | apt-key add -
add-apt-repository "deb [trusted=yes] ${DOCA_UPSTREAM_REPO} ./"
apt update -y
# Install base-rt content
apt install -y --no-install-recommends \
doca-gpu \
doca-gpu-dev \
doca-prime-runtime \
doca-prime-sdk \
doca-sdk \
dpcp \
flexio \
ibacm \
ibverbs-utils \
librdmacm1 \
libibnetdisc5 \
libibumad3 \
libibmad5 \
libopensm \
libopenvswitch \
libyara8 \
mlnx-tools \
ofed-scripts \
openmpi \
openvswitch-common \
openvswitch-switch \
srptools \
mlnx-ethtool \
mlnx-iproute2 \
python3-pyverbs \
rdma-core \
ucx \
yara

# Cleanup apt
rm -rf /usr/lib/python3/dist-packages
apt remove -y software-properties-common gpg-agent
rm -rf /var/lib/apt/lists/*
apt autoremove -y

# Now install the gdrcopy library according to: https://github.com/NVIDIA/gdrcopy
GDRCOPY_DIR=${WORKING_DIR}/gdrcopy
Expand Down
4 changes: 3 additions & 1 deletion examples/doca/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ def run_pipeline(pipeline_batch_size,

# add doca source stage
pipeline.set_source(DocaSourceStage(config, nic_addr, gpu_addr, traffic_type))
pipeline.add_stage(MonitorStage(config, description="DOCA GPUNetIO rate", unit='pkts'))

if traffic_type == 'udp':
pipeline.add_stage(MonitorStage(config, description="DOCA GPUNetIO rate", unit='pkts'))

if traffic_type == 'tcp':
# add deserialize stage
Expand Down
5 changes: 2 additions & 3 deletions morpheus/_lib/doca/src/doca_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ DocaSourceStage::subscriber_fn_t DocaSourceStage::build()
int thread_idx = mrc::runnable::Context::get_runtime_context().rank();

if (thread_idx >= MAX_QUEUE)
{
MORPHEUS_FAIL(MORPHEUS_CONCAT_STR("Thread ID " << thread_idx << " bigger than MAX_QUEUE " << MAX_QUEUE));
}
MORPHEUS_FAIL("More CPU threads than allowed queues");
// MORPHEUS_FAIL(MORPHEUS_CONCAT_STR("Thread ID " << thread_idx << " bigger than MAX_QUEUE " << MAX_QUEUE));

payload_buffer_d.reserve(MAX_SEM_X_QUEUE);
payload_sizes_d.reserve(MAX_SEM_X_QUEUE);
Expand Down
Loading