Linux установить драйвер nouveau

Установка nVidia в linux

Материал из Пингвиньи радостей

Содержание

Статья об установке видеокарт nVidia в linux

Статья даёт описание установки и настройки видеокарт nVidia в Linux. Описание осуществляется на примере операционной системы debian (squeeze). Для получения дополнительной информации по данной теме смотри Установка видеокарт в linux.

Официальный сайт изготовителя видекарт: http://www.nvidia.ru

Обзор режимов работы видеокарт nVidia

Видеокарты nVidia в linux могут работать в текстовом и графическом режимах. Для запуска видеокарты в текстовом режиме (в режиме консоли) не требуется дополнительных действий. Для использования графического режима требуется установка/настройка X-сервера и подключение/указание «графических» драйверов. Могут быть использованы драйвера как включённые в дистрибутив (debian), так и драйвера поставляемые изготовителем видеокарт. В графическом режиме видеокарты nVidia поддерживают как 2D так и 3D ускорение графики.

Поддержка работы видеокарты в графическом режиме осуществляется пакетом Xorg. Подключение установленных драйверов и настройка видеокарты осуществляется в файле конфигурации Xorg — /etc/X11/xorg.conf. Если драйвер видеокарты в файле конфигурации не указан или самого файла нет вовсе, операционная система (например debian squeeze) самостоятельно определит и установит совместимый драйвер.

Для установки графических режимов видеокарт nVidia могут быть использованы

  • драйвера из пакета Xorg — vesa, nv, nouveau
  • драйвер nvidia из дистрибутива поставки debian
  • или драйвер nvidia предоставленный изготовителем

Драйвер vesa

Видеокарты nVidia поддерживают работу в графическом режиме vesa. Описание настройки X-сервера и /etc/X11/xorg.conf в режиме vesa приведено в статье Xorg. Для получения дополнительной информации по данной теме смотри Установка видеокарт в linux.

Драйвер nv

Драйвер nv осуществляет поддержку 2D/3D ускорения.

Для подключения драйвера

Драйвер nouveau

Драйвер nouveau осуществляет полноценную поддержку 2D/3D ускорения. Драйвер требует ядра linux 2.6.32 или выше. В отличие от проприетарного драйвера nvidia nouveau корректно (то есть стандартным образом) поддерживает возможности X-системы Например поддержку через xrandr несколько мониторов.

Для подключения драйвера

  • удаляем (если были установлены) все драйвера nvidia-glx
  • устанавливаем драйвер xorg-nouveau
  • добавляем в файл конфигурации X-сервера/etc/X11/xorg.conf секцию
  • (возможно необязательно?) проверяем модуль и добавляем загрузку драйвера nouveau при старте
  • перезапускаем X-сервер

Драйвер nvidia

Драйвер nvidia осуществляет полноценную поддержку 2D/3D ускорения.

Получить и установить драйвер можно тремя способами:

  • установка закрытых драйверов изготовителя
  • установка готовых (бинарных) OpenSource пакетов с драйверами
  • сборка драйверов под свою машину из исходников

Установка проприетарных драйверов

Для установки драйвера

  • открываем страницу загрузки драйвера
  • выбираем нужную архитектуру и скачиваем установщик
  • получаем права суперпользователя
  • останавливаем X-сервер (например так # killall Xorg или так # /etc/init.d/kdm stop для менеджер дисплея Kdm)
  • смещаемся в каталог с драйвером # cd

и

  • запускаем установщик (напр.): # sh NVIDIA-Linux-. -pkg1.run
  • добавляем в файл конфигурации X-сервера/etc/X11/xorg.conf секцию
    • перезапускаем рабочую станцию
    • проводим тестирование ускорения 3D

    Установка свободных бинарных драйверов

    (незавершенный раздел)
    Дистрибутив Debian распространяет через свои хранилища и бинарные драйвера для видеокарт nVidia. При смене ядра (upgrade системы) 3D драйвера следует перекомпилировать. Проще всего это сделать путем переустановки используемых пакетов.

    Для установки свободных бинарных драйверов

    • получаем права суперпользователя
    • устанавливаем необходимые пакеты
    • перезапускаем рабочую станцию
    • проводим тестирование ускорения 3D

    Компиляция драйверов из исходников

    (незавершенный раздел)
    Компиляция драйверов из исходников включённых в дистрибутив Debian позволяет собрать драйвера для видеокарт nVidia в том случае если бинарные пакеты не заработали.

    Для компиляции драйверов из исходников

    • устанавливаем сборщик модулей как описано в статье Module-assistant
    • компилируем и устанавливаем модуль
    • добавляем в файл конфигурации X-сервера/etc/X11/xorg.conf секцию
    • перезапускаем рабочую станцию
    • проводим тестирование ускорения 3D

    Настройка отдельных видеокарт

    В таблице приведены ссылки на статьи в википедии с описание настройки отдельных видеокарт nVidia

    Источник

    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):

    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.

    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).

    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.

    Источник

    Читайте также:  Canon lide 120 драйвер linux
    Оцените статью