software-properties-qt: nvidia driver version switch fails

Bug #1872551 reported by Horst Schirmeier
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
High
Unassigned

Bug Description

Switching the Nvidia driver version with kubuntu-driver-manager doesn't work anymore: Selecting a different driver version (nvidia-driver-440 instead of the currently selected / installed -390) and clicking "Apply Changes" has no effect and produces this error message in the terminal:

  Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py", line 895, in on_driver_changes_apply
    for dep in get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'):
NameError: name 'get_dependencies' is not defined

Steps to reproduce:
- sudo kubuntu-driver-manager
- Under "Additional Drivers", select a different Nvidia driver version
  (in my case: 440 instead of 390)
- Click "Apply Changes"
- (observe error message in the terminal)

Expected result:
- No error message
- Nvidia driver version 440 gets installed

Actual result:
- Error message
- No change in the installed Nvidia driver version

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: kubuntu-driver-manager (not installed)
ProcVersionSignature: Ubuntu 5.4.0-21.25-generic 5.4.27
Uname: Linux 5.4.0-21-generic x86_64
ApportVersion: 2.20.11-0ubuntu26
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: KDE
Date: Mon Apr 13 23:41:56 2020
InstallationDate: Installed on 2016-11-26 (1234 days ago)
InstallationMedia: Kubuntu 16.10 "Yakkety Yak" - Release amd64 (20161012.1)
SourcePackage: kubuntu-driver-manager
UpgradeStatus: Upgraded to focal on 2020-03-06 (38 days ago)

Revision history for this message
Horst Schirmeier (horst) wrote :
Revision history for this message
Rik Mills (rikmills) wrote :

kubuntu-driver-manager now just launches software-properties-qt, so changing package to software-properties where the code for that is.

affects: kubuntu-driver-manager (Ubuntu) → software-properties (Ubuntu)
Revision history for this message
Hans P. Möller (hmollercl) wrote :

Could you please test with software-properties-gtk? (you might need to install the package)
Then we could know if it is a software-properties-qt or a software-properties-* problem.
Thanks!

Revision history for this message
Horst Schirmeier (horst) wrote :

software-properties-gtk works as expected.

Revision history for this message
Rik Mills (rikmills) wrote :

If you install the package aptdaemon, does that help?

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
Rik Mills (rikmills)
summary: - kubuntu-driver-manager: nvidia driver version switch fails
+ software-properties-qt: nvidia driver version switch fails
Revision history for this message
Horst Schirmeier (horst) wrote :

aptdaemon has been installed from the start.

Revision history for this message
Rik Mills (rikmills) wrote :

$ grep -ir get_dependencies *
softwareproperties/gtk/SoftwarePropertiesGtk.py:def get_dependencies(apt_cache, package_name, pattern=None):
softwareproperties/gtk/SoftwarePropertiesGtk.py: for dep in get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'):
softwareproperties/qt/SoftwarePropertiesQt.py: for dep in get_dependencies(self.apt_cache, pkg.shortname, 'nvidia'):

So looks like the porting of the driver page to software-properties-qt was incomplete compared to the -gtk one?

Revision history for this message
Hans P. Möller (hmollercl) wrote :

could you test adding this to /lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py SoftwarePropertiesQt.py ? For me testing with nvidia is not easy

--- /lib/python3/dist-packages/softwareproperties/qt/SoftwarePropertiesQt.py 2020-04-14 09:16:19.370592334 -0400
+++ SoftwarePropertiesQt.py 2020-04-14 09:02:21.894527421 -0400
@@ -78,6 +78,17 @@
       QWidget.__init__(self)
       uic.loadUi("%s/designer/main.ui" % datadir, self)

+def get_dependencies(apt_cache, package_name, pattern=None):
+ """ Get the package dependencies, which can be filtered out by a pattern """
+ dependencies = []
+ for or_group in apt_cache[package_name].candidate.dependencies:
+ for dep in or_group:
+ if dep.rawtype in ["Depends", "PreDepends"]:
+ dependencies.append(dep.name)
+ if pattern:
+ dependencies = [ x for x in dependencies if x.find(pattern) != -1 ]
+ return dependencies
+
 class SoftwarePropertiesQt(SoftwareProperties):
   def __init__(self, datadir=None, options=None, parent=None, file=None, attachWinID=None):
     """ Provide a Qt-based graphical user interface to configure

Revision history for this message
Horst Schirmeier (horst) wrote :

The patch in comment #9 solves the issue for me.

Rik Mills (rikmills)
Changed in software-properties (Ubuntu):
status: Confirmed → Fix Committed
Mathew Hodson (mhodson)
Changed in software-properties (Ubuntu):
importance: Undecided → High
Revision history for this message
Rik Mills (rikmills) wrote :

A fix for this has been uploaded. It is currently stuck in proposed pocket due to an unrelated test failure of a reverse dependency, but I anticipate that being sorted before 20.04 release.

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

This bug was fixed in the package software-properties - 0.98.9

---------------
software-properties (0.98.9) focal; urgency=medium

  * softwareproperties/gtk/SoftwarePropertiesGtk.py:
    - Gtk is doing something that takes a lock while processing checkbox
      toggled events, the polkit auth dialog can't be displayed in return,
      we don't have a proper fix and it might require GTK changes,
      meanwhile we want a working interface so workaround with a sleep
      (lp: #1727908)

 -- Sebastien Bacher <email address hidden> Thu, 16 Apr 2020 11:57:50 +0200

Changed in software-properties (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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