A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 09:45 UTC
[Tool] Add NIXL installation script (#18172)
Signed-off-by: Linkun <github@lkchen.net>
lkchen committed
May 22, 2025 at 14:33 UTC
7b9d832c80042dc5fae8658ea754379414f19de6
1 file changed
+109
tools/install_nixl.sh
new
+109
@@ -0,0 +1,109 @@
1
+#!/bin/bash
2
+# Usage: ./install_nixl.sh [--force]
3
+
4
+FORCE=false
5
+if [ "$1" == "--force" ]; then
6
+ FORCE=true
7
+fi
8
+
9
+SUDO=false
10
+if command -v sudo >/dev/null 2>&1 && sudo -n true 2>/dev/null; then
11
+ SUDO=true
12
+fi
13
+
14
+ARCH=$(uname -m)
15
+
16
+ROOT_DIR="/usr/local"
17
+mkdir -p "$ROOT_DIR"
18
+GDR_HOME="$ROOT_DIR/gdrcopy"
19
+UCX_HOME="$ROOT_DIR/ucx"
20
+NIXL_HOME="$ROOT_DIR/nixl"
21
+CUDA_HOME=/usr/local/cuda
22
+
23
+export PATH="$GDR_HOME/bin:$UCX_HOME/bin:$NIXL_HOME/bin:$PATH"
24
+export LD_LIBRARY_PATH="$GDR_HOME/lib:$UCX_HOME/lib:$NIXL_HOME/lib/$ARCH-linux-gnu:$LD_LIBRARY_PATH"
25
+
26
+TEMP_DIR="nixl_installer"
27
+mkdir -p "$TEMP_DIR"
28
+cd "$TEMP_DIR"
29
+
30
+pip install meson ninja pybind11
31
+
32
+if [ ! -e "/dev/gdrdrv" ] || [ "$FORCE" = true ]; then
33
+ echo "Installing gdrcopy\n"
34
+ wget https://github.com/NVIDIA/gdrcopy/archive/refs/tags/v2.5.tar.gz
35
+ tar xzf v2.5.tar.gz; rm v2.5.tar.gz
36
+ cd gdrcopy-2.5
37
+ make prefix=$GDR_HOME CUDA=$CUDA_HOME all install
38
+
39
+ if $SUDO; then
40
+ echo "Running insmod.sh with sudo"
41
+ sudo ./insmod.sh
42
+ else
43
+ echo "Skipping insmod.sh - sudo not available"
44
+ echo "Please run 'sudo ./gdrcopy-2.5/insmod.sh' manually if needed"
45
+ fi
46
+
47
+ cd ..
48
+else
49
+ echo "Found /dev/gdrdrv. Skipping gdrcopy installation"
50
+fi
51
+
52
+if ! command -v ucx_info &> /dev/null || [ "$FORCE" = true ]; then
53
+ echo "Installing UCX"
54
+ wget https://github.com/openucx/ucx/releases/download/v1.18.0/ucx-1.18.0.tar.gz
55
+ tar xzf ucx-1.18.0.tar.gz; rm ucx-1.18.0.tar.gz
56
+ cd ucx-1.18.0
57
+
58
+ # Checking Mellanox NICs
59
+ MLX_OPTS=""
60
+ if lspci | grep -i mellanox > /dev/null || command -v ibstat > /dev/null; then
61
+ echo "Mellanox NIC detected, adding Mellanox-specific options"
62
+ MLX_OPTS="--with-rdmacm \
63
+ --with-mlx5-dv \
64
+ --with-ib-hw-tm"
65
+ fi
66
+
67
+ ./configure --prefix=$UCX_HOME \
68
+ --enable-shared \
69
+ --disable-static \
70
+ --disable-doxygen-doc \
71
+ --enable-optimizations \
72
+ --enable-cma \
73
+ --enable-devel-headers \
74
+ --with-cuda=$CUDA_HOME \
75
+ --with-dm \
76
+ --with-gdrcopy=$GDR_HOME \
77
+ --with-verbs \
78
+ --enable-mt \
79
+ $MLX_OPTS
80
+ make -j
81
+ make -j install-strip
82
+
83
+ if $SUDO; then
84
+ echo "Running ldconfig with sudo"
85
+ sudo ldconfig
86
+ else
87
+ echo "Skipping ldconfig - sudo not available"
88
+ echo "Please run 'sudo ldconfig' manually if needed"
89
+ fi
90
+
91
+ cd ..
92
+else
93
+ echo "Found existing UCX. Skipping UCX installation"
94
+fi
95
+
96
+if ! command -v nixl_test &> /dev/null || [ "$FORCE" = true ]; then
97
+ echo "Installing NIXL"
98
+ wget https://github.com/ai-dynamo/nixl/archive/refs/tags/0.2.0.tar.gz
99
+ tar xzf 0.2.0.tar.gz; rm 0.2.0.tar.gz
100
+ cd nixl-0.2.0
101
+ meson setup build --prefix=$NIXL_HOME -Ducx_path=$UCX_HOME
102
+ cd build
103
+ ninja
104
+ ninja install
105
+
106
+ cd ../..
107
+else
108
+ echo "Found existing NIXL. Skipping NIXL installation"
109
+fi