Skip to content

Commit

Permalink
[ubuntu-precompiled] 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 Feb 7, 2025
1 parent da308fd commit bf3be41
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
5 changes: 4 additions & 1 deletion ubuntu22.04/precompiled/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ 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 \
nvidia-compute-utils-${DRIVER_BRANCH}-server \
libnvidia-cfg1-${DRIVER_BRANCH}-server \
nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \
libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 && \
rm -rf /var/lib/apt/lists/*;
Expand Down
14 changes: 5 additions & 9 deletions ubuntu22.04/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,11 @@ _unload_driver() {

# Link and install the kernel modules from a precompiled packages
_install_driver() {
# Install necessary userspace, fabric manager and libnvidia-nscq 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
# Install necessary driver userspace packages
apt-get install -y --no-install-recommends \
nvidia-utils-${DRIVER_BRANCH}-server \
nvidia-compute-utils-${DRIVER_BRANCH}-server \
libnvidia-cfg1-${DRIVER_BRANCH}-server

# Now install the precompiled kernel module packages signed by Canonical
if [ "$OPEN_KERNEL_MODULES_ENABLED" = true ]; then
Expand Down
5 changes: 4 additions & 1 deletion ubuntu24.04/precompiled/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ 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 \
nvidia-compute-utils-${DRIVER_BRANCH}-server \
libnvidia-cfg1-${DRIVER_BRANCH}-server \
nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \
libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 && \
rm -rf /var/lib/apt/lists/*;
Expand Down
12 changes: 4 additions & 8 deletions ubuntu24.04/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,10 @@ _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 \
nvidia-compute-utils-${DRIVER_BRANCH}-server \
libnvidia-cfg1-${DRIVER_BRANCH}-server

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

0 comments on commit bf3be41

Please sign in to comment.