Skip to content

Commit d55f27a

Browse files
committed
Fix cpu and gpu builds
1 parent 94d2552 commit d55f27a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Dockerfile.tmpl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ RUN pip uninstall -y horovod && \
7474
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
7575
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
7676

77-
# Use a fixed apt-get repo to stop intermittent failures due to flaky httpredir connections,
77+
# Use a fixed repo to stop intermittent failures due to flaky httpredir connections,
7878
# as described by Lionel Chan at http://stackoverflow.com/a/37426929/5881346
7979
RUN sed -i "s/httpredir.debian.org/debian.uchicago.edu/" /etc/apt/sources.list && \
8080
apt-get update && \
@@ -163,7 +163,9 @@ RUN pip install spacy && \
163163
{{ if eq .Accelerator "gpu" }}
164164
# Install GPU-only packages
165165
# No specific package for nnabla-ext-cuda 11.x minor versions.
166-
RUN pip install pycuda \
166+
RUN export PATH=/usr/local/cuda/bin:$PATH && \
167+
export CUDA_ROOT=/usr/local/cuda && \
168+
pip install pycuda \
167169
pynvrtc \
168170
pynvml && \
169171
/tmp/clean-layer.sh
@@ -637,7 +639,11 @@ RUN sed -i '/from tensorflow_hub import uncompressed_module_resolver/a from tens
637639
# python -m nb_conda_kernels.install --disable
638640

639641
# Force only one libcusolver
642+
{{ if eq .Accelerator "gpu" }}
640643
RUN rm /opt/conda/bin/../lib/libcusolver.so.11 && ln -s /usr/local/cuda/lib64/libcusolver.so.11 /opt/conda/bin/../lib/libcusolver.so.11
644+
{{ else }}
645+
RUN ln -s /usr/local/cuda/lib64/libcusolver.so.11 /opt/conda/bin/../lib/libcusolver.so.11
646+
{{ end }}
641647

642648
# b/270147159 conda ships with a version of libtinfo which is missing version info causing warnings, replace it with a good version.
643649
RUN rm /opt/conda/lib/libtinfo.so.6 && ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /opt/conda/lib/libtinfo.so.6

0 commit comments

Comments
 (0)