Nouveau: Difference between revisions

From ArchWiki
(Remove duplication, already said in introduction.)
(→‎Enable early KMS: Actually, let's flag this for removal)
 
(88 intermediate revisions by 36 users not shown)
Line 1: Line 1:
[[Category:Graphics]]
[[Category:Graphics]]
[[Category:X server]]
[[Category:X server]]
[[de:Nouveau]]
[[es:Nouveau]]
[[es:Nouveau]]
[[it:Nouveau]]
[[fr:Nouveau]]
[[ja:Nouveau]]
[[ja:Nouveau]]
[[ru:Nouveau]]
[[zh-hans:Nouveau]]
[[zh-CN:Nouveau]]
{{Related articles start}}
{{Related articles start}}
{{Related|NVIDIA}}
{{Related|NVIDIA}}
Line 12: Line 12:
{{Related articles end}}
{{Related articles end}}


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]].
This article covers the open-source [https://nouveau.freedesktop.org/ Nouveau] driver for NVIDIA graphics cards. For information about the proprietary driver, see [[NVIDIA]].


Find your card's [http://nouveau.freedesktop.org/wiki/CodeNames codename] (a more detailed list is available on [[Wikipedia:Comparison of Nvidia Graphics Processing Units|Wikipedia]]), and compare it with the [http://nouveau.freedesktop.org/wiki/FeatureMatrix/ feature matrix] for supported features.
Find your card's [https://nouveau.freedesktop.org/wiki/CodeNames code name] (a more detailed list is available on [[Wikipedia:Comparison of Nvidia Graphics Processing Units|Wikipedia]]), and compare it with the [https://nouveau.freedesktop.org/wiki/FeatureMatrix/ feature matrix] for supported features.


== Installation ==
== Installation ==


[[Install]] the {{Pkg|xf86-video-nouveau}} package. It provides the DDX driver for 2D acceleration in [[Xorg]], and pulls in {{Pkg|mesa}} as a dependency which provides the DRI driver for 3D acceleration.
[[Install]] the {{Pkg|mesa}} package, which provides the DRI driver for 3D acceleration.


For OpenGL support, also install {{Pkg|mesa-libgl}}, and {{Pkg|lib32-mesa-libgl}} when using [[multilib]].
* For 32-bit application support, also install the {{Pkg|lib32-mesa}} package from the [[multilib]] repository.
* For the DDX driver (which provides 2D acceleration in [[Xorg]]), [[install]] the {{Pkg|xf86-video-nouveau}} package.
 
{{Note|1=It has [https://bugs.freedesktop.org/show_bug.cgi?id=94844#c3 been suggested] that not installing the {{Pkg|xf86-video-nouveau}} driver, and instead falling back on the modesetting driver for [https://nouveau.freedesktop.org/CodeNames.html#NV50 NV50 (G80)] and newer hardware is beneficial. For example see a [https://bbs.archlinux.org/viewtopic.php?id=263498 user report] from 2021.}}
 
See also [[Hardware video acceleration]].


== Loading ==
== Loading ==
Line 27: Line 32:


* Make sure you do '''not''' have {{ic|nomodeset}} or {{ic|1=vga=}} as a [[kernel parameter]], since Nouveau requires kernel mode-setting.
* Make sure you do '''not''' have {{ic|nomodeset}} or {{ic|1=vga=}} as a [[kernel parameter]], since Nouveau requires kernel mode-setting.
* Also, check that you have not disabled Nouveau by using any modprobe blacklisting within {{ic|/etc/modprobe.d/}} or {{ic|/usr/lib/modprobe.d/}}.
* Also, check that you do not have Nouveau disabled using any modprobe blacklisting technique within {{ic|/etc/modprobe.d/}} or {{ic|/usr/lib/modprobe.d/}}.
* If all above still fails to load nouveau check dmesg for opcode error. Add {{ic|1=nouveau.config=NvBios=PRAMIN}} to your [[Kernel parameters]] to prevent module unloading.[http://nouveau.freedesktop.org/wiki/TroubleShooting/#index10h3]
* If everything above still fails to load nouveau, check [[dmesg]] for an opcode error. Add {{ic|1=nouveau.config=NvBios=PRAMIN}} to your [[Kernel parameters]] to prevent module unloading.[https://nouveau.freedesktop.org/wiki/TroubleShooting/#index10h3]
* Check if {{ic|/etc/X11/xorg.conf}} or any file in {{ic|/etc/X11/xorg.conf.d/}} exists and is referencing the {{ic|nvidia}} driver. It is probably a good idea to rename the file.


=== Enable early KMS ===
=== Enable early KMS ===
{{Remove|Since [https://gitlab.archlinux.org/archlinux/mkinitcpio/mkinitcpio/-/releases/v32 mkinitcpio v32], the {{ic|kms}} hook is included by default, therefore most setups will have early loading enabled by default.}}


{{Tip|If you have problems with the resolution, check [[Kernel mode setting#Forcing modes and EDID]].}}
{{Tip|If you have problems with the resolution, check [[Kernel mode setting#Forcing modes and EDID]].}}


[[Kernel mode setting]] (KMS) is required by the Nouveau driver. By default, the KMS is done 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. See the [http://nouveau.freedesktop.org/wiki/KernelModeSetting Nouveau KernelModeSetting page] for more details.
[[Kernel mode setting]] (KMS) is required by the Nouveau driver. By default, the KMS is done 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. See the [https://nouveau.freedesktop.org/wiki/KernelModeSetting Nouveau KernelModeSetting page] for more details.


It is also possible to start the KMS as early as possible in the boot process, when the [[initramfs]] is loaded.  
It is also possible to start the KMS as early as possible in the boot process, when the [[initramfs]] is loaded.  


To do this, add {{ic|nouveau}} to the {{ic|MODULES}} array in {{ic|/etc/mkinitcpio.conf}}:  
To do this, add {{ic|nouveau}} to the {{ic|MODULES}} array in {{ic|/etc/mkinitcpio.conf}} (module names are separated by spaces):  


  MODULES="... nouveau ..."
  MODULES=(... nouveau ...)


If you are using a custom EDID file, you should embed it into initramfs as well:
If you are using a custom EDID file, you should embed it into initramfs as well:
Line 47: Line 55:
2=FILES="/lib/firmware/edid/your_edid.bin"}}
2=FILES="/lib/firmware/edid/your_edid.bin"}}


Re-generate the initial ramdisk image:
To finish, [[regenerate the initramfs]].
 
# 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 ==
== Tips and tricks ==
Line 57: Line 61:
=== Keep NVIDIA driver installed ===
=== Keep NVIDIA driver installed ===


If you want to keep the proprietary NVIDIA driver installed (and are not using OpenGL), but want to use the Nouveau driver, comment out nouveau blacklisting in {{ic|/etc/modprobe.d/nouveau_blacklist.conf}} or {{ic|/usr/lib/modprobe.d/nvidia.conf}} modifying it as follows:
If you want to keep the proprietary NVIDIA driver installed (and are not using OpenGL), but want to use the Nouveau driver, comment out nouveau blacklisting in {{ic|/etc/modprobe.d/nouveau_blacklist.conf}}, {{ic|/usr/lib/modprobe.d/nvidia.conf}}, or {{ic|/usr/lib/modprobe.d/nvidia-dkms.conf}} modifying it as follows:


  #blacklist nouveau
  #blacklist nouveau
Line 67: Line 71:
     Driver "nouveau"
     Driver "nouveau"
  EndSection
  EndSection
{{Tip|You can use [[NVIDIA/Tips and tricks#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, make sure the 'nvidia' module is no longer loaded:
If you already used the NVIDIA driver, and want to test Nouveau without reboot, make sure the 'nvidia' module is no longer loaded:
Line 80: Line 82:
And check that it loaded fine by looking at kernel messages:  
And check that it loaded fine by looking at kernel messages:  


  $ dmesg
  # dmesg


=== Installing the latest development packages ===
=== Installing the latest development packages ===


You may install the latest -git packages, through AUR:
To get the latest Nouveau improvements


* You can use {{AUR|mesa-git}} which will allow the installation of the latest Mesa (including the latest DRI driver).
*{{AUR|linux-git}}
* You can use {{AUR|xf86-video-nouveau-git}}{{Broken package link|{{aur-mirror|xf86-video-nouveau-git}}}} which will allow the installation of the latest DDX driver.
*{{AUR|libdrm-git}}
* 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.
*{{AUR|lib32-libdrm-git}}
* 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/git/nouveau/xf86-video-nouveau.
*{{AUR|lib32-mesa-git}}
*{{AUR|mesa-git}}
*{{AUR|xf86-video-nouveau-git}}


Upstream driver sources can be found at the [http://nouveau.freedesktop.org/wiki/Source Nouveau Source page].
=== Dual head ===


=== Dual Head ===
See [[Multihead#RandR]] how to setup multiple monitors by using [[Wikipedia:RandR|RandR]].


Nouveau supports the xrandr extension for modesetting and multiple monitors. See the [[xrandr]] page for tutorials.
=== Setting console resolution ===
 
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|
# 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"
You can pass the resolution to nouveau with the {{ic|1=video=}} kernel line option (see [[KMS]]).
    Identifier "screen1"
  Monitor "NEC"
    DefaultDepth 24
      SubSection "Display"
      Depth      24
      Virtual 2560 2048
      EndSubSection
    Device "nvidia card"
EndSection


Section "ServerLayout"
=== Power management ===
    Identifier "layout1"
    Screen "screen1"
EndSection}}


=== Setting console resolution ===
The lack of proper power management in the nouveau driver is one of the most important causes of performance issues, since most cards will remain in their lower power state with lower clocks during their use. Experimental support for GPU reclocking is available for some cards (see the [https://nouveau.freedesktop.org/wiki/PowerManagement Nouveau PowerManagement page]) and since kernel 4.5 can be controlled through a debugfs interface located at {{ic|/sys/kernel/debug/dri/*/pstate}}.


Use the {{Pkg|fbset}} tool to adjust console resolution.
For example, to check the available power states and the current setting for the first card in your system, run:


You can also pass the resolution to nouveau with the {{ic|1=video=}} kernel line option (see [[KMS]]).
# cat /sys/kernel/debug/dri/0/pstate


=== Power Management ===
It is also possible to manually set/force a certain power state by writing to said interface:


GPU Scaling is in various stages of readiness depending on the GPU. After kernel 3.18 there's power management available in kernel. If you plan to play games you need to enable the power state on the module configuration by adding {{ic|1=nouveau.pstate=1}} to the module configuration. This will result in higher clocks when required.
# echo ''pstate'' > /sys/kernel/debug/dri/0/pstate


See the [http://nouveau.freedesktop.org/wiki/PowerManagement Nouveau PowerManagement page] for more details.
{{Warning|The support for reclocking is highly experimental. Manually setting the power state may hang your system, cause corruption or overheat your card.}}


==== Fan Control ====
==== Fan control ====


If it is implemented for you card you can configure fan control via {{ic|/sys}}.
If it is implemented for your card, you can configure fan control via {{ic|/sys}}.


  $ find /sys -name pwm1_enable
  $ find /sys -name pwm1_enable
Line 158: Line 127:


{{ic|pwm1_enable}} can be set to 0, 1 or 2 meaning NONE, MANUAL and AUTO fan control. If set to manual fan control, you can set {{ic|pwm1}} manually, for example to 40 for 40%.
{{ic|pwm1_enable}} can be set to 0, 1 or 2 meaning NONE, MANUAL and AUTO fan control. If set to manual fan control, you can set {{ic|pwm1}} manually, for example to 40 for 40%.
{{Warning|Use at your own risk! Don't overheat your card!}}
{{Warning|Use at your own risk! Do not overheat your card!}}


You can also set it by udev rule:
You can also set it by udev rule:
Line 165: Line 134:


Sources:
Sources:
* http://floppym.blogspot.de/2013/07/fan-control-with-nouveau.html
* https://floppym.blogspot.de/2013/07/fan-control-with-nouveau.html
* https://kalgan.cc/blog/posts/Controlling_nVidia_cards_fans_with_nouveau_in_Debian/
* https://web.archive.org/web/20141031191559/https://kalgan.cc/blog/posts/Controlling_nVidia_cards_fans_with_nouveau_in_Debian/


=== Optimus ===
=== Optimus ===


You have two solutions to use [[Optimus]] on a laptop (aka hybrid graphics, when you have two GPUs on your laptop): [[bumblebee]] and [[PRIME]]
You have two solutions to use [[Optimus]] on a laptop (aka hybrid graphics, when you have two GPUs on your laptop): [[bumblebee]] and [[PRIME]]
=== Vertical Sync ===
Xorg compositors are prone to show issues with Nouveau. Unlike most of them, [[Picom]] offers lots of options to tweak for a smoother and tearing free result. A configuration which is expected to deliver a good result would be the following:
$ picom -b --unredir-if-possible --backend xr_glx_hybrid --vsync --use-damage --glx-no-stencil
{{Tip|Do not forget to turn off compositing of your DE's window manager like KWin when using a different compositor.}}


== Troubleshooting ==
== Troubleshooting ==
Add {{ic|1=drm.debug=14}} and {{ic|1=log_buf_len=16M}} to your [[kernel parameters]] to turn on video debugging:
Add {{ic|1=drm.debug=14}} and {{ic|1=log_buf_len=16M}} to your [[kernel parameters]] to turn on video debugging:


Create verbose Xorg log:
Create verbose Xorg log:
  $ startx -- -logverbose 9 -verbose 9
  $ startx -- -logverbose 9 -verbose 9


View loaded video module parameters and values:
View loaded video module parameters and values:
  $ modinfo -p video
  $ modinfo -p video


====Disable MSI====
=== Disable MSI ===
If you are still having problems loading the module or starting X server append {{ic|1=nouveau.config=NvMSI=0}} to your [[Kernel parameters]].
 
If you are still having problems loading the module or starting the X server, append {{ic|1=nouveau.config=NvMSI=0}} to your [[Kernel parameters]].


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


====Phantom Output Issue====
=== 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.
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.
This causes display problems and/or prevent suspending on lid closure.
 
==== Kernel parameters ====


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:
The problem can be overcome by disabling the phantom output (VGA-1 in the examples given) with [[Kernel parameters]]:


  video=VGA-1:d
  video=VGA-1:d
Line 198: Line 181:
Where '''d''' = disable.
Where '''d''' = disable.


The phantom output can also be disabled in X by adding the following to {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}}:
The nouveau kernel module also has an option to disable TV-out detection [https://nouveau.freedesktop.org/wiki/KernelModuleParameters/#tv_disable]:
 
  tv_disable=1
 
==== Xorg configuration ====
 
The phantom output can be disabled in [[Xorg]] by adding the following to {{ic|/etc/X11/xorg.conf.d/20-nouveau.conf}}:


  Section "Monitor"
  Section "Monitor"
Line 205: Line 194:
  EndSection
  EndSection


Source: http://gentoo-en.vfose.ru/wiki/Nouveau#Phantom_and_unpopulated_output_connector_issues
Source: https://web.archive.org/web/20170118202740/http://gentoo-en.vfose.ru/wiki/Nouveau#Phantom_and_unpopulated_output_connector_issues
 
==== Xrandr ====
 
[[Xrandr]] can disable the output:
 
  $ xrandr --output VGA-1 --off
 
This can be added to the [[xinit]] configuration.
 
=== 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 {{ic|1=nouveau.noaccel=1}} [[kernel parameter]]. See [[Fedora:Common kernel problems#Systems with nVidia adapters using the nouveau driver lock up randomly]] for more information.
 
As an alternative, you can also use the {{ic|1=QT_XCB_FORCE_SOFTWARE_OPENGL=1}} [[environment variable]] to disable OpenGL acceleration in Qt applications.
 
=== Flat Panel Table Invalid ===
 
NVIDIA graphics cards with recent chipsets can cause startup issues - this includes X11 being unable to start and lspci freezing indefinitely[https://bugzilla.redhat.com/show_bug.cgi?id=1425253][https://bbs.archlinux.org/viewtopic.php?id=192532][https://stackoverflow.com/questions/28062458/nouveau-error-while-booting-arch][https://bbs.archlinux.org/viewtopic.php?id=207602][https://unix.stackexchange.com/questions/207895/how-do-i-install-antergos-with-a-gtx-970].
 
This can break live distributions/installation media. This can be detected either by running lspci, or checking the systemd journal for the error:
 
nouveau E[    DRM]Pointer to flat panel table invalid
 
The system may start if the Nouveau driver is disabled by passing the following [[kernel parameters]]:
 
modprobe.blacklist=nouveau
 
The Nouveau driver can then be loaded using
 
# modprobe nouveau


====Random lockups with kernel error messages====
The system should then function correctly.
If you have another Nvidia graphics card, or just want to be safe, you can disable the offending card using:


Specific Nvidia chips with Nouveau may give random system lockups and more commonly throw many kernel messages, seen with ''dmesg''. Try adding the {{ic|1=nouveau.noaccel=1}} [[kernel parameter]]. See [https://fedoraproject.org/wiki/Common_kernel_problems#Systems_with_nVidia_adapters_using_the_nouveau_driver_lock_up_randomly] for more information.
  $ echo 1 > /sys/bus/pci/devices/''[card device id]''/remove

Latest revision as of 15:15, 24 March 2023

This article covers the open-source Nouveau driver for NVIDIA graphics cards. For information about the proprietary driver, see NVIDIA.

Find your card's code name (a more detailed list is available on Wikipedia), and compare it with the feature matrix for supported features.

Installation

Install the mesa package, which provides the DRI driver for 3D acceleration.

Note: It has been suggested that not installing the xf86-video-nouveau driver, and instead falling back on the modesetting driver for NV50 (G80) and newer hardware is beneficial. For example see a user report from 2021.

See also Hardware video acceleration.

Loading

The Nouveau kernel module should load 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 requires kernel mode-setting.
  • Also, check that you do not have Nouveau disabled using any modprobe blacklisting technique within /etc/modprobe.d/ or /usr/lib/modprobe.d/.
  • If everything above still fails to load nouveau, check dmesg for an opcode error. Add nouveau.config=NvBios=PRAMIN to your Kernel parameters to prevent module unloading.[1]
  • Check if /etc/X11/xorg.conf or any file in /etc/X11/xorg.conf.d/ exists and is referencing the nvidia driver. It is probably a good idea to rename the file.

Enable early KMS

This article or section is being considered for removal.

Reason: Since mkinitcpio v32, the kms hook is included by default, therefore most setups will have early loading enabled by default. (Discuss in Talk:Nouveau)
Tip: If you have problems with the resolution, check Kernel mode setting#Forcing modes and EDID.

Kernel mode setting (KMS) is required by the Nouveau driver. By default, the KMS is done 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. See the Nouveau KernelModeSetting page for more details.

It is also possible to 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 (module names are separated by spaces):

MODULES=(... nouveau ...)

If you are using a custom EDID file, you should embed it into initramfs as well:

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

To finish, regenerate the initramfs.

Tips and tricks

Keep NVIDIA driver installed

If you want to keep the proprietary NVIDIA driver installed (and are not using OpenGL), but want to use the Nouveau driver, comment out nouveau blacklisting in /etc/modprobe.d/nouveau_blacklist.conf, /usr/lib/modprobe.d/nvidia.conf, or /usr/lib/modprobe.d/nvidia-dkms.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

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

To get the latest Nouveau improvements

Dual head

See Multihead#RandR how to setup multiple monitors by using RandR.

Setting console resolution

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

Power management

The lack of proper power management in the nouveau driver is one of the most important causes of performance issues, since most cards will remain in their lower power state with lower clocks during their use. Experimental support for GPU reclocking is available for some cards (see the Nouveau PowerManagement page) and since kernel 4.5 can be controlled through a debugfs interface located at /sys/kernel/debug/dri/*/pstate.

For example, to check the available power states and the current setting for the first card in your system, run:

# cat /sys/kernel/debug/dri/0/pstate

It is also possible to manually set/force a certain power state by writing to said interface:

# echo pstate > /sys/kernel/debug/dri/0/pstate
Warning: The support for reclocking is highly experimental. Manually setting the power state may hang your system, cause corruption or overheat your card.

Fan control

If it is implemented for your card, you can configure fan control via /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 can be set to 0, 1 or 2 meaning NONE, MANUAL and AUTO fan control. If set to manual fan control, you can set pwm1 manually, for example to 40 for 40%.

Warning: Use at your own risk! Do not overheat your card!

You can also set it by udev rule:

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

Sources:

Optimus

You have two solutions to use Optimus on a laptop (aka hybrid graphics, when you have two GPUs on your laptop): bumblebee and PRIME

Vertical Sync

Xorg compositors are prone to show issues with Nouveau. Unlike most of them, Picom offers lots of options to tweak for a smoother and tearing free result. A configuration which is expected to deliver a good result would be the following:

$ picom -b --unredir-if-possible --backend xr_glx_hybrid --vsync --use-damage --glx-no-stencil
Tip: Do not forget to turn off compositing of your DE's window manager like KWin when using a different compositor.

Troubleshooting

Add drm.debug=14 and log_buf_len=16M to your kernel parameters to turn on video debugging:

Create verbose Xorg log:

$ startx -- -logverbose 9 -verbose 9

View loaded video module parameters and values:

$ modinfo -p video

Disable MSI

If you are still having problems loading the module or starting the X server, append nouveau.config=NvMSI=0 to your Kernel parameters.

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/or prevent suspending on lid closure.

Kernel parameters

The problem can be overcome by disabling the phantom output (VGA-1 in the examples given) with Kernel parameters:

video=VGA-1:d

Where d = disable.

The nouveau kernel module also has an option to disable TV-out detection [2]:

 tv_disable=1

Xorg configuration

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

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

Source: https://web.archive.org/web/20170118202740/http://gentoo-en.vfose.ru/wiki/Nouveau#Phantom_and_unpopulated_output_connector_issues

Xrandr

Xrandr can disable the output:

 $ xrandr --output VGA-1 --off

This can be added to the xinit configuration.

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 Fedora:Common kernel problems#Systems with nVidia adapters using the nouveau driver lock up randomly for more information.

As an alternative, you can also use the QT_XCB_FORCE_SOFTWARE_OPENGL=1 environment variable to disable OpenGL acceleration in Qt applications.

Flat Panel Table Invalid

NVIDIA graphics cards with recent chipsets can cause startup issues - this includes X11 being unable to start and lspci freezing indefinitely[3][4][5][6][7].

This can break live distributions/installation media. This can be detected either by running lspci, or checking the systemd journal for the error:

nouveau E[     DRM]Pointer to flat panel table invalid

The system may start if the Nouveau driver is disabled by passing the following kernel parameters:

modprobe.blacklist=nouveau

The Nouveau driver can then be loaded using

# modprobe nouveau

The system should then function correctly. If you have another Nvidia graphics card, or just want to be safe, you can disable the offending card using:

$ echo 1 > /sys/bus/pci/devices/[card device id]/remove