如果有人能帮助我,我会很高兴。我在一台装有 Nvidia GTX1650 的笔记本电脑上运行 22.04.1。我尝试在“附加驱动程序”GUI 中将 Nvidia 驱动程序从 510 更改为 515。更改失败了,可能是由于互联网暂时断开连接,我又尝试了几次,再次失败,直到我尝试安全行事并切换到 noveau 驱动程序。然而,那时我被困在“继续使用手动安装的驱动程序”选项中。我深入检查了之前的字符串:无法在 ubuntu 20.04 中更改 Nvidia 驱动程序,但找不到适合我的场景的答案。
例如当我尝试
sudo ubuntu-drivers install
我明白了
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 413, in install
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
如果我尝试
sudo ubuntu-drivers autoinstall
我得到几乎相同的输出
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
当我尝试删除所有 Nvidia 软件包时:
sudo dpkg -P $(dpkg -l | grep nvidia-driver | awk '{print $2}')
我明白了
dpkg: error: --purge needs at least one package name argument
但我不知道哪个论点是正确的。
总而言之,目前看来我只能使用集成的 UHD 显卡,无法使用 Nvidia。设置 > 关于: 在此处输入图片描述
关于如何再次安装有效的 Nvidia 驱动程序,您有什么想法吗?
答案1
我连接到一个更稳定的网络,然后运行:
sudo apt install nvidia-driver-470
这样就安装了稍旧的 470 驱动程序。现在继续使用手动安装的驱动程序在附加驱动程序 GUI 中消失了,其他选项仍然处于活动状态,而不是变灰。