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.