Score:1

Errors when trying ubuntu-drivers autoinstall ubuntu 22.04

cg flag

I installed Ubuntu 22.04 LTS on an Acer Nitro 5 AN515-55 with Nvidia Geoforce GTX which worked fine for about 3 months. Yesterday I shut it off; when I powered up again, the second monitor is not recognized. Tried several ideas with no luck, so finally reinstalled the whole thing... After a few tries, I finally got the second display to be recognized by using the X.org driver.

Now when I try to move the display side in settings-Displays, after clicking on Apply, my laptop goes to the start login screen and nothing is changed. I tried to run sudo ubuntu-drivers autoinstall and see:

    Traceback (most recent call last):
      File "/usr/bin/ubuntu-drivers", line 513, in <module>
        greet()
      File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
        return self.main(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
        rv = self.invoke(ctx)
      File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
        return __callback(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/click/decorators.py", line 84, in new_func
        return ctx.invoke(f, obj, *args, **kwargs)
      File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
        return __callback(*args, **kwargs)
      File "/usr/bin/ubuntu-drivers", line 432, in autoinstall
        command_install(config)
      File "/usr/bin/ubuntu-drivers", line 187, in command_install
        UbuntuDrivers.detect.nvidia_desktop_pre_installation_hook(to_install)
      File "/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py", line 839, in 
        nvidia_desktop_pre_installation_hook
        with_nvidia_kms = version >= 470
    UnboundLocalError: local variable 'version' referenced before assignment

I installed from the same live USB stick I did originally AND updated the system a couple times (With Software updater and with console). Acer's support have not been helpful.

cc flag
The problem is the package name with "-open" (either the 515-open or 520-open). The packages without the "-open" should still work without editing a system script to make the "-open" versions work.
Score:2
eu flag

Here's a temporary fix until it's officially decided: (taken from here https://forums.developer.nvidia.com/t/ubuntu-22-04-1-nvidia-driver-open-kernel-nvidia-driver-515-open-issue/231356)

sudo nano /usr/lib/python3/dist-packages/UbuntuDrivers/detect.py

at line 835 change

version = int(package_name.split('-')[-1])

to this

version = int(package_name.split('-')[2])
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.