Skip to content

Commit

Permalink
Update to the NVIDIA Dockerfile. Replaces the currently unavailable n…
Browse files Browse the repository at this point in the history
…vidia-smi with libnvidia-ml1.

Fixed: b/389873888

Change-Id: I6a20a87145f28a1485fb64eacbf282a1f3f39c52
  • Loading branch information
krzys-ostrowski committed Jan 15, 2025
1 parent 08c1b42 commit 82caf8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ SYSROOT_SHA256 = "d6f608cf14b27bd4ae68f135b601b86bb9157a1a7a8fc08e43d7ff4ab7a186

BASE_IMAGE_SHA256 = "f539ecab633fa0a760ec49e917a0719f2d3ffc1eb6fe7853d518d17699fa035e"

NVIDIA_BASE_IMAGE_SHA256 = "ba7f59ebfc71c54c90a54e508dc2acb58d1bd55606d57aa7c771d1cf67dc61f2"
NVIDIA_BASE_IMAGE_SHA256 = "10e665a269b79aef1e12a45a60abd1bf4638edae3bad0c41cec764ceacbfe0a9"

# Experimental sysroot for the build toolchain, based on Oak Containers sysimage.
#
Expand Down
8 changes: 5 additions & 3 deletions oak_containers/system_image/base/nvidia_base_image.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ RUN curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | gpg --dearm
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
tee /etc/apt/sources.list.d/nvidia-container-toolkit.list

# Skips nvidia-smi as it's not available for the latest version of the driver.
# Includes libnvidia-ml1 as the underlying library that provides NVML APIs.
RUN apt-get --yes update \
&& apt-get install --yes --no-install-recommends \
nvidia-driver nvidia-smi \
nvidia-driver libnvidia-ml1 \
libcuda1 nvidia-container-toolkit \
# Stuff to build kernel (will be purged later, see below)
libc6-dev flex bison build-essential bc cpio libncurses5-dev libelf-dev libssl-dev dwarves debhelper-compat rsync \
Expand All @@ -44,8 +46,8 @@ RUN tar --directory=/tmp --extract --file /tmp/linux-${LINUX_KERNEL_VERSION}.tar
&& cp /tmp/minimal.config /tmp/linux-${LINUX_KERNEL_VERSION}/.config \
&& make --directory=/tmp/linux-${LINUX_KERNEL_VERSION} -j"$(nproc)" bindeb-pkg \
&& dpkg --install /tmp/linux-headers-${LINUX_KERNEL_VERSION}_${LINUX_KERNEL_VERSION}-1_amd64.deb \
&& dkms build -m nvidia-current -v "$(dpkg-query --showformat='${source:Upstream-Version}' --show nvidia-driver)" -k ${LINUX_KERNEL_VERSION} \
&& dkms install -m nvidia-current -v "$(dpkg-query --showformat='${source:Upstream-Version}' --show nvidia-driver)" -k ${LINUX_KERNEL_VERSION} \
&& dkms build -m nvidia -v "$(dpkg-query --showformat='${source:Upstream-Version}' --show nvidia-driver)" -k ${LINUX_KERNEL_VERSION} \
&& dkms install -m nvidia -v "$(dpkg-query --showformat='${source:Upstream-Version}' --show nvidia-driver)" -k ${LINUX_KERNEL_VERSION} \
&& rm -rf /tmp/linux-${LINUX_KERNEL_VERSION} /tmp/linux-${LINUX_KERNEL_VERSION}.tar.xz /tmp/minimal.config \
&& apt-get --yes purge libc6-dev flex bison build-essential bc cpio libncurses5-dev libelf-dev libssl-dev dwarves debhelper-compat rsync \
&& apt-get --yes autoremove
Expand Down

0 comments on commit 82caf8d

Please sign in to comment.