Skip to content

Commit d6053e1

Browse files
JordanNanosclaude
andcommitted
Add thin bnxt layer Dockerfile for existing SGLang images
add-bnxt.Dockerfile adds Broadcom bnxt_rocelib + transformers patch on top of any SGLang ROCm base image. Faster than full rebuild when the base image already has the right SGLang version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d648774 commit d6053e1

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

docker/add-bnxt.Dockerfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Thin layer that adds Broadcom bnxt_rocelib RDMA support to any SGLang ROCm image.
2+
# Usage:
3+
# docker build --build-arg BASE_IMAGE=lmsysorg/sglang:v0.5.9-rocm700-mi30x \
4+
# -t semianalysiswork/sgl-bnxt-cdna3:v0.5.9-bnxt-lite \
5+
# -f add-bnxt.Dockerfile .
6+
7+
ARG BASE_IMAGE
8+
FROM ${BASE_IMAGE}
9+
10+
# Install RDMA build dependencies
11+
RUN apt-get update && apt-get install -y --no-install-recommends \
12+
libibumad-dev rdma-core ibverbs-utils infiniband-diags \
13+
gcc make libtool autoconf librdmacm-dev rdmacm-utils \
14+
perftest ethtool libibverbs-dev strace \
15+
&& rm -rf /var/lib/apt/lists/*
16+
17+
# Install Broadcom bnxt_rocelib
18+
ARG BCM_DRIVER=bcm5760x_231.2.63.0a.zip
19+
COPY ${BCM_DRIVER} /tmp/${BCM_DRIVER}
20+
RUN cd /tmp && \
21+
case "${BCM_DRIVER}" in \
22+
*.zip) apt-get update && apt-get install -y unzip && unzip -o ./${BCM_DRIVER} ;; \
23+
*.tar.gz) tar zxf ./${BCM_DRIVER} ;; \
24+
*) echo "ERROR: unsupported archive: ${BCM_DRIVER}" && exit 1 ;; \
25+
esac && \
26+
DIR_NAME="${BCM_DRIVER%.*}" && \
27+
# Handle double extension (.tar.gz)
28+
case "${BCM_DRIVER}" in *.tar.gz) DIR_NAME="${BCM_DRIVER%.tar.gz}" ;; esac && \
29+
cd /tmp/${DIR_NAME}/drivers_linux/bnxt_rocelib && \
30+
BCM_LIB=$(ls -1 *.tar.gz) && \
31+
tar zxf ${BCM_LIB} && \
32+
cd "${BCM_LIB%.tar.gz}" && \
33+
sh ./autogen.sh && \
34+
sh ./configure && \
35+
make -j8 && \
36+
# Backup inbox drivers and install
37+
find /usr/lib64/ /usr/lib -name "libbnxt_re-rdmav*.so" -exec mv {} {}.inbox \; 2>/dev/null || true && \
38+
make install && \
39+
echo /usr/local/lib >> /etc/ld.so.conf && \
40+
ldconfig && \
41+
# Cleanup
42+
rm -rf /tmp/${BCM_DRIVER} /tmp/${DIR_NAME} && \
43+
echo "bnxt_rocelib installed successfully"
44+
45+
# Upgrade transformers for glm_moe_dsa and qwen3_5_moe model type support
46+
RUN pip install --no-cache-dir -U \
47+
"git+https://github.com/huggingface/transformers.git@6ed9ee36f608fd145168377345bfc4a5de12e1e2" \
48+
&& python3 -c "import transformers; print(f'transformers {transformers.__version__}')"

0 commit comments

Comments
 (0)