nvidia drivers do not update initramfs properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-restricted-modules (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Bionic |
New
|
Undecided
|
Unassigned | ||
Focal |
New
|
Undecided
|
Unassigned | ||
Hirsute |
New
|
Undecided
|
Unassigned | ||
Impish |
Won't Fix
|
Undecided
|
Unassigned | ||
nvidia-graphics-drivers-470 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Bionic |
New
|
Undecided
|
Unassigned | ||
Focal |
New
|
Undecided
|
Unassigned | ||
Hirsute |
Won't Fix
|
Undecided
|
Unassigned | ||
Impish |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
When Nvidia drivers are installing, they are only rebuilding the initramfs for the currently running kernel and/or the newest kernel when installed. Unfortunately, that means that if one has two kernel flavors installed (such as -generic and -lowlatency) this means that the initramfs is only getting rebuild for the currently installed kernel flavor and its newest version. When a user then switches to the other kernel flavor, their video fails because the kernel they switched to does not have the kernel module in the initramfs despite the kernel module being compiled and available.
The root cause seems to be in nvidia-
# Update initramfs so that the blacklist ends up in the initramfs
if [ -x /usr/sbin/
if [ -n "$NEWEST_KERNEL" ] && [ ${CURRENT_KERNEL} != ${NEWEST_KERNEL} ]; then
# This can fail when dealing with a chroot see LP: #556653
fi
fi
Instead of looking for the conditions to be met, this should be rebuilding for *all* installed kernels, despite the longer amount of time needed to do so in some cases. The rationale is that systems should work as expected and saving time, in this case, can cause that not to happen. As such the postinst scripts should do the following in lieu of the above:
/usr/
This ensures that all installed kernel initramfs images get rebuilt, which adds increased safety at the expense of speed during the install. This will also prevent a race condition where, if a kernel and the nvidia driver are updated at the same time, that the proper initramfs image will exist despite which order the nvidia driver and kernel get installed.
ProblemType: Bug
DistroRelease: Ubuntu 21.10
Package: nvidia-driver-470 470.74-0ubuntu1
ProcVersionSign
Uname: Linux 5.13.0-
NonfreeKernelMo
ApportVersion: 2.20.11-0ubuntu70
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: KDE
Date: Wed Oct 13 13:12:23 2021
InstallationDate: Installed on 2021-03-20 (206 days ago)
InstallationMedia: Ubuntu-Studio 21.04 "Hirsute Hippo" - Alpha amd64 (20210320)
SourcePackage: nvidia-
UpgradeStatus: Upgraded to impish on 2021-06-13 (122 days ago)
Why are you using dkms modules, instead of signed lrm modules?