Public bug reported:

# HWE kernel upgrade leaves nvidia.ko missing when linux-modules-nvidia
meta is held

**Packages:** ubuntu-drivers-common, linux-restricted-modules-hwe-7.0
**Ubuntu:** 24.04.4 LTS (noble + hwe)
**Driver:** nvidia-driver-595-open 595.84-0ubuntu0.24.04.1 (held)
**Kernels:** linux-image-generic-hwe-24.04 7.0.0-31.31~24.04.1

## Summary

`linux-image-generic-hwe-24.04` installed 7.0.0-31-generic. The matching
prebuilt NVIDIA module package was not installed. Booting 7.0.0-31 gave
`xrandr` `None-1` (simpledrm), `nvidia-smi` unable to talk to the driver.
Booting 7.0.0-30 (which still had nvidia.ko) restored the displays.

There is no Ubuntu `/etc/kernel/postinst.d` hook that installs
`linux-modules-nvidia-$series-$kver` when a new kernel is configured.
The only coupling is the metapackage
`linux-modules-nvidia-595-open-generic-hwe-24.04`. If that meta is held
(typical once a working 595.84 stack is apt-mark hold'ed so a later
driver ABI does not break CUDA / displays), new HWE kernels ship without
nvidia.ko.

## Steps

1. Desktop, NVIDIA only (RTX 3050). Install nvidia-driver-595-open.
2. `apt-mark hold` the 595 stack, including
   `linux-modules-nvidia-595-open-generic-hwe-24.04`
   (this is what users do to keep a working driver).
3. `apt upgrade` pulls `linux-image-7.0.0-31-generic` via the HWE meta.
4. Reboot into 7.0.0-31.

## Expected

Either:

- the matching `linux-modules-nvidia-595-open-7.0.0-31-generic` is
  installed automatically at the ABI that matches the installed
  `nvidia-kernel-common-595`, or
- the HWE kernel image is held until that module package is installable
  without upgrading the held userspace driver.

## Actual

- `linux-modules-nvidia-595-open-7.0.0-31-generic` Installed: (none)
- `/lib/modules/7.0.0-31-generic/**/nvidia.ko` missing
- X starts on simpledrm, one 1024x768 or similar, Disp.A Off

## Second bug: +1 module packages require a newer driver

apt candidate:

    linux-modules-nvidia-595-open-7.0.0-31-generic 7.0.0-31.31~24.04.1+1
        Depends: nvidia-kernel-common-595 (>= 595.91.07)

ABI-matching version for installed 595.84:

    linux-modules-nvidia-595-open-7.0.0-31-generic 7.0.0-31.31~24.04.1
        Depends: nvidia-kernel-common-595 (>= 595.84), (<= 595.84-1)

Unholding the meta and upgrading prefers +1, which wants 595.91. That is
exactly the ABI jump users held the stack to avoid. Ubuntu should pick
the modules version whose nvidia-kernel-common constraint matches the
installed driver, not always Candidate.

## Suggested fix

Ship `/etc/kernel/postinst.d/zz-nvidia-prebuilt-modules` in
ubuntu-drivers-common or nvidia-kernel-common-$SERIES:

    # $1 = new kernel version, runs as root during linux-image postinst
    # 1. If nvidia-kernel-common-N is not installed, exit 0
    # 2. SERIES=N, KVER=$1
    # 3. pkg=linux-modules-nvidia-${SERIES}-open-${KVER}  # or non-open
    # 4. Choose the pkg version whose Depends match installed
    #    nvidia-kernel-common-N (dpkg --compare-versions), not apt Candidate
    # 5. apt-get install -y $pkg=$ver
    # 6. Never fail the kernel package (|| true, log to
    #    /var/log/nvidia-modules-kernel.log)

Do not require the HWE meta to be unheld. Do not upgrade nvidia-driver-*
as a side effect of a kernel install.

I have a working local hook that does this for series 595-open and can
attach it if useful.

Related: LP #2154617 (module package missing from the archive entirely —
different). LP #2129669 (same user-visible result, "install Additional
Drivers").


Related: LP: #2159683

** Affects: ubuntu-drivers-common (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: noble nvidia

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2167617

Title:
  HWE kernel upgrade leaves nvidia.ko missing when linux-modules-nvidia
  meta is held

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/2167617/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to