Skip to content

Commit e8ef1b5

Browse files
[None][infra] Support RDMA in Docker development setup
Signed-off-by: ZhaoyangWang <zhaoyangw@nvidia.com>
1 parent f3e458e commit e8ef1b5

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

docker/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ base_pull:
132132
docker pull $(IMAGE_WITH_TAG)
133133

134134
DOCKER_RUN_OPTS ?= --rm -it --ipc=host --ulimit stack=67108864 $(if $(filter 0,$(IS_ROOTLESS)),--ulimit memlock=-1)
135+
RDMA_DOCKER_RUN_ARGS ?= $(shell if [ -e /dev/infiniband ]; then printf '%s' '--device=/dev/infiniband --cap-add=IPC_LOCK --cap-add=SYS_RESOURCE --cap-add=NET_RAW --volume /sys/class/infiniband:/sys/class/infiniband:ro --volume /sys/devices:/sys/devices:ro'; fi)
135136
DOCKER_RUN_ARGS ?=
136137
# Check if NVIDIA_VISIBLE_DEVICES is set and not empty
137138
NVIDIA_VISIBLE_DEVICES_VAL = $(shell echo $$NVIDIA_VISIBLE_DEVICES)
@@ -163,7 +164,7 @@ endif
163164
ifeq ($(LOCAL_USER),1)
164165
$(call add_local_user,$(IMAGE_WITH_TAG))
165166
endif
166-
docker run $(DOCKER_RUN_OPTS) $(DOCKER_RUN_ARGS) \
167+
docker run $(DOCKER_RUN_OPTS) $(RDMA_DOCKER_RUN_ARGS) $(DOCKER_RUN_ARGS) \
167168
$(GPU_OPTS) \
168169
--volume $(SOURCE_DIR):$(CODE_DIR) \
169170
$(EXTRA_VOLUMES) \

docker/common/install_base.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@ init_ubuntu() {
6969
apt remove -y ibverbs-providers libibverbs1
7070
apt-get --reinstall install -y libibverbs-dev
7171
apt-get install -y --no-install-recommends \
72+
rdma-core \
73+
libibverbs1 \
74+
libibverbs-dev \
75+
ibverbs-utils \
76+
ibverbs-providers \
77+
gcc \
78+
libc-dev \
7279
libtool \
7380
autoconf \
7481
automake \

0 commit comments

Comments
 (0)