File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,13 @@ ARG DEFAULT_USE_FLASH_ATTENTION=True
115115ENV 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
120120RUN 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
127127COPY --from=builder /usr/src/target/release/text-embeddings-router-75 /usr/local/bin/text-embeddings-router-75
Original file line number Diff line number Diff line change @@ -5,6 +5,27 @@ if ! command -v nvidia-smi &>/dev/null; then
55 exit 1
66fi
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+
829compute_cap=$( nvidia-smi --query-gpu=compute_cap --format=csv | sed -n ' 2p' | sed ' s/\.//g' )
930
1031if [ ${compute_cap} -eq 75 ]; then
You can’t perform that action at this time.
0 commit comments