Repository navigation
Fix mismatch on module names for updates - #610
Merged
Merged
Conversation
When a new version is installed, the old version transitions to state
"built" rather than "installed". However it relies on the new version
overwriting the exact same modules.
When the compression from the new and old modules diverge, this leads to
very odd outcomes with both versions installed in /updates. When depmod
executes, there's no priority handling since both modules are in the
same dir, so it basically favors the order it walks the tree (i.e. it's
random).
Fix it by removing modules with the same name regardless of compression
suffix. This should fix the worst case, with modules with the same name.
However we may need to reconsider this and just actively uninstall
modules with the same version. Example of problematic situation:
foobar/1.1.1:
- foobar.ko
foobar/2.0.0:
- foobar-common.ko
- foobar-platform1.ko
- foobar-platform2.ko
This can be done later, on top.
Signed-off-by: Lucas De Marchi <ldemarchi@nvidia.com>
Before: installing a new version of dkms modules already installed in
the system could leave kernel modules behind if the new kernel module
names don't match the old ones.
The below are logs for the NVIDIA kernel modules being installed on
openSUSE 16 (fictitious versions though):
$ sudo dkms install nvidia/595.71.09
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-modeset.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-drm.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-uvm.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-peermem.ko.zst
Running depmod... done.
$ sudo dkms install nvidia/615.0.0
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia.ko
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-modeset.ko
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-drm.ko
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-peermem.ko
Running depmod... done.
The old nvidia-uvm.ko.zst belonging to the previous version would
remain in the tree since it's not part of the new dkms installation.
To fix this, explicitly uninstall the old version, leading to:
$ sudo dkms install nvidia/595.71.09
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-modeset.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-drm.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-uvm.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-peermem.ko.zst
Running depmod... done.
$ sudo dkms install nvidia/615.0.0
Module nvidia/595.71.09 for kernel 6.12.0-160000.37-default (x86_64):
Before uninstall, this module version was ACTIVE on this kernel.
Deleting /lib/modules/6.12.0-160000.37-default/updates/nvidia.ko.zst
Deleting /lib/modules/6.12.0-160000.37-default/updates/nvidia-modeset.ko.zst
Deleting /lib/modules/6.12.0-160000.37-default/updates/nvidia-drm.ko.zst
Deleting /lib/modules/6.12.0-160000.37-default/updates/nvidia-uvm.ko.zst
Deleting /lib/modules/6.12.0-160000.37-default/updates/nvidia-peermem.ko.zst
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia.ko
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-vgpu-vfio.ko
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-modeset.ko
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-drm.ko
Installing /lib/modules/6.12.0-160000.37-default/updates/nvidia-peermem.ko
Running depmod... done.
The sanity check for not installing an older version is kept as is.
Signed-off-by: Lucas De Marchi <ldemarchi@nvidia.com>
scaronni
requested review from
anbe42 and
scaronni
and removed request for
anbe42
October 5, 2026 08:01
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.