Difference between revisions of "Nouveau"

From ArchWiki
Jump to: navigation, search
(Installation: add back some info about nouveau-dri)
(43 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Graphics (English)]]
+
[[Category:Graphics]]
[[Category:X Server (English)]]
+
[[Category:X Server]]
{{i18n|Nouveau}}
+
[[es:Nouveau]]
 +
[[it:Nouveau]]
 +
[[ru:Nouveau]]
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|This article details the installation of the Nouveau Open Source 3D acceleration graphics driver for NVIDIA cards. The name of the project refers to the fact that "nouveau" means "new" in French.}}
 
{{Article summary text|This article details the installation of the Nouveau Open Source 3D acceleration graphics driver for NVIDIA cards. The name of the project refers to the fact that "nouveau" means "new" in French.}}
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
{{Article summary wiki|KMS}}
 
{{Article summary wiki|Xorg}}
 
 
{{Article summary wiki|NVIDIA}}
 
{{Article summary wiki|NVIDIA}}
 +
{{Article summary wiki|Xorg}}
 
{{Article summary end}}
 
{{Article summary end}}
  
[http://nouveau.freedesktop.org/ Nouveau] is an open source graphic driver for NVIDIA cards.
+
This article covers installing and configuring the [http://nouveau.freedesktop.org/ Nouveau] open source driver for NVIDIA graphic cards. For information about the official proprietary driver, see [[NVIDIA]].
  
Do not forget to check out the [http://nouveau.freedesktop.org/wiki/FAQ FAQ] if you have any questions, as there is a lot of valuable information there.
+
Do not forget to check out the [http://nouveau.freedesktop.org/wiki/FAQ Nouveau FAQ] if you have any questions, as there is a lot of valuable information there.
  
==Installation==
+
== Installation ==
  
Before proceeding, have a look at the [http://nouveau.freedesktop.org/wiki/FeatureMatrix FeatureMatrix] to see what features are supported for a given architecture, and the list of [http://nouveau.freedesktop.org/wiki/CodeNames codenames] to determine the card's category. You could also consult [[Wikipedia:Comparison of Nvidia Graphics Processing Units|wikipedia]] for an even more detailed list.
+
Before proceeding, have a look at the [http://nouveau.freedesktop.org/wiki/FeatureMatrix FeatureMatrix] to see what features are supported for a given architecture, and the list of [http://nouveau.freedesktop.org/wiki/CodeNames codenames] to determine the card's category. You could also consult [[Wikipedia:Comparison of Nvidia Graphics Processing Units|Wikipedia]] for an even more detailed list.
  
* If you already installed the proprietary NVIDIA driver, then remove it first: {{bc|<nowiki>
+
If you already installed the proprietary NVIDIA driver, then remove it first:  
# pacman -Rdds nvidia nvidia-utils
+
# pacman -S --asdeps libgl
+
</nowiki>}}
+
  
:{{Tip|If you want to keep Nvidia driver installed, then it [[#Keep NVIDIA driver installed|requires some configuration]] to load the Nouveau driver instead of NVIDIA.}}
+
# pacman -Rdds nvidia nvidia-utils
 +
# pacman -S --asdeps libgl
  
* Install the DDX driver with the following package: {{bc|# pacman -S xf86-video-nouveau}}
+
{{Tip|If you want to keep Nvidia driver installed, it [[#Keep NVIDIA driver installed|requires some configuration]] to load the Nouveau driver instead of Nvidia.}}
  
:Also make sure you have [[Xorg]] properly installed.
+
{{Note|If you are installing the Nouveau drivers after uninstalling the Nvidia ones, be sure to delete the {{ic|/etc/X11/xorg.conf}} file that the Nvidia driver created (or undo the changes), or else X will fail to properly load the Nouveau driver.}}
 +
 
 +
[[pacman|Install]] the DDX driver with the {{Pkg|xf86-video-nouveau}} package, which is available in the [[Official Repositories|official repositories]]. It pulls in {{Pkg|nouveau-dri}} as a dependency, providing the DRI driver for 3D acceleration.
 +
 
 +
Also make sure you have [[Xorg]] properly installed.
 
 
* If you want hardware-accelerated 3D support (to run GNOME Shell or KWin's effects for instance), install the DRI driver with the following package: {{bc|# pacman -S nouveau-dri}}
+
For 32-bit 3D support on x86_64, install {{Pkg|lib32-nouveau-dri}} from the [[multilib]] repository.
  
:{{Warning|
+
{{Note|See the [http://nouveau.freedesktop.org/wiki/MesaDrivers Nouveau MesaDrivers page] before reporting bugs with the 3D drivers.}}
:*The DRI driver is '''experimental''', and may cause rendering corruptions or random GPU lockups (especially on older cards that uses the classic Mesa driver). If you use it, it is recommended to enable the [[Sysctl#Configuration|Magic SysRq key]] to be able to [http://nouveau.freedesktop.org/wiki/LockupRecovery recover from a lockup].
+
:*See http://nouveau.freedesktop.org/wiki/MesaDrivers before reporting bugs with the 3D drivers.}}
+
  
==Loading==
+
== Loading ==
  
The nouveau kernel module should load fine automatically on system boot.
+
The Nouveau kernel module should load fine automatically on system boot.
  
 
If it does not happen, then:
 
If it does not happen, then:
* Make sure you do '''not''' have {{ic|nomodeset}} or {{ic|1=vga=}} in GRUB's {{ic|menu.lst}}/{{ic|menu.cfg}} kernel line, since Nouveau needs kernel mode-setting in order to run successfully (see below).
+
 
 +
* Make sure you do '''not''' have {{ic|nomodeset}} or {{ic|1=vga=}} as a [[Kernel parameters|kernel parameter]], since Nouveau needs kernel mode-setting in order to run successfully (see below).
 
* Also, check that you have not disabled Nouveau by using any modprobe blacklisting within {{ic|/etc/modprobe.d/}}.
 
* Also, check that you have not disabled Nouveau by using any modprobe blacklisting within {{ic|/etc/modprobe.d/}}.
  
===KMS===
+
=== KMS ===
  
Kernel Mode-Setting ([[KMS]]) is required by the Nouveau driver. As the system boots, the resolution will likely change when KMS initializes the display driver. Simply installing the Nouveau driver should be enough to get the system to recognize and initialize it in "Late Start" mode (see below). Additional reading: [http://nouveau.freedesktop.org/wiki/KernelModeSetting KernelModeSetting].
+
[[Kernel Mode Setting]] (KMS) is required by the Nouveau driver. As the system boots, the resolution will likely change when KMS initializes the display driver. Simply installing the Nouveau driver should be enough to get the system to recognize and initialize it in "Late start" mode (see below). See the [http://nouveau.freedesktop.org/wiki/KernelModeSetting Nouveau KernelModeSetting page] for more details.
  
 
{{Note|Users may prefer the early start method as it does not cause the annoying resolution change part way through the boot process.}}
 
{{Note|Users may prefer the early start method as it does not cause the annoying resolution change part way through the boot process.}}
  
====Late start====
+
==== Late start ====
With this choice KMS will be enabled when other kernel modules are loaded. You will see the text "Loading modules" and the size of the text may change, possibly with an undesirable flicker.
+
  
====Early start====
+
This method will start the KMS after the other kernel modules are loaded. You will see the text "Loading modules" and the size of the text may change, possibly with an undesirable flicker.
This method will start KMS as early as possible in the boot process, when the [[initramfs]] is loaded. Here is how to do this with the official packages:
+
  
# Add "nouveau" to the {{ic|MODULES}} array in {{ic|/etc/mkinitcpio.conf}}: {{bc|<nowiki>MODULES="... nouveau ..."</nowiki>}}
+
==== Early start ====
# Re-generate boot image: {{bc|# mkinitcpio -p <kernel preset, e.g. linux>}}
+
  
If experiencing troubles with nouveau leading to rebuild nouveau-drm several times for testing purposes, do not add nouveau to the initramfs. It is too easy to forget to rebuild the initramfs and it will just make any testing harder. Just use ''late start'' until you are confident the system is stable. There might be additional problems with initramfs if you need a firmware for the nv50 family.
+
This method will start the KMS as early as possible in the boot process, when the [[initramfs]] is loaded.  
  
==Tips and tricks==
+
To do this, add {{ic|nouveau}} to the {{ic|MODULES}} array in {{ic|/etc/mkinitcpio.conf}}:
  
===Keep NVIDIA driver installed===
+
MODULES="... nouveau ..."
 +
 
 +
Re-generate the initial ramdisk image:
 +
 
 +
# mkinitcpio -p <kernel preset; e.g. ''linux''>
 +
 
 +
If you're experiencing troubles with Nouveau leading to rebuild nouveau-drm several times for testing purposes, do not add {{ic|nouveau}} to the initramfs. It is too easy to forget to rebuild the initramfs and it will just make any testing harder. Just use "Late start" until you are confident the system is stable. There might be additional problems with initramfs if you need a custom firmware (generally not advised).
 +
 
 +
== Tips and tricks ==
 +
 
 +
=== Keep NVIDIA driver installed ===
 +
 
 +
If you want to keep the proprietary NVIDIA driver installed, but want to use the Nouveau driver, comment out nouveau blacklisting in {{ic|/etc/modprobe.d/nouveau_blacklist.conf}} modifying it as follows:
 +
 
 +
#blacklist nouveau
 +
 
 +
And tell Xorg to load nouveau instead of nvidia by creating the file {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}} with the following content:
 +
 
 +
Section "Device"
 +
    Identifier "Nvidia card"
 +
    Driver "nouveau"
 +
EndSection
  
If you want to keep the proprietary NVIDIA driver installed, but want to use the Nouveau driver:
 
# Comment out nouveau blacklisting in {{ic|etc/modprobe.d/nouveau_blacklist.conf}} by modifying the line from: {{bc|blacklist nouveau}} to: {{bc|#blacklist nouveau}}
 
# And tell Xorg to load nouveau instead of nvidia by creating the file {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}} with the following content: {{bc|<nowiki>
 
Section "Device"
 
    Identifier "Nvidia card"
 
    Driver "nouveau"
 
EndSection
 
</nowiki>}}
 
 
{{Tip|You can use [[NVIDIA#Switching_between_nvidia_and_nouveau_drivers|these scripts]] if you are switching between open and closed drivers often.}}
 
{{Tip|You can use [[NVIDIA#Switching_between_nvidia_and_nouveau_drivers|these scripts]] if you are switching between open and closed drivers often.}}
  
If you already used the NVIDIA driver, and want to test Nouveau without reboot:
+
If you already used the NVIDIA driver, and want to test Nouveau without reboot, make sure the 'nvidia' module is no longer loaded:
# Make sure the 'nvidia' module is no longer loaded: {{bc|# rmmod nvidia}}
+
 
# Then load the 'nouveau' module: {{bc|# modprobe nouveau}}
+
# rmmod nvidia
# And check that it loaded fine by looking at kernel messages: {{bc|$ dmesg}}
+
 
 +
Then load the 'nouveau' module:  
 +
 
 +
# modprobe nouveau
 +
 
 +
And check that it loaded fine by looking at kernel messages:  
 +
 
 +
$ dmesg
 +
 
 +
=== Installing the latest development packages ===
  
===Installing the latest development packages===
 
 
You may install the latest -git packages, through AUR:
 
You may install the latest -git packages, through AUR:
 +
 
* You can use {{AUR|mesa-git}} which will allow the installation of the latest Mesa (including the latest DRI driver).
 
* You can use {{AUR|mesa-git}} which will allow the installation of the latest Mesa (including the latest DRI driver).
 
* You can use {{AUR|xf86-video-nouveau-git}} which will allow the installation of the latest DDX driver.
 
* You can use {{AUR|xf86-video-nouveau-git}} which will allow the installation of the latest DDX driver.
 
* You can also try installing a newer kernel version, through packages like {{AUR|linux-mainline}} in which the Nouveau DRM code would allow better performance.
 
* You can also try installing a newer kernel version, through packages like {{AUR|linux-mainline}} in which the Nouveau DRM code would allow better performance.
* To get the latest nouveau improvements, you should use the {{AUR|linux-git}} package from the AUR, edit the PKGBUILD and use nouveau's own kernel repository, which is currently located at: git://anongit.freedesktop.org/nouveau/linux-2.6.
+
* To get the latest Nouveau improvements, you should use the {{AUR|linux-git}} package from the AUR, edit the PKGBUILD and use Nouveau's own kernel repository, which is currently located at: git://anongit.freedesktop.org/nouveau/linux-2.6.
  
Upsteam driver sources can be found here: http://nouveau.freedesktop.org/wiki/Source.
+
Upsteam driver sources can be found at the [http://nouveau.freedesktop.org/wiki/Source Nouveau Source page].
  
===Tearing free compositing===
+
=== Tear-free compositing ===
  
Edit your {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}}, in the Device section add:
+
Edit your {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}}, and add the following to the {{ic|Device}} section:
{{bc|Section "Device"
+
    Identifier "nvidia card"
+
    Driver "nouveau"
+
    Option "GLXVBlank" "true"
+
EndSection}}
+
  
===DualHead===
+
Section "Device"
 +
    Identifier "nvidia card"
 +
    Driver "nouveau"
 +
    Option "GLXVBlank" "true"
 +
EndSection
 +
 
 +
=== Dual Head ===
  
 
Nouveau supports the xrandr extension for modesetting and multiple monitors. See the [[RandR12]] page for tutorials.
 
Nouveau supports the xrandr extension for modesetting and multiple monitors. See the [[RandR12]] page for tutorials.
  
 
Here is a full sample {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}} above for running 2 monitors in dual head mode. You may prefer to use a graphical tool to configure monitors like GNOME Control Center's Display panel ({{ic|gnome-control-center display}}).
 
Here is a full sample {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}} above for running 2 monitors in dual head mode. You may prefer to use a graphical tool to configure monitors like GNOME Control Center's Display panel ({{ic|gnome-control-center display}}).
 +
 
{{bc|
 
{{bc|
 
# the right one
 
# the right one
Line 119: Line 142:
 
     Identifier "nvidia card"
 
     Identifier "nvidia card"
 
     Driver "nouveau"
 
     Driver "nouveau"
     Option  "Monitor-DVI-I-0" "NEC"
+
     Option  "Monitor-DVI-I-1" "NEC"
     Option  "Monitor-DVI-I-1" "FUS"
+
     Option  "Monitor-DVI-I-2" "FUS"
 
EndSection
 
EndSection
  
 
Section "Screen"
 
Section "Screen"
 
     Identifier "screen1"
 
     Identifier "screen1"
 +
  Monitor "NEC"
 
     DefaultDepth 24
 
     DefaultDepth 24
 
       SubSection "Display"
 
       SubSection "Display"
Line 136: Line 160:
 
     Identifier "layout1"
 
     Identifier "layout1"
 
     Screen "screen1"
 
     Screen "screen1"
EndSection
+
EndSection}}
}}
+
  
===Setting console resolution===
+
=== Setting console resolution ===
  
Use the {{pkg|fbset}} tool to adjust console resolution.
+
Use the {{Pkg|fbset}} tool to adjust console resolution.
  
 
You can also pass the resolution to nouveau with the video= kernel line option (see [[KMS]]).
 
You can also pass the resolution to nouveau with the video= kernel line option (see [[KMS]]).
 +
 +
=== Power Management ===
 +
 +
GPU Scaling is in various stages of readiness depending on the GPU. See the [http://nouveau.freedesktop.org/wiki/PowerManagement Nouveau PowerManagement page] for more details.
 +
 +
=== Enable MSI (Message Signaled Interrupts) ===
 +
 +
This may provide a slight performance advantage.  It is only supported on NV50+ and is disabled by default.
 +
 +
{{Warning|This may cause instability with some motherboard / GPU combinations.}}
 +
 +
Place the following in {{ic|/etc/modprobe.d/nouveau.conf}}:
 +
 +
options nouveau msi=1
 +
 +
If using [[#Early_start|early start]], add the line {{ic|1= FILES="/etc/modprobe.d/nouveau.conf"}} to {{ic|/etc/mkinitcpio.conf}}, then re-generate kernel image:
 +
 +
# mkinitcpio -p <kernel preset; e.g. ''linux''>
 +
 +
Reboot the system for the changes to take effect.
 +
 +
== Troubleshooting ==
 +
Add the following to your kernel command line (if using grub hit {{keypress|e}} at the boot menu to edit) to turn on video debugging:
 +
drm.debug=14 log_buf_len=16M
 +
 +
Create verbose Xorg log:
 +
startx -- -logverbose 9 -verbose 9
 +
 +
View loaded video module parameters and values:
 +
modinfo -p video

Revision as of 20:53, 18 February 2013

Summary help replacing me
This article details the installation of the Nouveau Open Source 3D acceleration graphics driver for NVIDIA cards. The name of the project refers to the fact that "nouveau" means "new" in French.
Related
NVIDIA
Xorg

This article covers installing and configuring the Nouveau open source driver for NVIDIA graphic cards. For information about the official proprietary driver, see NVIDIA.

Do not forget to check out the Nouveau FAQ if you have any questions, as there is a lot of valuable information there.

Installation

Before proceeding, have a look at the FeatureMatrix to see what features are supported for a given architecture, and the list of codenames to determine the card's category. You could also consult Wikipedia for an even more detailed list.

If you already installed the proprietary NVIDIA driver, then remove it first:

# pacman -Rdds nvidia nvidia-utils
# pacman -S --asdeps libgl
Tip: If you want to keep Nvidia driver installed, it requires some configuration to load the Nouveau driver instead of Nvidia.
Note: If you are installing the Nouveau drivers after uninstalling the Nvidia ones, be sure to delete the /etc/X11/xorg.conf file that the Nvidia driver created (or undo the changes), or else X will fail to properly load the Nouveau driver.

Install the DDX driver with the xf86-video-nouveau package, which is available in the official repositories. It pulls in nouveau-dri as a dependency, providing the DRI driver for 3D acceleration.

Also make sure you have Xorg properly installed.

For 32-bit 3D support on x86_64, install lib32-nouveau-dri from the multilib repository.

Note: See the Nouveau MesaDrivers page before reporting bugs with the 3D drivers.

Loading

The Nouveau kernel module should load fine automatically on system boot.

If it does not happen, then:

  • Make sure you do not have nomodeset or vga= as a kernel parameter, since Nouveau needs kernel mode-setting in order to run successfully (see below).
  • Also, check that you have not disabled Nouveau by using any modprobe blacklisting within /etc/modprobe.d/.

KMS

Kernel Mode Setting (KMS) is required by the Nouveau driver. As the system boots, the resolution will likely change when KMS initializes the display driver. Simply installing the Nouveau driver should be enough to get the system to recognize and initialize it in "Late start" mode (see below). See the Nouveau KernelModeSetting page for more details.

Note: Users may prefer the early start method as it does not cause the annoying resolution change part way through the boot process.

Late start

This method will start the KMS after the other kernel modules are loaded. You will see the text "Loading modules" and the size of the text may change, possibly with an undesirable flicker.

Early start

This method will start the KMS as early as possible in the boot process, when the initramfs is loaded.

To do this, add nouveau to the MODULES array in /etc/mkinitcpio.conf:

MODULES="... nouveau ..."

Re-generate the initial ramdisk image:

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

If you're experiencing troubles with Nouveau leading to rebuild nouveau-drm several times for testing purposes, do not add nouveau to the initramfs. It is too easy to forget to rebuild the initramfs and it will just make any testing harder. Just use "Late start" until you are confident the system is stable. There might be additional problems with initramfs if you need a custom firmware (generally not advised).

Tips and tricks

Keep NVIDIA driver installed

If you want to keep the proprietary NVIDIA driver installed, but want to use the Nouveau driver, comment out nouveau blacklisting in /etc/modprobe.d/nouveau_blacklist.conf modifying it as follows:

#blacklist nouveau

And tell Xorg to load nouveau instead of nvidia by creating the file /etc/X11/xorg.conf.d/20-nouveau.conf with the following content:

Section "Device"
    Identifier "Nvidia card"
    Driver "nouveau"
EndSection
Tip: You can use these scripts if you are switching between open and closed drivers often.

If you already used the NVIDIA driver, and want to test Nouveau without reboot, make sure the 'nvidia' module is no longer loaded:

# rmmod nvidia

Then load the 'nouveau' module:

# modprobe nouveau

And check that it loaded fine by looking at kernel messages:

$ dmesg

Installing the latest development packages

You may install the latest -git packages, through AUR:

  • You can use mesa-gitAUR which will allow the installation of the latest Mesa (including the latest DRI driver).
  • You can use xf86-video-nouveau-gitAUR which will allow the installation of the latest DDX driver.
  • You can also try installing a newer kernel version, through packages like linux-mainlineAUR in which the Nouveau DRM code would allow better performance.
  • To get the latest Nouveau improvements, you should use the linux-gitAUR package from the AUR, edit the PKGBUILD and use Nouveau's own kernel repository, which is currently located at: git://anongit.freedesktop.org/nouveau/linux-2.6.

Upsteam driver sources can be found at the Nouveau Source page.

Tear-free compositing

Edit your /etc/X11/xorg.conf.d/20-nouveau.conf, and add the following to the Device section:

Section "Device"
    Identifier "nvidia card"
    Driver "nouveau"
    Option "GLXVBlank" "true"
EndSection

Dual Head

Nouveau supports the xrandr extension for modesetting and multiple monitors. See the RandR12 page for tutorials.

Here is a full sample /etc/X11/xorg.conf.d/20-nouveau.conf above for running 2 monitors in dual head mode. You may prefer to use a graphical tool to configure monitors like GNOME Control Center's Display panel (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

Setting console resolution

Use the fbset tool to adjust console resolution.

You can also pass the resolution to nouveau with the video= kernel line option (see KMS).

Power Management

GPU Scaling is in various stages of readiness depending on the GPU. See the Nouveau PowerManagement page for more details.

Enable MSI (Message Signaled Interrupts)

This may provide a slight performance advantage. It is only supported on NV50+ and is disabled by default.

Warning: This may cause instability with some motherboard / GPU combinations.

Place the following in /etc/modprobe.d/nouveau.conf:

options nouveau msi=1

If using early start, add the line FILES="/etc/modprobe.d/nouveau.conf" to /etc/mkinitcpio.conf, then re-generate kernel image:

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

Reboot the system for the changes to take effect.

Troubleshooting

Add the following to your kernel command line (if using grub hit Template:Keypress at the boot menu to edit) to turn on video debugging:

drm.debug=14 log_buf_len=16M

Create verbose Xorg log:

startx -- -logverbose 9 -verbose 9

View loaded video module parameters and values:

modinfo -p video