[SRU] Support to install nvidia driver by allowing list

Bug #1990341 reported by jeremyszu
26
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OEM Priority Project
Triaged
High
Dirk Su
ubuntu-drivers-common (Ubuntu)
Fix Released
High
Unassigned
Jammy
Confirmed
Undecided
Unassigned
Lunar
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

 * In NVIDIA new GPU release cycle, NVIDIA ships their new GPUs to OEM/ODM for production.

In the meantime, NVIDIA usually notify OEM/ODM/Canonical (under NDA) to use a specific nvidia version to development/production.

NVIDIA and OEN/ODM will announce the next generation combination at the same time usually when the factory ready to ship the product.

We made Ubuntu as a leading distribution supports many cutting edge devices, it's time to have an official way to make the nvidia installation consistent in unannounced (yet) nvidia devices to support OEM/ODM factory shipment for our growing counterparts.

[ Test Plan ]

 * Steps to make sure it works:

1. pick a cutting edge nvidia graphic.
2. remove nv-525 from the pool by removing restricted in jammy-updates and jammy-security
3. check the nv support status:
```
$ ubuntu-drivers list
oem-fix-gfx-nvidia-ondemandmode
libfprint-2-tod1-broadcom
oem-somerville-cinccino-meta
```
4. modify custom file
```
$ cat /etc/custom_supported_gpus.json
{
  "chips": [
    {
      "devid": "0x24BA",
      "name": "TEST 24BA",
      "branch": "580.1234",
      "features": [
        "runtimepm"
      ]
    },
    {
      "devid": "0x25BC",
      "name": "TEST 25BC",
      "branch": "510",
      "features": [
        "runtimepm"
      ]
    }
  ]
}
```
5. make sure the hook works
```
$ ubuntu-drivers list
nvidia-driver-510, (kernel modules provided by nvidia-dkms-510)
oem-fix-gfx-nvidia-ondemandmode
libfprint-2-tod1-broadcom
oem-somerville-cinccino-meta

[ Where problems could occur ]

 * This feature only impact target system has a custom file "/etc/custom_supported_gpus.json". And it won't generate automatically which should not impact normal users

[ Other Info ]

 * the patches are picked from
   - https://github.com/tseliot/ubuntu-drivers-common/commit/ec675fba22c68932da9fae95e0f4f2fd10732bf3
   - https://github.com/tseliot/ubuntu-drivers-common/commit/4776c6b9f78411ef3b269a28e9546e4ffd2b7115
   - https://github.com/tseliot/ubuntu-drivers-common/commit/83528313da84b55c04daa62b5edcbf823e5c067b.
 * Discussion is in https://github.com/tseliot/ubuntu-drivers-common/pull/71

jeremyszu (os369510)
tags: added: oem-priority
Changed in oem-priority:
assignee: nobody → jeremyszu (os369510)
importance: Undecided → High
status: New → Confirmed
jeremyszu (os369510)
Changed in oem-priority:
status: Confirmed → In Progress
Revision history for this message
jeremyszu (os369510) wrote :

build log

description: updated
Revision history for this message
jeremyszu (os369510) wrote :
description: updated
jeremyszu (os369510)
description: updated
description: updated
jeremyszu (os369510)
description: updated
description: updated
description: updated
description: updated
Changed in oem-priority:
status: In Progress → Incomplete
Revision history for this message
Brian Murray (brian-murray) wrote :

Feature Freeze Exceptions are for the development release of Ubuntu and only necessary after Feature Freeze which for the Lunar Lobster is February 23th. Is this feature change intended for Lunar?

Changed in ubuntu-drivers-common (Ubuntu):
status: New → Incomplete
Revision history for this message
Alberto Milone (albertomilone) wrote :

@Brian, no, there was a misunderstanding, and this was not meant for Lunar. Please unsubscribe the Release team, as I can't seem to be able to do it.

Revision history for this message
jeremyszu (os369510) wrote :

The original schedule of this feature hopes could be in last year.
Unfortunately, I've no time to cook this in previous months.
This ticket should be converted to a SRU ticket now.

Sorry for the noise.

summary: - [FeatureFreeze Exceptions] Support to install nvidia driver by allowing
- list
+ [Draft][SRU] Support to install nvidia driver by allowing list
Changed in oem-priority:
status: Incomplete → Confirmed
jeremyszu (os369510)
description: updated
summary: - [Draft][SRU] Support to install nvidia driver by allowing list
+ [SRU] Support to install nvidia driver by allowing list
Revision history for this message
Dirk Su (dirksu) wrote :

Add patch to support install nvidia driver by allowing list

Changed in oem-priority:
assignee: jeremyszu (os369510) → Dirk Su (dirksu)
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "force_install_NVIDIA_driver-jammy.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
Revision history for this message
Sebastien Bacher (seb128) wrote :

@Dirk, are you sure you attached the right changeset? The patch is adding autopkgtest to the package. Also such changes should be submitted against the upstream project for review on https://github.com/tseliot/ubuntu-drivers-common/pulls

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

Found that debdiff in #6 is buggy. Upload the modified debdiff

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

The issue is fixed in Lunar and newer so closing the main task. Technically we should SRU to kinetic before jammy but it's probably fine to skip that serie at this point

Changed in ubuntu-drivers-common (Ubuntu):
importance: Undecided → High
status: Incomplete → Fix Released
Revision history for this message
Sebastien Bacher (seb128) wrote :

I've added the bug reference to the changelog which is required by the SRU process and uploaded now

Andy Chi (andch)
Changed in ubuntu-drivers-common (Ubuntu Lunar):
status: New → Fix Released
Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: New → Fix Committed
Revision history for this message
Simon Chopin (schopin) wrote :

Hi,

Thanks for your contribution. Since Kinetic is going to be skipped and the Jammy debdiff has been uploaded, I'm unsubscribing ubuntu-sponsors from this bug. Feel free to re-subscribe the team should the need arise.

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

Reading the description in the changelog did not tell me why this was appropriate for SRU.

+ - Add support for force installing the NVIDIA driver on unsupported
+ devices. (lp: #1990341)

You can obviously force install nvidia drivers on any device by using apt.

What this feature addition is actually about is allowing OEMs to locally extend the mapping of PCI IDs to drivers in a custom image. That's very different than what I understood from the changelog.

Changelog entries for SRUs are much more visible to users than changelog entries in devel, and while they will often be technical and not understood by all users, I think it's important that they at least be accurate.

I'm not rejecting this SRU, but I would like to see it reuploaded with a clearer changelog entry.

Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: Fix Committed → Incomplete
Revision history for this message
Dirk Su (dirksu) wrote :

Based on the suggestion in #14, update the changelog to make the update more clearly for the use

  [ Jeremy Szu ]
  * README, README.md,
    UbuntuDrivers/detect.py,
    tests/test_ubuntu_drivers.py:
    - Let OEM image can locally extending the NVIDIA driver
      supported PCI IDs for cutting edge silicons by specifying
      related information in /etc/custom_supported_gpus.json file.
      (lp: #1990341)
    - Support autopkgtest for force install Nvidia and update
      related section in README.

Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: Incomplete → In Progress
Revision history for this message
Dirk Su (dirksu) wrote :

Update debdiff based on the newly released ubuntu-drivers-common-0.9.6.2~0.22.04.4

Dirk Su (dirksu)
Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: In Progress → Confirmed
Revision history for this message
Julian Andres Klode (juliank) wrote (last edit ):

There seem to be an unrelated change in the debdiff that are not mentioned in the changelog or in the bug, the _is_runtimepm_supported() rework to use apt_pkg.DepCache rather than the high-level apt API.

So I am unsubscribing ubuntu-sponsors as that needs more information.

Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: Confirmed → Invalid
status: Invalid → Incomplete
Revision history for this message
Dirk Su (dirksu) wrote (last edit ):

Update changelog to document the apt_pkg.DepCache in _is_runtimepm_supported. Related discussion is at https://github.com/tseliot/ubuntu-drivers-common/pull/71/commits/025cce328b9909f3f421376be35cb34511b9ea2e#r884846872

  [ Jeremy Szu ]
  * README, README.md,
    UbuntuDrivers/detect.py,
    tests/test_ubuntu_drivers.py:
    - Let OEM image can locally extending the NVIDIA driver
      supported PCI IDs for cutting edge silicons by specifying
      related information in /etc/custom_supported_gpus.json file.
      (lp: #1990341)
    - Fix pkg.candidate.record retired from apt_pkg library
    - Support autopkgtest for force install Nvidia and update
      related section in README.

Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: Incomplete → Confirmed
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Hello Dirk,

I took the liberty to fix a nit in the changelog entry:

 18 [ Jeremy Szu ]
 19 * README, README.md,
 20 UbuntuDrivers/detect.py,
 21 tests/test_ubuntu_drivers.py:
 22 - Let OEM images locally extend the NVIDIA driver
 23 supported PCI IDs for cutting edge silicons by specifying
 24 related information in /etc/custom_supported_gpus.json file.
 25 (LP: #1990341)
 26 - Fix pkg.candidate.record retired from apt_pkg library
 27 - Support autopkgtest for force install Nvidia and update
 28 related section in README.

I changed the "- Let OEM..." sentence, and made sure that "LP" is uppercase.

Otherwise I believe everything has been properly addressed so I'm uploading this package:

$ dput ubuntu-drivers-common_0.9.6.2~0.22.04.5_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/ubuntu-drivers-common/ubuntu-drivers-common_0.9.6.2~0.22.04.5_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/ubuntu-drivers-common/ubuntu-drivers-common_0.9.6.2~0.22.04.5.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading ubuntu-drivers-common_0.9.6.2~0.22.04.5.dsc: done.
  Uploading ubuntu-drivers-common_0.9.6.2~0.22.04.5.tar.xz: done.
  Uploading ubuntu-drivers-common_0.9.6.2~0.22.04.5_source.buildinfo: done.
  Uploading ubuntu-drivers-common_0.9.6.2~0.22.04.5_source.changes: done.
Successfully uploaded packages.

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

I'm unsubscribing Ubuntu Sponsors.

Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: Confirmed → In Progress
Dirk Su (dirksu)
Changed in oem-priority:
status: Confirmed → Triaged
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello jeremyszu, or anyone else affected,

Accepted ubuntu-drivers-common into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1:0.9.6.2~0.22.04.5 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-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. 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 Jammy):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Dirk Su (dirksu) wrote :

Tested with Nvidia GPU 10de:2717. Disable restricted in jammy-updates and jammy-security, which make Nvidia 525 unavailable. Add /etc/customer_supported_gpus.json

{
  "chips": [
    {
      "devid": "0x2717",
      "name": "TEST 2717",
      "branch": "510.60",
      "feature": [
        "runtimepm"
      ]
    }
  ]
}

Type "ubuntu-driver list" in console did not show anything.

tags: added: verification-failed verification-failed-jammy
removed: verification-needed verification-needed-jammy
Revision history for this message
Dirk Su (dirksu) wrote :

Upstream had fix the bug found in #22. Include the patch and generate debdiff again.

Dirk Su (dirksu)
Changed in ubuntu-drivers-common (Ubuntu Jammy):
status: Fix Committed → Confirmed
Revision history for this message
Simon Chopin (schopin) wrote :

Hi Dirk,

Thanks for the revised patch. However, it needs to be based on top of the version currently in -proposed. The archive can't overwrite a version that's already published, which is basically whenever its sources hit the -proposed pocket (that happened when Steve accepted the SRU back in #21).

Unsubscribing ubuntu-sponsors, please resubscribe when you feel the patch is ready for review :)

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

Thank for the advice. Revised patch to generate 0.9.6.2~0.22.04.6

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

Upload the patch for lunar

Andy Chi (andch)
Changed in ubuntu-drivers-common (Ubuntu Lunar):
status: Fix Released → Confirmed
Revision history for this message
Brian Murray (brian-murray) wrote (last edit ):

The jammy debdiff in comment #25 was based on some local copy of ubuntu-drivers-common so contained a different changelog entry, than what is in -proposed, for version 1:0.9.6.2~0.22.04.5 with "Let OEM image can locally" vs "Let OEM image locally" and different date. Given that these two changes were trivial to fix up locally I've done just that.

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

I sponsored the changes for both Jammy and Lunar.

Revision history for this message
Steve Langasek (vorlon) wrote :

Hello jeremyszu, or anyone else affected,

Accepted ubuntu-drivers-common into lunar-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1:0.9.7.1.2 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-lunar to verification-done-lunar. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-lunar. 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 Lunar):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-lunar
removed: verification-failed
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (ubuntu-drivers-common/1:0.9.7.1.2)

All autopkgtests for the newly accepted ubuntu-drivers-common (1:0.9.7.1.2) for lunar have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-drivers-common/1:0.9.7.1.2 (ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/lunar/update_excuses.html#ubuntu-drivers-common

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

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

Install lunar iso into Dell Precision 7680. Then install ubuntu-drivers-common 1:0.9.7.1.2 from proposed channel.

ubuntu@ubuntu-Precision-7680:~$ ubuntu-drivers list
ubuntu@ubuntu-Precision-7680:~$ sudo cp /tmp/custom_supported_gpus.json /etc
ubuntu@ubuntu-Precision-7680:~$ cat /etc/custom_supported_gpus.json
{
  "chips": [
    {
      "devid": "0x28B9",
      "name": "TEST 28B9",
      "branch": "535.113",
      "features": [
        "runtimepm"
      ]
    }
  ]
}
ubuntu@ubuntu-Precision-7680:~$ ubuntu-drivers list
nvidia-driver-535, (kernel modules provided by linux-modules-nvidia-535-generic-hwe-22.04)

System can use ubuntu-drivers to list package by adding customized JSON file. With command ubuntu-drivers install, Nvidia related packages can be added. After system reboot, Nvidia GPU work as expected.

tags: added: verification-done-lunar
removed: verification-needed-lunar
Revision history for this message
Dirk Su (dirksu) wrote :

Install jammy iso ubuntu-22.04.3-desktop-amd64.iso into Dell Precision 7680. Then install ubuntu-drivers-common 1:0.9.6.2~0.22.04.6 from proposed channel.

ubuntu@ubuntu-Precision-7680:~$ ubuntu-drivers list
ubuntu@ubuntu-Precision-7680:~$ sudo cp /tmp/custom_supported_gpus.json /etc
ubuntu@ubuntu-Precision-7680:~$ cat /etc/custom_supported_gpus.json
{
  "chips": [
    {
      "devid": "0x28B9",
      "name": "TEST 28B9",
      "branch": "535.113",
      "features": [
        "runtimepm"
      ]
    }
  ]
}
ubuntu@ubuntu-Precision-7680:~$ ubuntu-drivers list
nvidia-driver-535, (kernel modules provided by linux-modules-nvidia-535-generic-hwe-22.04)

System can use ubuntu-drivers to list package by adding customized JSON file. With command ubuntu-drivers install, Nvidia related packages can be added. After system reboot, Nvidia GPU work as expected.

tags: added: verification-done verification-done-jammy
removed: verification-failed-jammy verification-needed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

https://launchpad.net/ubuntu/+source/ubuntu-drivers-common/1:0.9.6.2~0.22.04.6 in jammy-proposed has no closing bug, and the changes file should include version 22.04.5 too I believe. There is also a build failure for arm64 (due to a build-time test failing). I will retrigger it, but I'm thinking we need a new upload to fix the changes file at least, and perhaps the build failure if it persists.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The jammy build of 1:0.9.6.2~0.22.04.6 is still failing[1] in arm64 after a retry:

FAIL: test_system_driver_packages_force_install_nvidia (test_ubuntu_drivers.DetectTest)
system_driver_packages() force install config points to an older version.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/unittest/mock.py", line 1379, in patched
    return func(*newargs, **newkeywargs)
  File "/<<PKGBUILDDIR>>/tests/test_ubuntu_drivers.py", line 1495, in test_system_driver_packages_force_install_nvidia
    self.assertEqual(set(packages), set(['nvidia-driver-470']))
AssertionError: Items in the first set but not the second:
'nvidia-driver-510'
Items in the second set but not the first:
'nvidia-driver-470'

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
ubuntu-drivers-common (1:0.9.7.1.2) lunar; urgency=medium

  * UbuntuDrivers/detect.py:
    - Skip modalias checking if id in force install list (LP: #1990341)

 -- Dirk Su <email address hidden> Thu, 31 Aug 2023 12:21:20 +0800

Changed in ubuntu-drivers-common (Ubuntu Lunar):
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) 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.

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

Reply to #34, I try to build 1:0.9.6.2~0.22.04.6 on my PPA (https://launchpad.net/~dirksu/+archive/ubuntu/ubuntu-drivers-common-build-test/+packages). And the package seems built successfully on arm64. Can you help to re-trigger the build for it?

Revision history for this message
Chris Halse Rogers (raof) wrote :

It seems that it's already been retried once in the main archive. I note that your PPA builds *without* -proposed enabled, whereas the archive will build *with* -proposed enabled - possibly this is why it fails in the archive and succeeds in your PPA?

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

Thanks for the reply. I create another PPA (https://launchpad.net/~dirksu/+archive/ubuntu/ubuntu-drivers-common-build-with-proposed-test) which build with -proposed enabled. And ubuntu-drivers-common built successful on arm64.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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