Skip to content

Commit 3fef154

Browse files
Put nvidia-smi on path for cuda image variants (#2124)
* Put nvidia-smi on path for cuda image variants * Improve comments style --------- Co-authored-by: Ayaz Salikhov <[email protected]>
1 parent 37c03eb commit 3fef154

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

Diff for: images/pytorch-notebook/cuda11/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index
2323
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#dockerfiles
2424
ENV NVIDIA_VISIBLE_DEVICES all
2525
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
26+
27+
# Puts the nvidia-smi binary (system management interface) on path
28+
# with associated library files to execute it
29+
ENV PATH=${PATH}:/usr/local/nvidia/bin
30+
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64

Diff for: images/pytorch-notebook/cuda12/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ RUN pip install --no-cache-dir --extra-index-url=https://pypi.nvidia.com --index
2323
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#dockerfiles
2424
ENV NVIDIA_VISIBLE_DEVICES all
2525
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
26+
27+
# Puts the nvidia-smi binary (system management interface) on path
28+
# with associated library files to execute it
29+
ENV PATH=${PATH}:/usr/local/nvidia/bin
30+
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64

Diff for: images/tensorflow-notebook/cuda/Dockerfile

+5
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ COPY --chown="${NB_UID}:${NB_GID}" nvidia-lib-dirs.sh "${CONDA_DIR}/etc/conda/ac
2525
# https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/docker-specialized.html#dockerfiles
2626
ENV NVIDIA_VISIBLE_DEVICES="all" \
2727
NVIDIA_DRIVER_CAPABILITIES="compute,utility"
28+
29+
# Puts the nvidia-smi binary (system management interface) on path
30+
# with associated library files to execute it
31+
ENV PATH=${PATH}:/usr/local/nvidia/bin
32+
ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/nvidia/lib64

Diff for: images/tensorflow-notebook/cuda/nvidia-lib-dirs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Copyright (c) Jupyter Development Team.
33
# Distributed under the terms of the Modified BSD License.
44

5-
# This adds the NVIDIA libraries to the LD_LIBRARY_PATH. Workaround for
6-
# https://github.com/tensorflow/tensorflow/issues/63362
5+
# This adds NVIDIA Python package libraries to the LD_LIBRARY_PATH.
6+
# Workaround for https://github.com/tensorflow/tensorflow/issues/63362
77
NVIDIA_DIR=$(dirname "$(python -c 'import nvidia;print(nvidia.__file__)')")
88
LD_LIBRARY_PATH=$(echo "${NVIDIA_DIR}"/*/lib/ | sed -r 's/\s+/:/g')${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
99
export LD_LIBRARY_PATH

0 commit comments

Comments
 (0)