Manjaro Настройка видеокарт

Настройка видеокарт

From Manjaro
Revision as of 16:44, 11 December 2022 by Krotesk (talk | contribs) (Created page with "Сам по себе подход "сделай сам" является относительно простым и понятным с помощью команды mhwd. Е...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Other languages:
English • ‎Türkçe • ‎русский • ‎中文(中国大陆)‎

Обзор

Note
Команда mhwd все еще находится в стадии разработки и в настоящее время способна устанавливать драйверы только для видеокарт, подключенных по протоколу pci.

При установке полной версии Manjaro (т.е. с предустановленным окружением рабочего стола, кодеками и программами) команда mhwd будет автоматически выполняться программой установки GUI и CLI для автоматического определения вашей видеокарты и установки наиболее подходящего для нее драйвера. Будут ли установлены свободные или проприетарные драйверы, будет зависеть от вашего первоначального выбора использования свободных или несвободных видеодрайверов при загрузке. В противном случае, необходимо будет выполнить команду mhwd вручную как часть процесса после установки минималистичного NET-издания Manjaro.

Для новичков рекомендуется использовать "Обнаружение оборудования" в Менеджере настроек Manjaro для изменения или установки новых графических драйверов
. Для средних и опытных пользователей также можно использовать команду mhwd для установки, переустановки и удаления установленных видеодрайверов в любое время, как показано ниже.

Автоматическое распознавание и установка

Это рекомендуемый метод обнаружения и установки видеодрайверов. Синтаксис метода автоматической установки следующий:

user $ sudo mhwd -a [pci или usb подключение] [free или nonfree драйверы] 0300 COPY TO CLIPBOARD


Ниже приводится описание команд, используемых для автоматизированного метода:

  • -a: автоматическое обнаружение и установка соответствующего драйвера
  • [pci или usb]: установка соответствующего драйвера для устройств, подключенных к компьютеру через pci или через usb (опять же, на данном этапе разработки mhwd поддерживает только pci)
  • [free или nonfree]: установка либо бесплатных драйверов (например, предоставленных сообществом Linux), либо несвободных драйверов (например, предоставленных производителями оборудования)
  • 0300: определить, что драйвер должен быть установлен для видеокарты (0300 - это идентификатор для видеокарт. По мере развития команды mhwd будут использоваться новые идентификаторы для других аппаратных устройств).


Например, следующая команда приведет к автоматическому обнаружению и установке наилучшего доступного проприетарного драйвера для видеокарты, подключенной через pci-соединение:

user $ sudo mhwd -a pci nonfree 0300 COPY TO CLIPBOARD



В противном случае следующая команда приведет к автоматическому обнаружению и установке лучшего из доступных бесплатных драйверов для видеокарты, подключенной к pci-порту:

user $ sudo mhwd -a pci free 0300 COPY TO CLIPBOARD


Ручное распознавание и установка

Сам по себе подход "сделай сам" является относительно простым и понятным с помощью команды mhwd. Его следует применять в два этапа:

1. Определить соответствующий драйвер для установки, а затем

2. Установить его



Tip
Просто убедитесь, что вы определили и действительно собираетесь установить правильный драйвер для вашей конкретной видеокарты!


Определение доступных драйверов

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

user $ mhwd -l [дополнительно: подробный просмотр] [дополнительно: --pci или --usb подключение] COPY TO CLIPBOARD


Использование этой команды без дополнительных опций выведет список базовой информации для всех доступных драйверов устройств, подключенных к вашей системе. Все драйверы видеокарт будут иметь префикс (video-) в своем названии. Основная информация, предоставленная для всех перечисленных драйверов, будет следующей:

  • Название
  • Версия
  • Свободная или проприетарная, и
  • PCI или USB соединение


Более подробный список установленных драйверов можно получить, введя:

user $ mhwd -l -d COPY TO CLIPBOARD


Подробный список предоставит следующую информацию:

  • Название
  • Версия
  • PCI или USB соединение
  • Описание
  • Приоритет
  • Свободная или проприетарная
  • Зависимости
  • Конфликты
  • Идентификатор класса (например, '0300' для драйверов видеокарт), и
  • Идентификатор поставщика


Кроме того, использование фильтра --pci в следующем примере выведет список подробной информации только для драйверов, доступных для устройств (например, видеокарт), использующих внутреннее PCI-соединение:

user $ mhwd -l -d --pci COPY TO CLIPBOARD


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

To install a driver for a graphics card, the syntax is:

user $ sudo mhwd -i pci [name of driver] COPY TO CLIPBOARD



A breakdown of the command used to manually install a driver is as follows:

  • -i: Install a driver
  • [pci]: Install a driver for a device connected internally via pci (e.g. graphics cards)
  • [name of driver]: The name of the driver to be installed

For example, to install the proprietary nvidia graphics card driver, the following command would be used:

user $ sudo mhwd -i pci video-nvidia COPY TO CLIPBOARD


Принудительная переустановка драйвера

Warning
use this command with care!

To force the re-installation of an existing driver without removing it first, the syntax is:

user $ sudo mhwd -f -i pci [название драйвера] COPY TO CLIPBOARD


For example, to force the re-installation of a previously installed nvidia graphics card driver, the following command would be used:

user $ sudo mhwd -f -i pci video-nvidia COPY TO CLIPBOARD


Удаление установленного драйвера

On occasion it may be necessary to remove an installed graphics card driver. Similarly to manually installing a graphics card driver, two steps should be undertaken for removal:

1. Identify the installed driver

2. Remove the identified driver

After all, it would be somewhat difficult to remove an installed driver if you don't know what it's called!


Распознавание установленных драйверов

To identify and list Manjaro's installed drivers - including the graphics driver to be removed, the syntax is:

user $ mhwd -li [optional: detailed view] [optional: pci or usb devices only] COPY TO CLIPBOARD


Using this command without the additional options will list the basic information of all the drivers currently installed on your system. Once again, all drivers for graphics cards will have the prefix (video-) in their name. As with listing drivers available for your system, the -d option used in the following command will list detailed information:

user $ mhwd -li -d COPY TO CLIPBOARD


This information may prove useful to determine any otherwise unforeseen consequences or problems upon removing a driver. And again, it is also possible to filter your list of installed drivers by whether they are used on hardware connected via pci or usb. In this instance, a detailed list will be generated only for installed drivers used on hardware with a PCI connection:

user $ mhwd -li -d --pci COPY TO CLIPBOARD


One other way of reporting drivers installed andin use is using the inxi tool.

user $ inxi -G COPY TO CLIPBOARD



Note
The mhwd profile 'video-linux' corresponds to the latest opensource driver availablefor your hardware.
Note
The mhwd profile 'video-vesa' is a generic fallback driver which should not be used in the vast majority of cases.

Удаление установленных драйверов

Warning
use this command with care!

To remove an installed driver, the syntax is:

user $ sudo mhwd -r [pci or usb] [name of driver] COPY TO CLIPBOARD


For example, to remove the installed driver for a nvidia graphics card (connected internally via pci), the following command would be used:

user $ sudo mhwd -r pci video-nvidia COPY TO CLIPBOARD


Проверка конфигурации

You can check configuration with:

user $ sudo mhwd-gpu --check COPY TO CLIPBOARD


user $ mhwd-gpu --status COPY TO CLIPBOARD


And if needed fix issues with:

user $ sudo mhwd-gpu --setmod COPY TO CLIPBOARD


user $ sudo mhwd-gpu --setxorg [PATH] COPY TO CLIPBOARD


Make sure the path to xorg config file is valid.

Note about ati, xorg file and login artifacts or kicad: if you get artifacts upon logging in or if kicad rendering and zooming is slow, try adding [Option "EXAPixmaps" "off"] in the "Device" section of xorg config file. See here.

Двойной GPU

Разгрузка ПЕРВИЧНОГО GPU

If your hardware includes more than one GPU card you can make use of PRIME offloading. PRIME is a technology used to manage hybrid graphics found on recent desktops and laptops (Optimus for NVIDIA, AMD Dynamic Switchable Graphics for Radeon). PRIME detects both cards and automatically selects Intel card by default; using the more powerful discrete graphics card, when called, for more demanding applications.

In Manjaro this will automatically be available for hybrid graphics systems using intel/modesetting for the integrated card and free drivers (AMDGPU or Nouveau) for the dGPU.

You may choose to run a program with a specific GPU, prepending the application's command with DRI_PRIME=x, where x is the card priority number.

For example, to run an application using the second card prepend the application command with DRI_PRIME=1

user $ DRI_PRIME=1 glxspheres64 COPY TO CLIPBOARD


To use the 1st card (usually when the CPU has an embedded GPU, this is used)

user $ DRI_PRIME=0 glxspheres64 COPY TO CLIPBOARD


If you want to always run some application with the discrete gpu, you may copy that application's .desktop file to ~/.local/share/applications/ and edit the "Exec" property

user $ Exec=DRI_PRIME=1 inkscape COPY TO CLIPBOARD


Some applications (usually games like steam) may have an embedded option to specify the command line, where it is preferred to use this way.

For example, in Steam, select a game - that you want to run using your discrete Nvidia card - from the Library page of the Steam client, right-click, and select Properties. Click the SET LAUNCH OPTIONS... button and specify for the command line options followed by the default launch hook %command%.

DRI_PRIME=1 %command%

To use the dGPU by default see Reverse Prime

Проприетарные (несвободные) драйвера NVIDIA

If you have a Nvidia card, you have the option to use the proprietary (closed source = non-free) drivers instead of the open source (free) nouveau driver.

For Legacy/older nvidia cards, Manjaro maintains older drivers for compatibility. In these cases the driver name is different, instead of nvidia it is nvidia-390xx or nvidia340xx, whether in nvidia-only or bumblebee mhwd driver configuration.

When you install the non-free driver, mhwd includes a Nvidia utility "Nvidia Settings Utility" that can help you configure several settings. You can find this utility in your GUI Applications Menu or start it from a terminal

user $ sudo nvidia-settings COPY TO CLIPBOARD


If you are using bumblebee, the nvidia utility needs a special command

user $ sudo optirun -b none nvidia-settings -c :8 COPY TO CLIPBOARD


Nvidia Optimus

For Optimus laptops or dual GPU hardware with intel and nvidia GPUs, you have three options to utilize the card driver usage at your preference or your hardware capabilities.

PRIME (mhwd default)

Bumblebee

Optimus Manager

When you install Manjaro with the non-free option selected from Grub menu, or when you use automatic driver installation, PRIME or bumblebee is installed by default, depending on support for your GPU, PRIME being preferred. In these cases, the mhwd driver is named "video-hybrid-intel-nvidia-***xx-prime" or "video-hybrid-intel-nvidia-***xx-bumblebee".


Configure The Resolution/Refresh Rate

Warning
The method provided does not currently work for the Cinnamon Edition. As soon as a solution is found, then this article will be updated.


1. Start nvidia-settings utility

2. Change resolution and refresh rate in 'X Server Display Configuration' tab.

3. Hit the 'Save to X Configuration File' button and save to /etc/X11/mhwd.d/nvidia.conf

4. Now start your terminal and enter the following command to complete the process:

user $ sudo mhwd-gpu --setmod nvidia --setxorg /etc/X11/mhwd.d/nvidia.conf COPY TO CLIPBOARD


Настройка параметров X Screen (настройки OpenGL, сглаживание, X Server XVideo)

1. Start nvidia-settings utility

2. Change settings in X Server XVideo Settings, OpenGL and Antialiasing, in the 'X Screen' tab.

3. Click on 'nvidia-settings configuration' tab and click on the 'Save Current Configuration' button.

4. Save the .nvidia-settings-rc to the default location specified (/home/[your account name])

5. Edit the .xinitrc file with your preferred text editor. For example, if you use gedit, run this in your terminal:

user $ gedit ~/.xinitrc COPY TO CLIPBOARD


6. Once opened, add the following line into the configuration file:

user $ exec nvidia-settings --load-config-only COPY TO CLIPBOARD


7. Save and exit.

Настройки Nvidia для особых случаев

In case your monitor is not entering powersave mode (DPMS), try adding `Option "HardDPMS" "true"` in your Xorg monitor section. For example:

  Section "Monitor"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "BenQ ZOWIE XL LCD"
    HorizSync       30.0 - 160.0
    VertRefresh     56.0 - 144.0
    Option         "DPMS"
    Option         "HardDPMS" "true"
  EndSection


After forum issue


nvidia-prime

Manjaro also offers an easy way to use PRIME with proprietary Nvidia drivers.
Simply select and install an 'nvidia-prime' profile through MSM or mhwd (such as video-hybrid-intel-nvidia-440xx-prime) and ensure the package nvidia-prime is installed.

Then to use the discrete Nvidia card it works the same as PRIME offloading above but uses a different command. Prepend the application command with prime-run. For example:

user $ prime-run glxspheres64 COPY TO CLIPBOARD


For more info see archival post on early adoption of PRIME

Bumblebee

Bumblebee configuration is mainly developed to help minimize laptop battery consumption, since Nvidia usually consumes significant power, while Intel cards are more power efficient. So, bumblebee detects both cards and automatically selects Intel card by default and can use the Nvidia for more demanding applications. For an application to use the Nvidia card, prepend the application command with optirun or primusrun. For example:

user $ optirun glxspheres64 COPY TO CLIPBOARD


user $ primusrun inkscape COPY TO CLIPBOARD


If you want to specifically run some application with the nvidia driver, you may edit that application's .desktop file "Exec" property, or run it in terminal like this

 Exec=primusrun chromium

Some applications (usually games like steam) may have an embedded option to specify the command line, where it is preferred to use this way.

For example, in Steam, select a game - that you want to run using your discrete Nvidia card - from the Library page of the Steam client, right-click, and select Properties. Click the SET LAUNCH OPTIONS... button and specify for the command line options followed by the default launch hook %command%.

primusrun %command%

If you have problems with a bumblebee setup, refer to this Forum Tutorial for advice.

Смотрите также


Более легкий путь

You may use a GUI version of mhwd in Manjaro Settings Manager#Hardware Detection

With this tool you can:
- install graphic driver
- switch graphic driver

https://www.youtube.com/watch?v=UAFGukpEIJw


Как проверить драйвер

user $ glxinfo | grep OpenGL COPY TO CLIPBOARD


Example output command:

Nvidia driver ( proprietary driver )


$ glxinfo | grep OpenGL

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GTX 660/PCIe/SSE2
OpenGL core profile version string: 4.3.0 NVIDIA 331.49
OpenGL core profile shading language version string: 4.30 NVIDIA via Cg compiler
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.4.0 NVIDIA 331.49
OpenGL shading language version string: 4.40 NVIDIA via Cg compiler
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:


Nouveau , Gallium from Mesa ( open source driver )


$ glxinfo | grep OpenGL

OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NVE6
OpenGL core profile version string: 3.1 (Core Profile) Mesa 9.2.5
OpenGL core profile shading language version string: 1.40
OpenGL core profile context flags: (none)
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 9.2.5
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:


Intel driver from Mesa ( open driver )


$ glxinfo | grep OpenGL

OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Desktop
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.0.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.0.6
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.0.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
OpenGL ES profile extensions:

Cookies help us deliver our services. By using our services, you agree to our use of cookies.