Nouveau

来自 Arch Linux 中文维基

本文内容或本节内容已经过期。

原因: 请提供模板的第一个位置参数以概括原因。 (在Talk:Nouveau讨论)

这篇文章或章节的翻译不反映原文。

原因:Not updated since 2016(在 Talk:Nouveau# 中讨论)

本文包含安装和配置NVIDIA显卡开源驱动 Nouveau 的内容. 有关官方闭源驱动的信息请查看NVIDIA.

查找硬件的 代号 (Wikipedia 包含更详细的列表), 然后和 功能矩阵 进行比较,缺人支持的功能。

安装[编辑 | 编辑源代码]

安装 xf86-video-nouveau 包, 这个软件包提供了Xorg DDX 驱动进行 2D加速,它还会引入 mesa,为 DRI 驱动提供 3D 加速功能

为x86_64提供32-bit支持, 请从multilib源中安装lib32-mesa

要支持 OpenGL,请安装 mesa-libgl[损坏的链接:replaced by mesa], 使用 multilib 的话,还需要安装 lib32-mesa-libglAUR[损坏的链接:replaced by lib32-mesa]

加载[编辑 | 编辑源代码]

Nouveau的内核模块应该在系统启动时就已自动加载,如果没有的话:

  • 确保你的内核参数中没有nomodeset 或者 vga=, 因为Nouveau需要内核模式设置。
  • 另外,确保你没有在 modprobe 配置文件 /etc/modprobe.d//usr/lib/modprobe.d/ 中屏蔽 Nouveau。
  • 检查 dmesg 中有没有 opcode 错误,如果有的话,将 nouveau.config=NvBios=PRAMIN 加入 内核参数禁止模块卸载[1]

尽早启动 KMS[编辑 | 编辑源代码]

提示:如果你对这个问题的解决有问题的话,请访问这个页面.

Nouveau 驱动依赖Kernel mode setting (KMS)。当系统启动时,KMS 模块会在其它模块之后启用,所以显示的分辨率发生改变。查看Nouveau KernelModeSetting 页面获取更多细节。

可以设置将 KMS 尽早启动,在 initramfs 加载时就接管功能。

nouveau 加入 /etc/mkinitcpio.confMODULES 数组:

MODULES="... nouveau ..."

如果你使用了一个自定义的EDID文件,你应该像这样把它加入到initramfs 中:

/etc/mkinitcpio.conf
FILES="/lib/firmware/edid/your_edid.bin"

重新生成初始ramdisk映像:

# mkinitcpio -p <kernel preset; e.g. linux>

如果 Nouneau 出问题了,不得不多次重建 nouveau-drm 进行测试,请不要在 initramfs 中添加nouveau。因为这样会容易忘记重建 initramfs 而使测试更加困难。先使用“延迟启动”,直到系统已经稳定。如果需要自定义固件,使用 initrams 可能会有更多问题(一般不建议)

提示与技巧[编辑 | 编辑源代码]

保留已安装的Nvidia驱动[编辑 | 编辑源代码]

如果你想保留已经安装的官方驱动但又想要使用Nouveau驱动,像下面注释掉/etc/modprobe.d/nouveau_blacklist.conf 中的内容

#blacklist nouveau

并通过新建文件/etc/X11/xorg.conf.d/20-nouveau.conf 来告诉Xorg引导Nouveau驱动而不是Nvidia驱动,文件内容如下:

Section "Device"
    Identifier "Nvidia card"
    Driver "nouveau"
EndSection

如果你已经安装了官方驱动,又想在不重启的情况下测试Nouveau驱动,请确保‘nvidia’模块未被加载:

# rmmod nvidia

然后加载'nouveau' 模块:

# modprobe nouveau

并且通过内核信息确保它已被正常加载:

# dmesg

安装最新的开发包[编辑 | 编辑源代码]

你可以通过AUR安装最新的git包:

你可以在 Nouveau Source page找到上游驱动源.

双输出[编辑 | 编辑源代码]

Nouveau 支持xrandr拓展和多显示器,教程详见RandR12

这是一个完整的例子 /etc/X11/xorg.conf.d/20-nouveau.conf 用来演示在双输出模式下运行两个显示器。当然,你可能更喜欢像GNOME显示控制中心 (gnome-control-center display)这样的图形化配置工具.

# the right one
Section "Monitor"
          Identifier   "NEC"
          Option "PreferredMode" "1280x1024_60.00"
EndSection

# the left one
Section "Monitor"
          Identifier   "FUS"
          Option "PreferredMode" "1280x1024_60.00"
          Option "LeftOf" "NEC"
EndSection

Section "Device"
    Identifier "nvidia card"
    Driver "nouveau"
    Option  "Monitor-DVI-I-1" "NEC"
    Option  "Monitor-DVI-I-2" "FUS"
EndSection

Section "Screen"
    Identifier "screen1"
   Monitor "NEC"
    DefaultDepth 24
      SubSection "Display"
       Depth      24
       Virtual 2560 2048
      EndSubSection
    Device "nvidia card"
EndSection

Section "ServerLayout"
    Identifier "layout1"
    Screen "screen1"
EndSection

设置控制台分辨率[编辑 | 编辑源代码]

使用fbset工具调整控制台分辨率. 你也可以通过 video= kernel 这样的选项来调整控制台分辨率 (详见 KMS).

电源管理[编辑 | 编辑源代码]

GPU缩放依赖于GPU上的各个阶段的准备。kernel 3.18 之后内核包含电源管理功能,如果要玩游戏的话,可以将 nouveau.pstate=1 加入模块参数,启用 pstate,这样会获得更高的频率。

查看 Nouveau PowerManagement page 以获得更多细节。

风扇控制[编辑 | 编辑源代码]

如果硬件支持,可以通过 /sys 控制风扇转速。

$ find /sys -name pwm1_enable
/sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/hwmon/hwmon1/pwm1_enable
$ readlink /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/driver
../../../../bus/pci/drivers/nouveau

pwm1_enable 可以设置为 0, 1 或 2,意思是 NONE, MANUAL 和 AUTO 风扇控制。设置为手动时,可以手动设置 pwm1,例如设置为 40 表示 40% 的转速.

警告: 风险自担,不要太热烧了显卡!

可以通过 udev 规则设置:

$ cat /etc/udev/rules.d/50-nouveau-hwmon.rules
ACTION=="add", SUBSYSTEM=="hwmon", DRIVERS=="nouveau", ATTR{pwm1_enable}="2"

参考:

Optimus[编辑 | 编辑源代码]

要在笔记本上使用 Optimus(使用两个 GPUs),请阅读 bumblebeePRIME

故障排除[编辑 | 编辑源代码]

添加以下内容到内核命令(如果使用grub启动,在启动菜单下按e)来打开视频调试:

drm.debug=14 log_buf_len=16M

建立详细的Xorg日志:

startx -- -logverbose 9 -verbose 9

查看加载的视频模块的参数和值:

modinfo -p video

禁用 MSI[编辑 | 编辑源代码]

如果出现模块加载错误或 X 服务器无法启用,请尝试将 nouveau.config=NvMSI=0 加入 内核参数.

Source: https://bugs.freedesktop.org/show_bug.cgi?id=78441

Phantom Output Issue[编辑 | 编辑源代码]

It is possible for the nouveau driver to detect "phantom" outputs. For example, both VGA-1 and LVDS-1 are shown as connected but only LVDS-1 is present.

This causes display problems and a corrupted screen.

The problem can be overcome by disabling the phantom output (VGA-1 in the examples given) on the kernel command line of your boot loader. This can be achieved by appending the following:

video=VGA-1:d

Where d = disable.

The phantom output can also be disabled in X by adding the following to /etc/X11/xorg.conf.d/20-nouveau.conf:

Section "Monitor"
Identifier "VGA-1"
Option "Ignore" "1"
EndSection

Source: http://gentoo-en.vfose.ru/wiki/Nouveau#Phantom_and_unpopulated_output_connector_issues

Random lockups with kernel error messages[编辑 | 编辑源代码]

Specific Nvidia chips with Nouveau may give random system lockups and more commonly throw many kernel messages, seen with dmesg. Try adding the nouveau.noaccel=1 kernel parameter. See [2] for more information.