Skip to content

Commit ca6a7cb

Browse files
committed
Add ld.conf for cudnn
1 parent e16f9de commit ca6a7cb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build/COPY_ROOT/opt/ai-dock/bin/build/layer0/common.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export MAMBA_INSTALL="micromamba install --always-softlink -y -c pytorch -c cond
1515
printf "export MAMBA_CREATE=\"%s\"\n" "${MAMBA_CREATE}" >> /opt/ai-dock/etc/environment.sh
1616
printf "export MAMBA_INSTALL=\"%s\"\n" "${MAMBA_INSTALL}" >> /opt/ai-dock/etc/environment.sh
1717

18+
python_version="$(micromamba -n $MAMBA_DEFAULT_ENV run python -V | tail -n1 | awk '{print $2}' | cut -d '.' -f1,2)"
19+
printf "/opt/micromamba/envs/%s/lib/python%s/site-packages/torch/lib/\n" "$MAMBA_DEFAULT_ENV" "$python_version" >> /etc/ld.so.conf.d/x86_64-linux-gnu.micromamba.80-pytorch.conf
1820

1921
$MAMBA_INSTALL -n $MAMBA_DEFAULT_ENV \
2022
ffmpeg="$ffmpeg_version" \
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#!/bin/false
22

33
export MAMBA_CREATE="micromamba create --always-softlink -y -c pytorch -c nvidia -c conda-forge"
4+
env-store MAMBA_CREATE
45
export MAMBA_INSTALL="micromamba install --always-softlink -y -c pytorch -c nvidia -c conda-forge"
5-
printf "export MAMBA_CREATE=\"%s\"\n" "${MAMBA_CREATE}" >> /opt/ai-dock/etc/environment.sh
6-
printf "export MAMBA_INSTALL=\"%s\"\n" "${MAMBA_INSTALL}" >> /opt/ai-dock/etc/environment.sh
7-
8-
cuda_short_version=$(cut -d '.' -f 1,2 <<< "${CUDA_VERSION}")
6+
env-store MAMBA_INSTALL
97

108
# Mamba will downgrade python to satisfy requirements. We don't want that.
119
python_lock="$(micromamba -n $MAMBA_DEFAULT_ENV run python -V | tail -n1 | awk '{print $2}' | cut -d '.' -f1,2)"
1210

1311
$MAMBA_INSTALL -n $MAMBA_DEFAULT_ENV \
1412
pytorch=${PYTORCH_VERSION} torchvision torchaudio \
1513
python=${python_lock} \
16-
pytorch-cuda=${cuda_short_version}
14+
pytorch-cuda="$(cut -d '.' -f 1,2 <<< "${CUDA_VERSION}")"

0 commit comments

Comments
 (0)