Nouveau linux ��� ����������

Linux для человеков!

Обзоры

Фотогалереи

Помощь при использовании сайта

Новое из блога

Nouveau снова торт! Установка Nouveau в Gentoo Linux

Nouveau — открытый драйвер для видеокарт nVidia с хорошей поддержкой 2D в адрес которого мной было сказано немало «лестных слов». Слава б*гу время идет и сейчас этот драйвер может быть достойной альтернативой блобу от nVidia. Сразу скажу, что в Linux мне не нужен 3D, поэтому я не фапаю на FPS и различные бенчмарки OpenGL. Мне нужен быстрый, 2D и мне не хочется после каждой пересборки ядра пересобирать модуль nvidia, реактивное переключение консоль (framebuffer) и поддержка нативного (1920×1080) разрешения в консоли. Все это умеет Nouveau, а большего от него мне как и многим другим не требуется. Покончим с вступлением и перейдем к делу.

Перво наперво нам нужно собрать ядро с поддержкой DRM (Direct Rendering Manager). Лучше всего собирать самое новое, так как драйвер активно дорабатывают. На данный момент это 2.6.36. Собрать его нужно не модулем, а вкомпилить прямо в ядро. Включается это в

Включить модулем Nouveau который находится в

Выключаем в конфигурации ядра все фреймбуферы, такие как VESA, nVidiaFB и т.д, но общую поддержку framebuffer оставляем. Далее собираем и устанавливаем ядро и загружаемся с него. Строки передачи параметров видео режима ядру например таких как vga=791 и video=uvesafb.. лучше удалить. При использовании проприетарного драйвера nVidia его надо выгрузить, а nouveau наоборот добавить в автозагрузку. Загрузившись с нового ядра и увидев, что подхватилось нативное разрешение монитора воспряли духом, но нам этого мало — нужно чтобы с этим драйвером работали X’ксы.

Источник

Nouveau

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.

Contents

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 repostory.
  • For the DDX driver (which provides 2D acceleration in Xorg), install the xf86-video-nouveau package.

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 all 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 exists and is referencing nvidia 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):

Читайте также:  Windows cmd copy all folders

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

Re-generate the initial ramdisk image:

If you are 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 (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:

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:

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

Then load the ‘nouveau’ module:

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

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:

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

Fan control

If it is implemented for your card you can configure fan control via /sys .

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:

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

The factual accuracy of this article or section is disputed.

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:

Troubleshooting

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

Create verbose Xorg log:

View loaded video module parameters and values:

Disable MSI

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

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:

Where d = disable.

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

Xorg configuration

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

Xrandr

Xrandr can disable the output:

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.

Читайте также:  Bios не видит загрузочную флешку linux

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

This article or section needs expansion.

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:

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

The Nouveau driver can then be loaded using

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:

The NVIDIA proprietary driver currently works correctly (version 381).

Источник

Installing Nouveau on your Linux computer

There are two ways of installing Nouveau on your Linux computer. The most recommended way is to use your distribution-provided packages. If those are outdated or buggy, you may also recompile Nouveau from source.

Nouveau is incompatible with NVIDIA’s proprietary driver. If you want to use Nouveau, you first need to remove the proprietary driver from your system.

Using your distribution’s packages

The following information are provided to the best of our knowledge. Please seek help on your distribution’s wiki if you have any problem installing or uninstalling Nouveau.

Compiling Nouveau from source

Instead of using the distribution-provided binaries, you can also recompile Nouveau yourself. There are several reasons to want to compile Nouveau from source, here are the most common ones:

  • Testing the latest version on Nouveau;
  • Bug fixing — checking if a bug in a stable version is still present in the development branches or testing a patch;
  • Contributing code — Developers are expected to test and implement new code on the development branches.

Whatever your reason is, the development team thanks you for living on the edge. Please tell us as soon as possible when you encounter a bug!

Nouveau is split into 4 main parts:

  • Nouveau DRM : The privileged part of Nouveau, running in the kernel;
  • Libdrm : A library that wraps the DRM & Nouveau IOCTLs, it simplifies memory management and command submission;
  • xf86-video-nouveau : The device-dependent part of X (DDX) for NVIDIA cards whose role is to provide 2D acceleration (EXA) and some simple video acceleration (XV);
  • Mesa : It provides 3D, GPGPU and video acceleration to open source drivers. For more information, please read MesaDrivers.

Kernel

The kernel modules required by Nouveau ( drm.ko , drm_kms_helper.ko , ttm.ko and nouveau.ko ) are built from a Linux kernel tree. You have several options on how to download the source code (subsections of Section 1) and how to compile it (subsections of Section 2). See also KernelModeSetting for important KMS notes. Please, read carefully.

The Nouveau kernel git repository contains one recommended branch: linux-5.5 .

You may not be able to compile the DRM modules against your current kernel, if it is too old (might need an -rc kernel or even Linus’ git kernel). The possible errors include build failure and kernel modules that cannot be loaded. It is recommended to build your whole kernel from this branch (Section 2.1).

Since the DRM code is part of the kernel since 2.6.33, you can also use Linus’ git kernel for Nouveau. However, the code in Linus’ kernel will always be older than Nouveau’s own git, and because there are no official Nouveau releases, you may encounter compatibility issues with user space parts (libdrm, DDX, Mesa).

Getting the source code

You have multiple choices when it comes to downloading the source code:

  • Get the full Nouveau kernel tree, with full history : Best for developers and people willing to bisect regressions;
  • Get the full Nouveau kernel tree, without history: For continuous testers with a data cap on their internet plan;
  • Get a snapshot: For occasional testers with an internet data cap (out-of-the-tree compilation only).
Читайте также:  Genius pensketch 9x12 windows 10

In order to download the full Nouveau kernel tree, please run the following command (un-comment —depth=1 if you don’t want the full history):

There is also an out-of-tree version of the module that you can get at:

Full kernel compilation

This method cannot be applied if you only downloaded a snapshot of Nouveau. Please download a complete version of the Nouveau tree.

The configuration and installation parts are distribution-dependent. You can find some instructions for ArchLinux, Debian, Gentoo, Ubuntu or Fedora.

Please make sure CONFIG_DRM_NOUVEAU=m, otherwise Nouveau won’t be compiled in the kernel.

Out-of-the-tree compilation

The out-of-the-tree builds are mostly used by developers or testers who recompile their kernel often with some custom patches. The out-of-the-tree build will only recompile the nouveau driver, which should be orders of magnitude faster than a full kernel recompilation. However it has to be done against a compatible kernel, since it relies on a lot of internal kernel APIs

In order to use the out-of-the-tree compilation, clone the out-of-tree module and run the following commands:

Then, you should insmod the nouveau.ko module which is compiled (make sure to also modprobe its deps). It is also possible to install them but this isn’t recommended.

WARNING: To use this technique, you will be required to be running at least the same major version of the kernel as one you want to compile out of the tree. If the kernel hasn’t been released yet, please compile, install and reboot a kernel compiled from the full Nouveau tree before attempting again.

Run-time configuration

Userspace

The following tutorial will help you compile and install Nouveau in a user directory. This will lower your chances of messing up your whole system. Each package’s instructions assume that you have the proper header files installed. If you’re on a Debian-based distro (including Ubuntu), you can run apt-get build-dep mesa to make sure that this happens.

However, if you need to recompile xf86-video-nouveau and your distribution-provided libdrm isn’t sufficient, you will need to set NVD to /usr and install libdrm, mesa and xf86-video-nouveau.

If you are not in this case, please source the following script (nouveau-env.sh) in every console where you need to do Nouveau development:

Sourcing the file can be done by running command:

Libdrm

Here are the commands to compile libdrm from git:

Xf86-video-nouveau

Let’s now recompile Nouveau’s X.org driver (DDX) from git:

You’ll then need to tell the X-server where to look for nouveau_drv.so. To do so, please create a configuration file at /etc/X11/xorg.conf.d/01-module-path.conf containing:

WARNING: Please replace /same/path/as/NVD/ by the path you set for $NVD.

WARNING2: If you managed to break your graphical interface. You can revert back to the previous ddx by deleting 01-module-path.conf.

Mesa can be compiled by running the following commands:

LibVDPAU (optional, only useful for video decoding)

The libvdpau will look for libvdpau_nouveau.so in the same prefix as it was installed (regardless of LD_LIBRARY_PATH). We thus need to recompile libvdpau and install it to the same prefix as mesa in order for it to use the right libvdpau_nouveau.so.

Configuring the X server

When using Nouveau, the X-Server doesn’t need configuration, the Nouveau driver should be loaded automatically. If it wasn’t the case, you may want to try to force the X-server to load the Nouveau driver. To do so, please create the file /etc/X11/xorg.conf.d/20-nouveau.conf and write the following:

It is possible to give some options to the Nouveau DDX. Please have a look at our man page (man 4 nouveau). For more information, please follow the instructions found in the distribution-specific section.

Источник

Оцените статью