如何使用ubuntu驱动程序更改显卡驱动程序?


8

我想验证NVIDIA当前使用的驱动程序,然后在必要时将其切换为nvidia-331-updates。

我该怎么做?

sudo ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00000FFBsv00001462sd000010DBbc03sc00i00
model    : GK107GLM [Quadro K2000M]
vendor   : NVIDIA Corporation
driver   : nvidia-331-updates - distro non-free
driver   : nvidia-304 - distro non-free
driver   : nvidia-304-updates - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

sudo ubuntu-drivers list
nvidia-304
nvidia-331
nvidia-331-updates
nvidia-304-updates

(我试过sudo ubuntu-drivers autoinstallsudo ubuntu-drivers autoinstall nvidia-331-updates- desperatly,在缺乏有效的帮助文本-无济于事)

最近有人提出了类似的问题(如何在命令行中使用ubuntu-drivers-common或software-properties更改图形驱动程序?),但提问者接受了一个并未真正回答问题的答案。这就是为什么我想再尝试一次。

首先,我对此感兴趣的原因是,在摆弄尝试设置第二个监视器之后,图形“附加驱动程序”工具突然停止工作。

Answers:


2

不,你不能。至少没有那个工具。没有命令可以帮助您安装其他驱动程序:

list: Show all driver packages which apply to the current system.
debug: Print all available information and debug data about drivers.
devices: Show all devices which need drivers, and which packages apply to them.
autoinstall: Install drivers that are appropriate for automatic installation.

list不会安装,但会列出。debug只是打印更多信息。devices内容丰富。autoinstall不允许其他参数:

def command_autoinstall(args):
    '''Install drivers that are appropriate for automatic installation.'''

    cache = apt.Cache()

    packages = UbuntuDrivers.detect.system_driver_packages(cache)
    packages = UbuntuDrivers.detect.auto_install_filter(packages)
    if not packages:
        print('No drivers found for automatic installation.')
        return

    # ignore packages which are already installed
    to_install = []
    for p in packages:
        if not cache[p].installed:
            to_install.append(p)

    if not packages:
        print('All drivers for automatic installation are already installed.')
        return

    ret = subprocess.call(['apt-get', 'install', '-o',
        'DPkg::options::=--force-confnew', '-y'] + to_install)

    # create package list
    if ret == 0 and args.package_list:
        with open(args.package_list, 'a') as f:
            f.write('\n'.join(to_install))
            f.write('\n')

    return ret

您可以忽略该工具,然后使用自己apt得到的输出手动安装软件包。只需删除一个软件包并安装另一个软件包即可:

sudo apt-get install nvidia-331-updates
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.