"ubuntu-drivers install" needs to be used when installing nvidia-driver if enabling "third-party packages"

Bug #1943816 reported by jeremyszu
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
Critical
Dirk Su
subiquity
New
Undecided
Unassigned
ubiquity (Ubuntu)
New
Undecided
Unassigned
Focal
New
Undecided
Unassigned
ubuntu-drivers-common (Ubuntu)
Fix Released
High
Alberto Milone
Focal
Fix Released
High
Dirk Su

Bug Description

ubiquity calls
```
ubuntu-drivers install $FREEONLY $NOOEM --package-list /run/ubuntu-drivers.autoinstall
```
to generate package list during live system but "ubuntu-drivers install" not only install packages but also create some config files for switching nvidia mode (e.g. on-demand) and change the runtime config as well (e.g. modify the iniramfs).

Thus, not only package list needs to be referred but also the configuration.

---

In ubuntu-drivers-common, which read the "/run/ubuntu-drivers.autoinstall" to install package. It also skipping the nvidia-mode changing (made by ubuntu-drivers install).
```
$ cat ubiquity/target-config/31ubuntu_driver_packages
#!/bin/sh
set -e

# install all packages that "ubuntu-drivers autoinstall" installed into the
# live system. Ubiquity calls this with --package-list /run/ubuntu-drivers.autoinstall

PKGLIST=/run/ubuntu-drivers.autoinstall
[ -e $PKGLIST ] || exit 0

for p in `cat $PKGLIST`; do
    apt-install $p
done
```

---

We need to use a same approach to make sure the nvidia mode is same on a same system (either all handing by ubuntu-drivers install or change the logic to maintainer script in each package).

---

[Impact]

 * According to Nvidia README, the RTD3 (Runtime D3) doesn't support on non-laptop machine
 * Install Ubuntu with "third-party packages" enabled, will not get same
   GPU configuration by running "ubuntu-drivers install"
 * Patch make system not enable RTD3 unless it's a laptop and set default GPU mode to "on-demand"

[Test Plan]

 * Create Focal iso with live-build and import ubuntu-drivers-common from -proposed
 * Install Ubuntu on machine, in "Updates and other software" page select "Install third-party software for graphics and Wi-Fi hardware and additional media formats"
 * On laptop with Nvidia RTD3 supported GPU. The configuration file '/run/nvidia_runtimepm_supported' will be created.
 * Call "prime-select query" to make sure the default mode is "on-demand"

[Where problems could occur]

 * With non-laptop machine use RTD3 supported GPU may use more power

[Other Info]

 * For RTD3 (Runtime D3) doesn't support on non-laptop machine, refer to https://bugs.launchpad.net/oem-priority/+bug/1942788

jeremyszu (os369510)
summary: - "ubuntu-drivers install" needs to be used to install nvidia-driver if
- enabling "third-party packages"
+ "ubuntu-drivers install" needs to be used when installing nvidia-driver
+ if enabling "third-party packages"
Changed in oem-priority:
assignee: nobody → jeremyszu (os369510)
importance: Undecided → Critical
status: New → In Progress
status: In Progress → Confirmed
jeremyszu (os369510)
description: updated
Rex Tsai (chihchun)
tags: added: oem-priority
tags: added: rls-ii-incoming
tags: added: impish
Changed in ubuntu-drivers-common (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
Changed in ubuntu-drivers-common (Ubuntu):
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:0.9.2.2

---------------
ubuntu-drivers-common (1:0.9.2.2) impish; urgency=medium

  * ubuntu-drivers:
    - Enable KMS Wayland if nvidia >= 470. This only affects
      the UDA drivers. This is more effective than checking
      if Wayland is running, since the live image uses X11.
  * UbuntuDrivers/detect.py:
    - Add newline when setting kms.
  * ubiquity/target-config/31ubuntu_driver_packages:
    - Install nvidia-prime, so that we can handle hybrid
      systems, and pick up the NVIDIA driver configuration
      (LP: #1943816).

 -- Alberto Milone <email address hidden> Fri, 08 Oct 2021 15:40:04 +0200

Changed in ubuntu-drivers-common (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
jeremyszu (os369510) wrote (last edit ):

Tested on impish 10/11 daily build
$ sha256sum ~/Downloads/impish-desktop-amd64.iso
b498e92cbc97b8afa1a8a3e92fc87f8124c498500af2c4ca4b55fba4da33d5fe /home/jeremysu/Downloads/impish-desktop-amd64.iso

The ubiquity doesn't call `ubunut-drivers install` to install (at least) nvidia drivers but workaround by copying configurations[1].

It's because calling the "ubuntu-drivers install" might be an unexpected call flow (calls "ubuntu-drivers install" in chroot stage of ubiquity) and the solution may need to change a lot[2]. To implement it will be better in coming release and workaround (by copying configurations) in previous releases.

However, to use "ubuntu-drivers install" is the correct/final way to make sure the logic of selecting/configuring the configurations for proprietary drivers.

I'll suggest to have "jjj/impish/hirsute/focal" series here to make sure we have solution(workaround) for each series (workaround in I/H/F and have the final solution in "jjj(22.04)").

[1] https://github.com/tseliot/ubuntu-drivers-common/blob/master/ubiquity/target-config/31ubuntu_driver_packages#L12
[2] https://chat.canonical.com/canonical/pl/4juqh1kjj7b3fqusznurau4baa

Revision history for this message
Dirk Su (dirksu) wrote :

@Alberto

Could we apply the modification in focal and hirsute?

Revision history for this message
Brian Murray (brian-murray) wrote :

I don't think applying the change to hirsute would actually be useful given that we won't be respinning ISOs for hirsute and users would need to update the ubuntu-drivers-common package from the Live system to get the fix.

tags: removed: rls-ii-incoming
Revision history for this message
Dirk Su (dirksu) wrote :

debdiff for focal

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "ubuntu-drivers-common_0.9.0~0.20.04.3.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Dirk Su (dirksu)
description: updated
Changed in oem-priority:
assignee: jeremyszu (os369510) → Dirk Su (dirksu)
Mathew Hodson (mhodson)
Changed in ubuntu-drivers-common (Ubuntu Focal):
importance: Undecided → High
Dirk Su (dirksu)
description: updated
Changed in ubuntu-drivers-common (Ubuntu Focal):
assignee: nobody → Dirk Su (dirksu)
Revision history for this message
Brian Murray (brian-murray) wrote (last edit ):

The test case in this bug description seems to be about enabling RTD3 on laptops only and not about installing nvidia-prime and calling 'prime-select on-demand'. Please update the bug description so that it will pass review by the SRU team.

Dirk Su (dirksu)
description: updated
Revision history for this message
Dirk Su (dirksu) wrote :

Previous discussion was at https://chat.canonical.com/canonical/pl/1mgrhibwpj8ojxk89tbpztjdar. Due to the design of ubiquity, it only use ubuntu-driver to get package list and install package in 31ubuntu_driver_packages. But ubuntu-driver not only install packages but also create configurations of Nvidia GPU. This patch will copy configurations and calling prime-select to make sure it get same result as calling "ubuntu-driver install" directly.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello jeremyszu, or anyone else affected,

Accepted ubuntu-drivers-common into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1:0.9.0~0.20.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ubuntu-drivers-common (Ubuntu Focal):
status: New → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Dirk Su (dirksu) wrote :

Tested with iso built from live-build and import ubuntu-drivers-common from focal-proposed. After installation finished, check /var/log/installer/syslog can see error log as attachment. It says "ubiquity: chroot: failed to run command ‘prime-select’: No such file or directory", because 31ubuntu_driver_packages is called by target config hook which is run before target install stage. Also tested with 21.10 iso file and will got same error message in log.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

Hello jeremyszu, or anyone else affected,

Accepted ubuntu-drivers-common into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1:0.9.0~0.20.04.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Dirk Su (dirksu) wrote :

Create iso with live-build and import ubuntu-drivers-common 0.9.0~0.20.04.4 from focal-proposed. Install Ubuntu with "third-party packages" enabled. After installation finished, '/run/nvidia_runtimepm_supported' had been created and use 'prime-select query' get 'on-demand'

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:0.9.0~0.20.04.4

---------------
ubuntu-drivers-common (1:0.9.0~0.20.04.4) focal; urgency=medium

  [ Jeremy Szu ]
  * ubiquity/target-config/31ubuntu_driver_packages:
    - Install nvidia-prime in eariler stage (LP: #1943816).

ubuntu-drivers-common (1:0.9.0~0.20.04.3) focal; urgency=medium

  * ubiquity/target-config/31ubuntu_driver_packages:
    - Install nvidia-prime, so that we can handle hybrid
      systems, and pick up the NVIDIA driver configuration
      (LP: #1943816).

ubuntu-drivers-common (1:0.9.0~0.20.04.2) focal; urgency=medium

  [ Alberto Milone ]
  * gpu-manager.c:
    - Enable RTD3 only on laptops (LP: #1942788).

 -- Alberto Milone <email address hidden> Mon, 13 Dec 2021 16:44:37 +0100

Changed in ubuntu-drivers-common (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for ubuntu-drivers-common has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

jeremyszu (os369510)
Changed in oem-priority:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.