Skip to content

Commit 070e32e

Browse files
committed
fix precompiled driver container failures when enabling OpenRM
Signed-off-by: Tariq Ibrahim <[email protected]>
1 parent 6b78622 commit 070e32e

File tree

4 files changed

+70
-12
lines changed

4 files changed

+70
-12
lines changed

ubuntu22.04/precompiled/Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,9 @@ RUN if [ -n "${CVE_UPDATES}" ]; then \
4949
fi
5050

5151
# update pkg cache and install pkgs for userspace driver libs
52-
RUN apt-get update && apt-get install -y --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server \
52+
RUN apt-get update && apt-get install -y --download-only --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server \
5353
nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \
5454
libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 && \
55-
apt-get purge -y \
56-
libnvidia-egl-wayland1 \
57-
nvidia-dkms-${DRIVER_BRANCH}-server \
58-
nvidia-kernel-source-${DRIVER_BRANCH}-server \
59-
xserver-xorg-video-nvidia-${DRIVER_BRANCH}-server && \
6055
rm -rf /var/lib/apt/lists/*;
6156

6257
# update pkg cache and download pkgs for driver module installation during runtime.

ubuntu22.04/precompiled/nvidia-driver

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,25 @@ _load_driver() {
101101
echo "Parsing kernel module parameters..."
102102
_get_module_params
103103

104+
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
105+
local set_fw_path="true"
106+
local fw_path_config_file="/sys/module/firmware_class/parameters/path"
107+
for param in "${NVIDIA_MODULE_PARAMS[@]}"; do
108+
if [[ "$param" == "NVreg_EnableGpuFirmware=0" ]]; then
109+
set_fw_path="false"
110+
fi
111+
done
112+
113+
if [[ "$set_fw_path" == "true" ]]; then
114+
echo "Configuring the following firmware search path in '$fw_path_config_file': $nv_fw_search_path"
115+
if [[ ! -z $(grep '[^[:space:]]' $fw_path_config_file) ]]; then
116+
echo "WARNING: A search path is already configured in $fw_path_config_file"
117+
echo " Retaining the current configuration"
118+
else
119+
echo -n "$nv_fw_search_path" > $fw_path_config_file || echo "WARNING: Failed to configure firmware search path"
120+
fi
121+
fi
122+
104123
echo "Loading ipmi and i2c_core kernel modules..."
105124
modprobe -a i2c_core ipmi_msghandler ipmi_devintf
106125

@@ -124,6 +143,10 @@ _load_driver() {
124143

125144
DRIVER_VERSION=$(nvidia-smi -q | grep "Driver Version" | awk -F: '{print $2}' | xargs)
126145
if _assert_nvswitch_system; then
146+
echo "Installing NVIDIA fabric manager and libnvidia NSCQ packages..."
147+
apt-get install -y --no-install-recommends \
148+
nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \
149+
libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1
127150

128151
echo "Starting NVIDIA fabric manager daemon..."
129152
nv-fabricmanager -c /usr/share/nvidia/nvswitch/fabricmanager.cfg
@@ -211,6 +234,17 @@ _unload_driver() {
211234

212235
# Link and install the kernel modules from a precompiled packages
213236
_install_driver() {
237+
# Install necessary userspace, fabric manager and libnvidia-nscq packages
238+
apt-get install -y --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server
239+
240+
# Uninstall unnecessary packages installed as a part of the nvidia-driver-${DRIVER_BRANCH}-server package
241+
apt-get purge -y \
242+
libnvidia-egl-wayland1 \
243+
nvidia-dkms-${DRIVER_BRANCH}-server \
244+
nvidia-kernel-source-${DRIVER_BRANCH}-server \
245+
xserver-xorg-video-nvidia-${DRIVER_BRANCH}-server
246+
247+
# Now install the precompiled kernel module packages signed by Canonical
214248
if [ "$OPEN_KERNEL_MODULES_ENABLED" = true ]; then
215249
echo "Installing Open NVIDIA driver kernel modules..."
216250
apt-get install --no-install-recommends -y \

ubuntu24.04/precompiled/Dockerfile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,9 @@ RUN if [ -n "${CVE_UPDATES}" ]; then \
4141
fi
4242

4343
# update pkg cache and install pkgs for userspace driver libs
44-
RUN apt-get update && apt-get install -y --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server \
44+
RUN apt-get update && apt-get install -y --download-only --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server \
4545
nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \
4646
libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 && \
47-
apt-get purge -y \
48-
libnvidia-egl-wayland1 \
49-
nvidia-dkms-${DRIVER_BRANCH}-server \
50-
nvidia-kernel-source-${DRIVER_BRANCH}-server \
51-
xserver-xorg-video-nvidia-${DRIVER_BRANCH}-server && \
5247
rm -rf /var/lib/apt/lists/*;
5348

5449
# update pkg cache and download pkgs for driver module installation during runtime.

ubuntu24.04/precompiled/nvidia-driver

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,25 @@ _load_driver() {
101101
echo "Parsing kernel module parameters..."
102102
_get_module_params
103103

104+
local nv_fw_search_path="$RUN_DIR/driver/lib/firmware"
105+
local set_fw_path="true"
106+
local fw_path_config_file="/sys/module/firmware_class/parameters/path"
107+
for param in "${NVIDIA_MODULE_PARAMS[@]}"; do
108+
if [[ "$param" == "NVreg_EnableGpuFirmware=0" ]]; then
109+
set_fw_path="false"
110+
fi
111+
done
112+
113+
if [[ "$set_fw_path" == "true" ]]; then
114+
echo "Configuring the following firmware search path in '$fw_path_config_file': $nv_fw_search_path"
115+
if [[ ! -z $(grep '[^[:space:]]' $fw_path_config_file) ]]; then
116+
echo "WARNING: A search path is already configured in $fw_path_config_file"
117+
echo " Retaining the current configuration"
118+
else
119+
echo -n "$nv_fw_search_path" > $fw_path_config_file || echo "WARNING: Failed to configure firmware search path"
120+
fi
121+
fi
122+
104123
echo "Loading ipmi and i2c_core kernel modules..."
105124
modprobe -a i2c_core ipmi_msghandler ipmi_devintf
106125

@@ -124,6 +143,10 @@ _load_driver() {
124143

125144
DRIVER_VERSION=$(nvidia-smi -q | grep "Driver Version" | awk -F: '{print $2}' | xargs)
126145
if _assert_nvswitch_system; then
146+
echo "Installing NVIDIA fabric manager and libnvidia NSCQ packages..."
147+
apt-get install -y --no-install-recommends \
148+
nvidia-fabricmanager-${DRIVER_BRANCH}=${DRIVER_VERSION}-1 \
149+
libnvidia-nscq-${DRIVER_BRANCH}=${DRIVER_VERSION}-1
127150

128151
echo "Starting NVIDIA fabric manager daemon..."
129152
nv-fabricmanager -c /usr/share/nvidia/nvswitch/fabricmanager.cfg
@@ -211,6 +234,17 @@ _unload_driver() {
211234

212235
# Link and install the kernel modules from a precompiled packages
213236
_install_driver() {
237+
# Install necessary driver userspace packages
238+
apt-get install -y --no-install-recommends nvidia-driver-${DRIVER_BRANCH}-server
239+
240+
# Uninstall unnecessary packages installed as a part of the nvidia-driver-${DRIVER_BRANCH}-server package
241+
apt-get purge -y \
242+
libnvidia-egl-wayland1 \
243+
nvidia-dkms-${DRIVER_BRANCH}-server \
244+
nvidia-kernel-source-${DRIVER_BRANCH}-server \
245+
xserver-xorg-video-nvidia-${DRIVER_BRANCH}-server
246+
247+
# Now install the precompiled kernel module packages signed by Canonical
214248
if [ "$OPEN_KERNEL_MODULES_ENABLED" = true ]; then
215249
echo "Installing Open NVIDIA driver kernel modules..."
216250
apt-get install --no-install-recommends -y \

0 commit comments

Comments
 (0)