Skip to content

Commit

Permalink
[ubuntu24.04] only install required driver packages
Browse files Browse the repository at this point in the history
Signed-off-by: Tariq Ibrahim <[email protected]>
  • Loading branch information
tariq1890 committed Jan 11, 2025
1 parent c368199 commit 117f021
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
4 changes: 3 additions & 1 deletion ubuntu24.04/precompiled/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ RUN if [ -n "${CVE_UPDATES}" ]; then \
fi

# update pkg cache and install pkgs for userspace driver libs
RUN apt-get update && apt-get install -y --download-only --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server \
RUN apt-get update && apt-get install -y --download-only --no-install-recommends \
nvidia-utils-${DRIVER_BRANCH}-server=${DRIVER_VERSION}-1 \
nvidia-compute-utils-${DRIVER_BRANCH}-server=${DRIVER_VERSION}-1 \
nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \
libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 && \
rm -rf /var/lib/apt/lists/*;
Expand Down
11 changes: 3 additions & 8 deletions ubuntu24.04/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,9 @@ _unload_driver() {
# Link and install the kernel modules from a precompiled packages
_install_driver() {
# Install necessary driver userspace packages
apt-get install -y --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server

# Uninstall unnecessary packages installed as a part of the nvidia-driver-${DRIVER_BRANCH}-server package
apt-get purge -y \
libnvidia-egl-wayland1 \
nvidia-dkms-${DRIVER_BRANCH}-server \
nvidia-kernel-source-${DRIVER_BRANCH}-server \
xserver-xorg-video-nvidia-${DRIVER_BRANCH}-server
apt-get install -y --no-install-recommends \
nvidia-utils-${DRIVER_BRANCH}-server=${DRIVER_VERSION}-1 \
nvidia-compute-utils-${DRIVER_BRANCH}-server=${DRIVER_VERSION}-1

# Now install the precompiled kernel module packages signed by Canonical
if [ "$OPEN_KERNEL_MODULES_ENABLED" = true ]; then
Expand Down

0 comments on commit 117f021

Please sign in to comment.