Skip to content

Commit c292018

Browse files
authored
Set LD_LIBRARY_PATH and ldconfig (#1545)
Needed for PyTorch b/485275559
1 parent 82c5c43 commit c292018

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Dockerfile.tmpl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,12 @@ ENV GIT_COMMIT=${GIT_COMMIT} \
158158
RUN echo "$GIT_COMMIT" > /etc/git_commit && echo "$BUILD_DATE" > /etc/build_date
159159

160160
{{ if eq .Accelerator "gpu" }}
161-
# Add the CUDA home.
162-
ENV CUDA_HOME=/usr/local/cuda
161+
# Add the CUDA home and ensure NVIDIA driver libs (mounted by the NVIDIA Container
162+
# Toolkit at runtime into /usr/local/nvidia/lib64) are on the library path.
163+
ENV CUDA_HOME=/usr/local/cuda \
164+
LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
165+
# Register the NVIDIA driver lib path with the dynamic linker so libraries can
166+
# be found even without LD_LIBRARY_PATH being set.
167+
RUN echo '/usr/local/nvidia/lib64' > /etc/ld.so.conf.d/nvidia-driver.conf && ldconfig 2>/dev/null || true
163168
{{ end }}
164169
ENTRYPOINT ["/usr/bin/env"]

0 commit comments

Comments
 (0)