Ubuntu-drivers utility for installing nvidia gpu drivers does not install linux-modules-extra package

Hi,
I hope I’m posting this topic in the right place, sorry if not! :slight_smile:
We’re in a production environment with Secure Boot enabled. We are installing Ubuntu Server 22.04.2 (kernel 5.15.0-84-generic) and then, at the very first boot after installation, we install nvidia driver for the GPUs present.
We’re following this guide so basically, after the login, we execute these commands

  • apt update
  • ubuntu-drivers install --gpgpu nvidia:535-server (NOTE: kernel is upgraded to a newer version e.g 5.15.0-130-generic)
  • reboot
    If, after reboot, I login into the server nvidia driver is installed correctly but other interfaces (e.g. canbus/ethernet and many others) aren’t available because, as mentioned before, kernel was upgraded but (in this example) linux-modules-extra-5.15.0-130-generic is not installed (because was a suggested package)
ubuntu-drivers --gpgpu install nvidia:535-server
This is gpgpu mode
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libegl-mesa0 libegl1 libepoxy0 libgbm1 libgl1-mesa-dri libglapi-mesa libglx-mesa0 libnvidia-cfg1-535-server libnvidia-common-535-server
  libnvidia-compute-535-server libnvidia-decode-535-server libnvidia-egl-wayland1 libnvidia-encode-535-server libnvidia-extra-535-server
  libnvidia-fbc1-535-server libnvidia-gl-535-server libwayland-client0 libwayland-server0 libxcvt0 libxfont2 linux-image-5.15.0-130-generic
  linux-modules-5.15.0-130-generic linux-modules-nvidia-535-server-5.15.0-130-generic linux-objects-nvidia-535-server-5.15.0-130-generic
  linux-signatures-nvidia-5.15.0-130-generic nvidia-compute-utils-535-server nvidia-firmware-535-server-535.216.03 nvidia-kernel-common-535-server
  nvidia-kernel-source-535-server nvidia-utils-535-server x11-xkb-utils xcvt xfonts-base xfonts-encodings xfonts-utils xserver-common xserver-xorg-core
  xserver-xorg-video-nvidia-535-server
Suggested packages:
  fdutils linux-doc | linux-source-5.15.0 linux-tools linux-headers-5.15.0-130-generic linux-modules-extra-5.15.0-130-generic nvidia-settings nvidia-prime
  xfs | xserver xfonts-100dpi | xfonts-75dpi xfonts-scalable
Recommended packages:
  libnvidia-compute-535-server:i386 libnvidia-decode-535-server:i386 libnvidia-encode-535-server:i386 libnvidia-fbc1-535-server:i386
  libnvidia-gl-535-server:i386
The following NEW packages will be installed:
  libegl-mesa0 libegl1 libepoxy0 libgbm1 libnvidia-cfg1-535-server libnvidia-common-535-server libnvidia-compute-535-server libnvidia-decode-535-server
  libnvidia-egl-wayland1 libnvidia-encode-535-server libnvidia-extra-535-server libnvidia-fbc1-535-server libnvidia-gl-535-server libwayland-client0
  libwayland-server0 libxcvt0 libxfont2 linux-image-5.15.0-130-generic linux-modules-5.15.0-130-generic linux-modules-nvidia-535-server-5.15.0-130-generic
  linux-modules-nvidia-535-server-generic linux-objects-nvidia-535-server-5.15.0-130-generic linux-signatures-nvidia-5.15.0-130-generic
  nvidia-compute-utils-535-server nvidia-driver-535-server nvidia-firmware-535-server-535.216.03 nvidia-kernel-common-535-server
  nvidia-kernel-source-535-server nvidia-utils-535-server x11-xkb-utils xcvt xfonts-base xfonts-encodings xfonts-utils xserver-common xserver-xorg-core
  xserver-xorg-video-nvidia-535-server
The following packages will be upgraded:
  libgl1-mesa-dri libglapi-mesa libglx-mesa0

If, instead, before run ubuntu-drivers install we run apt upgrade everything it’s ok but for tecnical reasons we don’t want to to this → one is that we want to upgrade/install as few packages as possible in production.
Now, to fix this, we “manually” install linux-image-generic after ubuntu-drivers install

apt show linux-image-generic
Package: linux-image-generic
Version: 5.15.0.130.129
Priority: optional
Section: kernel
Source: linux-meta
Origin: Ubuntu
Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 21.5 kB
Provides: spl-modules (= 2.1.5-1ubuntu6~22.04.4), v4l2loopback-modules (= 0.12.7-2ubuntu2~22.04.1), virtualbox-guest-modules (= 5.15.0-131), wireguard-modules (= 1.0.0), zfs-modules (= 2.1.5-1ubuntu6~22.04.4)
Depends: linux-image-5.15.0-130-generic, linux-modules-extra-5.15.0-130-generic, linux-firmware, intel-microcode, amd64-microcode
Recommends: thermald
Download-Size: 2,524 B
APT-Sources: http://it.archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
Description: Generic Linux kernel image
 This package will always depend on the latest generic kernel image
 available.

So, my question are

  1. are we doing the correct steps to install nvidia driver?
  2. if so, is this a bug in ubuntu-drivers utility and/or there are issues in packages dependencies?

NOTE: if there is something not clear, please tell me!

BR
Enrico

You should always use the linux-generic metapackage, it depends on linux-image-generic (and the matching -headers-generic )

@ogra thanks!
So we’ve to do this

  • apt update
  • ubuntu-drivers install --gpgpu nvidia:535-server (NOTE: kernel is upgraded to a newer version e.g 5.15.0-130-generic)
  • apt install linux-generic
  • reboot

Right?
Is it described somewhere that you also need to install linux-generic metapackage? I didn’t find it in the documentation.
BR
Enrico

The installer installs it by default so there is usually no need to separately install it, which is likely why there is no docs talking about it …

Thanks a lot @ogra , now everything is clearer.
BR
Enrico