[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Это старая версия документа!


Собственнические графические драйверы

Графическая система X.Org X11 обеспечивает большое количество драйверов и по крайней мере 2D видеоускорение для большинства видеокарт, однако, если система оснащена графическим процессором (видеокартой) от AMD (ATI) или NVIDIA, собственнические драйверы можно загрузить с веб-сайтов обоих этих производителей и установить.

Целью данной статьи является описание различных методов установки и настройки этих собственнических драйверов в Slackware.

Установка и настройка драйвера AMD (ATI) Catalyst

В AMD отказались от поддержки старых карт (4ххх и ниже) в текущем (12.6) и в будущих выпусках собственнических драйверов, поэтому убедитесь, что ваша карта все еще поддерживается. Если это не так, то xf86-video-ati с открытым исходным кодом должно быть достаточно, хотя оно несколько медленнее собственнических версий.

Получение драйвера

Обратите внимание, что программа установки будет компилировать драйвера (Fglrx) нуждается в пакетах kernel-modules и kernel-source для установки. Следующие шаги действительны для графической и CLI версии установщика.

Установка

Следующие инструкции предназначены для создания инсталляционного пакета для Slackware. Он создается программой установки автоматически и, кажется, работает достаточно хорошо в большинстве случаев. Существует также «автоматизированный» метод установки.

Катализатор и набор драйверов для Linux можно загрузить по этой ссылке. Файл подходит для 32 и 64-разрядных систем.

После скачивания, распакуйте файл:

$ unzip amd-driver-installer-VERSION-x86.x86_64.zip

Далее получите привилегии root:

$ su -

Переместитесь в каталог с файлом 'run' и запустите установщик:

# sh amd-driver-installer-VERSION-x86.x86_64.run

Программа установки будет собирать данные о вашей системе и подскажет как выбрать автоматическую установку или создать пакет для конкретного дистрибутива. Выберите создание пакета для конкретного дистрибутива, так как позднее он может быть установлен при помощи инструмента для работы с пакетами Slackware.

Когда будет предложено выбрать дистрибутив, выберите «Detected OS: Slackware/Slackware».

После его завершения сборки, установщик создаст инсталляционный пакет в том же каталоге, где находится файл run и теперь вы можете сделать:

# installpkg fglrx-VERSION-x86-1.tgz

Если были обнаружены ошибки во время установки вы можете увидеть их в/usr/share/ati/fglrx-install.log.

Настройка

Вам нужно будет перезагрузить систему для того, чтобы воспользоваться новыми драйверами. Прежде чем сделать это вам нужно отредактировать /etc/modprobe.d/blacklist.conf (или создать новый: /etc/modprobe.d/radeon_blacklist.conf) и добавить следующие строки в файл:

blacklist radeon
blacklist radeonhd

Затем вы можете создать новый конфигурационный файл X.Org, запустив:

# aticonfig --initial -f

X.Org обычно не требует файл /etc/X11/xorg.conf, но в некоторых случаях (как правило, старые карты) необходимо добавить следующую строку в разделе «Device»:

Option "SWCursor" "true"

Если бы не было никаких ошибоки драйвер был установлен успешно, вы должны перезагрузить сейчас для использования драйверов.

Проверка

После перезагрузки, вы можете проверить работу драйвера, запустив:

$ fgl_glxgears

Должны отобразится шестерни, вращающиеся плавно и без сбоев.

Автоматическая деинсталляция

Если вы выбрали автоматическую установку пакета и вам нужно удалить драйверы, вы можете запустить программу установки с дополнительным аргументом uninstall, вот так:

# sh amd-driver-installer-VERSION-x86.x86_64.run --uninstall

Или вызвать сценария удаления непосредственно:

#/usr/share/ati/amd-uninstall.sh
Независимо от того, как он был установлен, удаление драйвер fglrx «ломает» mesa, так как некоторые файлы перемещаются. В этом случае необходимо переустановить mesa. Кроме того, если вы хотите вернуться к собственным radeon/radeonhd драйверам, вы должны удалить строки из черного списка, добавленные ранее.

Установка и настройка драйвера nVIDIA

Установка из SlackBuilds.org

Эдвард Кениг поддерживает пакеты libvdpau, nvidia-driver и nvidia-kernel в SlackBuilds.org

All three packages are required to have a functioning nVIDIA driver. The nvidia-kernel package builds the kernel module, the nvidia-driver package builds the X.Org driver and contains the OpenGL implementation as well as the COMPAT32 libraries for use on a multilib Slackware64 system. The libvdpau package is a requirement of the nvidia-driver package.

''nouveau'' Module Removal

The first step in the driver installation is to blacklist the nouveau driver. Failure to do so may result in a startx error of «ERROR: could not insert 'nvidia': No such device».

Blacklisting the nouveau driver is done by installing the xf86-video-nouveau-blacklist package from the «extra» directory of the Slackware version. This can be accomplished by using the install CD or DVD, obtaining the file from a Slackware mirror, or using the slackpkg utility.

Package Installation

There are currently two ways to install packages from SlackBuilds.org:

  • by downloading the appropriate build scripts from SBo, and following the SlackBuild installation procedure
  • by using the tool sbopkg which automates downloading the sources and the sequential compilation/installation of multiple packages.

Once the packages have been installed via the instructions accompanying each SlackBuild, the X11 server can be started with full GPU support.
To configure X11 to start automatically, please see «Starting X11 with nvidia GPU Support» in the following section.

Troubleshooting

FIXME

Installation via the nVIDIA Binary

Installing the nVIDIA binary driver involves the following steps:

  • Downloading the appropriate nvidia driver installer package
  • Disabling and unloading the nouveau driver
  • Installing the nvidia driver
  • Optionally, configuring the system to start the graphical interface automatically

The following tip lists the key steps for installing the nvidia driver. The full article follows.

For those who just want the appropriate commands, here is a summary of the following:
  • Go to the nVIDIA Unix Drivers website and download the appropriate driver. The name of the driver package will be something like «NVIDIA-Linux-ARCH-VERSION.run» where ARCH is the computer's processor architecture and VERSION is the driver version.
  • Ensure that X11 is not running; if it is, exit it and login to the text console
  • Logged in as root, run the nVIDIA installer with
    # sh /path/to/NVIDIA-Linux-ARCH-VERSION.run
  • If prompted to blacklist nouveau, do so and restart
  • Launch the installer with root permissions once more after restarting
  • At a minimum, choose to accept the license and install the driver. Please consult the nVIDIA Installer Options section for automatic installer options.

If nvidia-xconfig is not run by the installer, then it can either be run upon exiting the installation and before launching the X11 server or the «/etc/X11/xorg.conf» file should be edited manually.

Downloading the Appropriate nVIDIA Driver Binary Installer

The first step is to download the appropriate driver from the nVIDIA Unix Drivers website . For 64-bit Slackware (including multilib systems) you should download the «Linux x86_64/AMD64/EM64T» driver package, while 32-bit Slackware needs the «Linux x86/IA32» driver. Your safest bet for picking the correct version is to use the «Latest Long Lived Branch version» but in some cases (very new graphics card, or display issues which you are trying to resolve) you might want to choose «Latest Short Lived Branch version» instead.
Older legacy drivers are available as well for graphics cards which are no longer current. When you select a driver, a list of compatible GPUs will be displayed. Once you have determined the correct driver, the license will need to be accepted and the file saved in an accessible location. Before running the installer, there are some other actions that must be taken.

Disabling the nouveau Module

In general, an nVIDIA GPU will be detected by the Slackware system, and the «nouveau» OSS graphics driver will be enabled on the system. This will allow 3D video acceleration on many cards. The nouveau and nvidia modules are incompatible; thus, before proceeding with the installation of the nvidia module, the nouveau module must be removed and kept from being loaded automatically on boot by the kernel.

To accomplish this, a file must be created in the «/etc/modprobe.d/» directory containing the text

blacklist nouveau
options nouveau modeset=0

and named appropriately; for instance, «disable_nouveau.conf»

The first line will block the nouveau module from being loaded automatically during start-up. The module will still be able to be loaded manually by a user or by the X server. Thus, the second line is added, so that should the nouveau module be loaded, it will be prevented from doing a kernel modeset, allowing the module to be unloaded.1)

As mentioned in the modprobe.d README file, the monolithic module blacklist file has been split into smaller files and stored under /lib/modprobe.d/ However, a .conf file in the /etc/modprobe.d/ directory will override one in /lib/modprobe.d/ This is thus a more sure way to block the loading of the nouveau driver.

After displaying an error to the effect that the nouveau and nVIDIA proprietary drivers are incompatible, newer nVIDIA installers will prompt for permission to create a .conf file to blacklist nouveau in /etc/modprobe.d/ which will be named nvidia-installer-disable-nouveau.conf By default, the contents of this file will be:

# generated by nvidia-installer
blacklist nouveau
options nouveau modeset=0

The installer will then state that it has failed and request that the system be restarted to put changes into effect. Once the system has been restarted, the nouveau driver will no longer be loaded, and installation of the binary driver can continue.

Alternately, the package xf86-video-nouveau-blacklist from the «/extra» directory of the Slackware installation media should be installed. Once installed, the system should be restarted, at which point driver installation can continue.

nVIDIA Binary Driver Installation

nVIDIA binary driver installation can not be completed while the X11 Window System is active.

The default behavior of Slackware is to boot into a text-only terminal. In this case, the nVIDIA installer can simply be run. However, if the graphical environment was already launched, it must be exited. If lunched with the «startx» command, closing the graphical environment can be accomplished by logging out or, and only if necessary, pressing Ctrl+Atl+Bksp.

If using a graphical login manager, such as KDM, simply exiting via the menu or pressing Ctrl+Alt+Bksp will not work because the graphical login manager will be restarted automatically.
The best way to shut down X gracefully is by logging off, switching to a conole terminal by pressing Alt+F2, logging into the console as root and running:
telinit 3

Another method to return to the console, crude and thus not recommended but effective if necessary, is to stop/kill the DM and then exit the X Server by pressing Ctrl+Atl+Bksp. For example, KDM can be killed by issuing the command

killall -9 kdm

Again, this should only be used if other methods fail.

Once X11 is no longer running, the nVIDIA installer can be launched as root. Either log in as root or issue the «su -» command, then run the installer. Sometimes, it is advantageous to run the installer using some of the available command-line options. For more information, consult «nVIDIA Installer Options» at the end of this section.

$ su -
Password:
# sh /path/to/NVIDIA-Linux-ARCH-VERSION.run

When the installer is launched without any command line options and excepting any errors, the installation will proceed as follows:

  • The installer will extract itself and start an ncurses interface. The first step is to accept the license terms.
  • When installing the module for a system that has no previous version, the installer will begin to build the module. If, however, a previous nVIDIA driver was found, the installer will prompt for permission to remove the previous driver as part of the new installation. To proceed with the installation, permission should be granted to remove the previous installation.
  • After building the module on x86_64 systems, the installer will prompt about installing nVIDIA's 32-bit compatibility OpenGL libraries. You will only need the 32-bit compatibility libraries if your Slackware is 64-bit multilib.
  • Next, in the case of a previous version, the installer will uninstall the module.
  • Once no conflicting X and (should this option be chosen) OpenGL files are found, the module will be installed.
  • The program will then offer to use the nvidia-xconfig utility to modify the xorg.conf file to reflect the change in video drivers. This utility often works, but could possibly change other values in xorg.conf. It does, however, back-up the original file to «/etc/X11/xorg.conf.nvidia-xconfig-original»
  • A prompt confirms that the driver installation is complete and was a success, at which point the program exits to the console.

The nvidia module should now be installed for the currently running kernel.

You must create an X.Org configuration file which loads the binary Nvidia driver if you decided not to let the nvidia-xconfig utility modify your computer's xorg.conf file. The X.Org of Slackware supports individial «*.conf» files in a directory /etc/X11/xorg.conf.d. Any file with a .conf extension will be included together with the main /etc/X11/xorg.conf file.
You could create for instance a file named /etc/X11/xorg.conf.d/10-nvidia.conf with the following content:

Section "Device"
    Identifier  "Device0"
    Driver  "nvidia"
    VendorName "Nvidia Corporation"
    BoardName ""
EndSection

Without this definition, you will not get accelerated Nvidia GPU support! X.Org would fall-back to VESA mode because the nouveau driver has been blacklisted. The kernel will not auto-detect the binary driver as opposed to the nouveau driver.

Starting X11 with nvidia GPU Support

All that remains is to start the X.org server. This can be accomplished by configuring Slackware to start in runlevel 4, which will start a graphical login manager, such as KDM or XDM, on boot. If you want this, then you need to edit the file «/etc/inittab» and change the line

id:3:initdefault:

to

id:4:initdefault:

Otherwise you can login to a user account and issue the «startx» command to start an X session.

By default, startx will start the window manager which was chosen during installation. To change this behavior, the file «.xinitrc» in the user's home directory can be edited to start a different WM.
Alternatively, the default WM can be altered on a per-user basis by using the command «xwmconfig» and selecting one of the available WM's.
nVIDIA Installer Options

The nVIDIA Installer has many options available to the system maintainer which can be accessed by running the installer with the -A option:

# sh ./NVIDIA-Linux-ARCH-VERSION.run -A

Some common options are

  • -a, --accept-license : bypasses the nVIDIA license screen. By doing so, the license is accepted.
  • --update : check for an updated driver on the nVIDIA website; if it exists, automatically download and install the new version.
  • --uninstall : removes the nVIDIA driver and other files installed previously.
  • -q, --no-questions : assumes default answers to all questions. Note: does not automatically accept the license.
  • -s, --silent : runs the binary installer without a curses UI, automatically accepts the license and uses the default answers for all questions.

Troubleshooting

FIXME

Sources

  • nVidia section originally written by rinias

Translation in progress. (drhouse123)

 ru:howtos:hardware:proprietary_graphics_drivers ()
Этот перевод старее, чем оригинальная страница, и может быть неактуальным. Смотрите, что было изменено.
Перевод этой страницы?: