Nouveau: Difference between revisions
(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]] | ||
[[ | [[fr:Nouveau]] | ||
[[ja:Nouveau]] | [[ja:Nouveau]] | ||
[[zh-hans:Nouveau]] | |||
[[zh- | |||
{{Related articles start}} | {{Related articles start}} | ||
{{Related|NVIDIA}} | {{Related|NVIDIA}} | ||
Line 12: | Line 12: | ||
{{Related articles end}} | {{Related articles end}} | ||
This article covers | 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 [ | 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| | [[Install]] the {{Pkg|mesa}} package, which provides the DRI driver for 3D acceleration. | ||
For | * 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 | * 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 | * 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 [ | [[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= | 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"}} | ||
To finish, [[regenerate the initramfs]]. | |||
== 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 | ||
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 | |||
=== Installing the latest development packages === | === Installing the latest development packages === | ||
To get the latest Nouveau improvements | |||
* | *{{AUR|linux-git}} | ||
* | *{{AUR|libdrm-git}} | ||
* | *{{AUR|lib32-libdrm-git}} | ||
* | *{{AUR|lib32-mesa-git}} | ||
*{{AUR|mesa-git}} | |||
*{{AUR|xf86-video-nouveau-git}} | |||
=== Dual head === | |||
See [[Multihead#RandR]] how to setup multiple monitors by using [[Wikipedia:RandR|RandR]]. | |||
=== Setting console resolution === | |||
You can pass the resolution to nouveau with the {{ic|1=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 [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}}. | |||
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 | ==== Fan control ==== | ||
If it is implemented for | 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! | {{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: | ||
* | * 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 === | |||
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 === | |||
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 | 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) | 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 | 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 | |||
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 |
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.
- For 32-bit application support, also install the lib32-mesa package from the multilib repository.
- For the DDX driver (which provides 2D acceleration in Xorg), install the xf86-video-nouveau package.
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
orvga=
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 thenvidia
driver. It is probably a good idea to rename the file.
Enable early KMS
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
- linux-gitAUR
- libdrm-gitAUR
- lib32-libdrm-gitAUR
- lib32-mesa-gitAUR
- mesa-gitAUR
- xf86-video-nouveau-gitAUR
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
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%.
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:
- https://floppym.blogspot.de/2013/07/fan-control-with-nouveau.html
- https://web.archive.org/web/20141031191559/https://kalgan.cc/blog/posts/Controlling_nVidia_cards_fans_with_nouveau_in_Debian/
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
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
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