ubuntu-drivers for 22.04 crashes while attempting to detect nvidia gpu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-drivers-common (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
SYSTEM INFORMATION:
user@host# lsb_release -rd
Description: Ubuntu 22.04.1 LTS
Release: 22.04
PACKAGE VERSION INFORMATION:
user@host# apt-cache policy ubuntu-
ubuntu-
Installed: 1:0.9.6.1
Candidate: 1:0.9.6.1
Version table:
*** 1:0.9.6.1 500
500 http://
100 /var/lib/
EXPECTED RESULT:
Any updated/missing drivers are upgraded/installed
ACTUAL RESULT:
when using the command 'nvidia-drivers install' after a fresh installation, the following error is produced from Python3:
=======
user@hostname:~$ sudo ubuntu-drivers install
Traceback (most recent call last):
File "/usr/bin/
greet()
File "/usr/lib/
return self.main(*args, **kwargs)
File "/usr/lib/
rv = self.invoke(ctx)
File "/usr/lib/
return _process_
File "/usr/lib/
return ctx.invoke(
File "/usr/lib/
return __callback(*args, **kwargs)
File "/usr/lib/
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/
return __callback(*args, **kwargs)
File "/usr/bin/
command_
File "/usr/bin/
UbuntuDrive
File "/usr/lib/
with_nvidia_kms = version >= 470
UnboundLocalError: local variable 'version' referenced before assignment
=======
FIX FOR THIS BUG/WORK AROUND:
This is fixed by adding the following code on line 830:
version = 0
<CODE SNIPPET>
def nvidia_
'''Applies changes that need to happen before installing the NVIDIA drivers'''
with_nvidia_kms = False
version = 520
# Enable KMS if nvidia >= 470
for package_name in to_install:
if package_
try:
except ValueError:
if with_nvidia_kms:
</CODE SNIPPET>