Skip to content

Commit 4068744

Browse files
committed
Update Dockerfile-cuda-all and cuda-all-entrypoint.sh
1 parent dae45e3 commit 4068744

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Dockerfile-cuda-all

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ ARG DEFAULT_USE_FLASH_ATTENTION=True
115115
ENV HUGGINGFACE_HUB_CACHE=/data \
116116
PORT=80 \
117117
USE_FLASH_ATTENTION=$DEFAULT_USE_FLASH_ATTENTION \
118-
LD_LIBRARY_PATH="/usr/local/cuda/compat:${LD_LIBRARY_PATH}"
118+
LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
119119

120120
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
121121
ca-certificates \
122122
libssl-dev \
123123
curl \
124-
cuda-compat-13-1 \
124+
cuda-compat-12-9 \
125125
&& rm -rf /var/lib/apt/lists/*
126126

127127
COPY --from=builder /usr/src/target/release/text-embeddings-router-75 /usr/local/bin/text-embeddings-router-75

cuda-all-entrypoint.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ if ! command -v nvidia-smi &>/dev/null; then
55
exit 1
66
fi
77

8+
# NOTE: Given that we need to support CUDA versions earlier than CUDA 12.9.1, we
9+
# need to include the `cuda-compat-12-9` in `LD_LIBRARY_PATH` when the host CUDA
10+
# version is lower than that; whilst we shouldn't include that when CUDA is 13.0+
11+
# as otherwise it will fail due to it.
12+
if [ -d /usr/local/cuda/compat ]; then
13+
DRIVER_CUDA=$(nvidia-smi 2>/dev/null | awk '/CUDA Version/ {print $3; exit}')
14+
15+
IFS='.' read -r MAJ MIN PATCH <<EOF
16+
${DRIVER_CUDA:-0.0.0}
17+
EOF
18+
: "${MIN:=0}"
19+
: "${PATCH:=0}"
20+
21+
DRIVER_INT=$((10#${MAJ} * 10000 + 10#${MIN} * 100 + 10#${PATCH}))
22+
TARGET_INT=$((12 * 10000 + 9 * 100 + 1))
23+
24+
if [ "$DRIVER_INT" -lt "$TARGET_INT" ]; then
25+
export LD_LIBRARY_PATH="/usr/local/cuda/compat:${LD_LIBRARY_PATH}"
26+
fi
27+
fi
28+
829
compute_cap=$(nvidia-smi --query-gpu=compute_cap --format=csv | sed -n '2p' | sed 's/\.//g')
930

1031
if [ ${compute_cap} -eq 75 ]; then

0 commit comments

Comments
 (0)