Intel linux graphics ubuntu

Сетевые утилиты онлайн

You are using an outdated browser.
Please upgrade your browser to improve your experience.

Как настроить драйверы видеокарты Intel HD Graphics в Ubuntu 14.04.

А началось все с того, что меня не устраивала работа драйвера видеокарты Intel linux Graphics в моей системе Ubuntu 14.04. Не то чтобы он совсем не работал — он работал. Просто я был уверен что он работает не полностью. Например, при просмотре Full HD видео процессор был загружен на 70-80 %. Или игрушка Warzone 2100 безбожно тормозила (специально поставил для проверки ибо игры при отрисовке объектов обращаются к видеокарте напрямую в обход xserver). И много других признаков того, что драйвер нормально не работает. В общем не нравился и все тут. Скажете почему это все не работает «из коробки»? Да потому, что Ubuntu устанавливается и запускается на компьютерах с различной аппаратной конфигурацией и настраивать ее на использование всех возможностей каких либо отдельных видеокарт не имеет смысла — она просто не заработает в другой (более слабой) аппаратной конфигурации. Для установки и запуска системы нужна минимальная конфигурация которая будет работать на большинстве железа. И если вы хотите получить производительность Вашей конкретной видеокарты, то систему нужно настроить именно под эту видеокарту. В общем, даже после установки Intel Linux Graphics Installer с последующей установкой новых драйверов, видеокарта выдавала 530 fps и процессор был постоянно загружен. Как обычно, началось копание в интернетах на предмет необходимой информации о настройках. Собрав кусками информацию из различных источников я приступил к настройкам. Огромное спасибо хочу сказать комрадам Gentoo-шникам (www.gentoo.ru) за прекрасную документацию. Итак перейдем к настройкам. У меня были установлены пакеты xserver-xorg-video-intel, xserver-xorg-video-intel-lts-trusty, intel-linux-graphics-installer, mesa-utils. Все эти пакеты есть в стандартном репозитории Ubuntu. Все кроме intel-linux-graphics-installer. Этот инсталлятор устанавливает наиболее новые драйвера для ядра выбранной системы. Например, выпущена новая версия ubuntu с новым ядром, а пакеты с новым драйвером, оптимизированным под это ядро, еще не собраны. В этом случае первыми они собираются на 01.org. Напомню как подключить репозиторий с этим пакетом. Для этого выполним в терминале echo «deb https://download.01.org/gfx/ubuntu/14.04/main trusty main #Intel Graphics drivers» | sudo tee /etc/apt/sources.list.d/intellinuxgraphics.list. Эта команда добавит репозиторий intelgraphics. Далее добавим ключи GPG для этого репозитория. Выполним команды:
wget —no-check-sertificate https://download.01.org/gfx/RPM-GPG-KEY-ilg -o — | sudo apt-key add —
wget —no-check-sertificate https://download.01.org/gfx/RPM-GPG-KEY-ilg-2 -o — | sudo apt-key add —. После этого обновим список репозиториев командой apt-get update и установим пакет командой apt-get install intel-linux-graphics-installer.

И, соответственно, запустим эту программу и установим драйвера Intel. Рекомендую вам запускать ее из консоли, выполнив команду sudo intel-linux-graphics-installer. Далее вы увидите графический интерфейс программы позволяющий установить драйверы.

Если у Вас по какой-то причине не работает intel-linux-graphics-installer, Вы можете установить драйверы напрямую выполнив команды apt-get install i915-3.16-3.13- dkms и apt-get install i965-va-driver. У меня они уже установлены.

С момента написания заметки прошло довольно много времени и сейчас текущей версией ubuntu 14.04 является 14.04.4 lts. Самое новое ядро, которое есть в репозитории ubuntu 14.04.4 lts, это Linux-image-extra-4.2.0-34-generic. Вот в этом случае эти драйвера от Intel Вы не прикрутите. Можно попробовать обмануть intel-linux-graphics-installer 1.4.0 сменив название системы на Ubuntu 15.10. Но это даст только нестабильность, поскольку версии библиотек в репозитории intel Willy новее, чем версии библиотек в репозитории ubuntu 14.04. Например, kde-window-manager не сможет работать с новыми библиотеками. Соответственно, не будут прорисовываться полностью окна, у меня не прорисовывалась верхняя часть со значками сворачивания и закрытия, и не будет работать переключение между окнами. Учитывая все это, я поставил из стандартного репозитория ubuntu 14.04 драйвер xserver-xorg-video-intel-lts-wily. На всех тестах результаты он дает те же. И использует уже Mesa 11.0.2. Для того, чтобы обновить драйверы под новое ядро нужно выполнить команду sudo apt-get install —install-recommends linux-generic-lts-wily xserver-xorg-core-lts-wily xserver-xorg-lts-wily xserver-xorg-video-all-lts-wily xserver-xorg-input-all-lts-wily xserver-xorg-video-intel-lts-wily libwayland-egl1-mesa-lts-wily. Она установит ядро (если оно еще не установлено), стек x-сервера, включая и драйвера intel. И рекомендую после установки этих пакетов выполнить команду aptitude -f install. Данная команда даст менеджеру пакетов aptitude задание проверить зависимости пакетов. Если какие-то зависимости не удовлетворены менеджер предложит установить недостающие пакеты, удалить неактуальные и конфликтующие. Правда она настойчиво предложит установить и старые ядра. Потом, после перезагрузки, можно, например, с помощью Ubuntu Tweak, удалить старые ядра.

А вот в Ubuntu 16.04 LTS c ядром 4.4 и выше нужно уже пользоваться пакетом драйверов xserver-xorg-video-intel. Он вполне сносно работает. Подтормаживает правда на тяжелом видео, выведенном на внешний большой монитор. Собирать весь стек от Intel Linux довольно сложно, поэтому придется подождать с месяц пока выпустят installer. Хотя и на этом драйвере 3D тесты тоже проходят нормально. Отдельно хочу обратить внимание на пакет linux-firmware . Этот пакет устанавливает дополнительные драйверы ядра. Убедитесь что этот пакет установлен. У меня он установлен и, выполнив команду sudo modinfo i915 , я вижу следующую картину:
filename: /lib/modules/4.8.0-36-generic/kernel/drivers/gpu/drm/i915/i915.ko
license: GPL and additional rights
description: Intel Graphics
author: Intel Corporation
author: Tungsten Graphics, Inc.
firmware: i915/bxt_dmc_ver1_07.bin
firmware: i915/skl_dmc_ver1_26.bin
firmware: i915/kbl_dmc_ver1_01.bin
firmware: i915/kbl_guc_ver9_14.bin
firmware: i915/bxt_guc_ver8_7.bin
firmware: i915/skl_guc_ver6_1.bin
Как видите установлены аж шесть бинарника микрокода. Все это в равной степени относится и к ядру 4.8 (я на него уже перешел). В целом, на Plasma5 отрисовка окон неплохо работает. Можете убедиться посмотрев этот клип.

Читайте также:  Установить удаленный windows store

Проверить какой драйвер используется в системе можно выполнив команду lspci -k. Вот ее вывод:

Это значит что у меня загружен и работает драйвер i915. Посмотреть информацию о данном модуле ядра можно выполнив команду modinfo i915 :

root@darkeye:/home/backup# modinfo i915
filename: /lib/modules/4.2.0-34-generic/kernel/drivers/gpu/drm/i915/i915.ko
license: GPL and additional rights
description: Intel Graphics
author: Intel Corporation
author: Tungsten Graphics, Inc.
firmware: i915/skl_dmc_ver1.bin
srcversion: 5C38138799E6BC8691FB133
.

Если поискать этот драйвер при помощи команды aptitude search i915 то найдется пакет i915-3.15-3.13-dkms. Если набрать в консоли aptitude show i915-3.15-3.13-dkms мы увидим следующее: root@darkeye:

# aptitude show i915-3.15-3.13-dkms
Пакет: i915-3.15-3.13-dkms
Новый: да
Состояние: установлен
Автоматически установлен: нет
Версия: 0.01
Приоритет: необязательный
Раздел: kernel
Сопровождающий: Jack Leigh
Архитектура: all
Размер в распакованном виде: 3.764 k
Зависимости: debhelper, dkms, linux-headers
Описание: Intel i915 video drivers from the mainline kernel,
backported from the 3.15 series to the 3.12 series.
This package contains the source to be built with dkms.
Это доказывает что установлен и работает драйвер Intel Graphics. Посмотрите в сети интернет кто такой Jack Leigh и какое отношение он имеет к сайту download.01.org?
Убедились? Замечательно.
Для полной настройки драйвера, включения нужных функций и загрузки в ядро необходимых модулей нужно добавить некоторые строки в файл xorg.conf. Сразу оговорюсь в ubuntu 14.04 его нет (там x-server настроен без xorg.conf однако если его создать, настройки при запуске сервера читаются из него) поэтому нужно генерировать этот файл. Переходим в режим консоли (ctrl+shift+F1). В консоли переходим в режим суперюзера (sudo -s). Останавливаем X-server выполнив в консоли service kdm stop (у кого Gnome service gdm stop или Unity — service lightdm stop). Далее выполняем команду Xorg -configure. Эта команда создаст в нашей домашней директории файл

/xorg.conf.new. Его необходимо перенести в нужное место и назвать правильно. Выполним команду mv xorg.conf.new /usr/share/X11/xorg.conf.d/xorg.conf.

В комментариях парень верно написал о невозможности в новых версиях Ubuntu (15.04, 15.10) генерировать таким методом xorg.conf.new. Команда Xorg -configure выдает ошибки и не создает файл. Я проверил на Ubuntu 14.04.4 LTS — это действительно так. Поэтому, я хочу предложить другой метод. Загрузитесь в recovery mode (при включении компьютера нажимаете клавишу esc, выбираете «Дополнительные параметры загрузки»). Там выбираете графу c последней версией Вашего ядра и с надписью (recovery mode). Загрузится ядро в recovery mode и появится список. В этом списке выбираете графу root. Внизу появится приглашение ввести команду #. Вводите сначала команду mount -o remount, rw /. Эта команда перемонтирует корневую файловую систему в режим чтения/записи (до этого корневая файловая система была смонтирована в режиме чтения). Потом вводите команду Xorg -configure. При выполнении программа сообщит о некоторых незначительных ошибках. Тем не менее, файл xorg.conf.new будет создан и будет находиться в директории /root. После этого можно перенести этот в нужное место и назвать правильно командой mv xorg.conf.new /usr/share/X11/xorg.conf.d/xorg.conf.

Открываем этот файл в любом доступном редакторе ( я пользуюсь nano) и правим необходимые секции. Сейчас я приведу содержимое, которое, помимо того что уже есть, должно быть в этом файле. Если в какой-то секции есть, например, одна строка, то нужно добавить остальные. Единственный момент — я правил первую секцию «Device» и остальные две генерированные секции «Device» оставил без изменений, так как у меня на ноутбуке одна видеокарта. Те секции, которых не было, я просто добавил в файл.

Источник

IntelВ® IrisВ® Xe MAX Graphics with Linux*

Laptops are now available in market to purchase that provide both a discrete IntelВ® IrisВ® Xe MAX graphics processor and an integrated IntelВ® IrisВ® Xe Graphics processor. You can find more information about those systems here.

While support for the Intel Iris Xe Graphics processor has already been integrated into Linux* and integrated into Linux-based distributions such as Ubuntu 20.04.1, enabling work for the Intel Iris Xe MAX graphics processor in Linux* is ongoing.

In the meantime, we are excited to provide early access to that software and instructions to configure an Ubuntu 20.04.1 system so you can take advantage of both graphics adapters today. By following these instructions, your system’s display will be using the Intel Iris Xe Graphics processor and the Intel Iris Xe MAX graphics processor can then be used for 3D, media, and compute processing.

Overview

To use both the Intel Iris Xe graphics and Intel Iris Xe MAX graphics processors at the same time currently requires two different kernels. To isolate the two required kernel versions, virtualization will be used.

The virtual machine (VM) host will have direct control of the display through the Intel Iris Xe graphics processor (via the kernel provided by Ubuntu.) The VM host will also be configured to use PCI passthrough to provide the Intel Iris Xe MAX graphics processor to the VM guest. The VM guest will be running the custom Linux kernel.

Once the host is configured, instructions are provided to to configure and use a VM guest for compute and media offload. Using the standard QEMU virtualization machine manager, you can setup a local compute node using the Intel Iris Xe MAX graphics for executing media and compute applications while you continue using the Intel Iris Xe graphics adapter for your display.

Configure the host

These instructions begin with the laptop having the Desktop image for Ubuntu 20.04.1 LTS]1 (or newer) successfully installed and booting. This can be done either as the sole operating system, configuring as a dual boot environment, or by using external storage. As the specific steps for installing Linux onto a laptop is very platform specific, we do not provide those instructions here. Please refer to your platform or operating system supplier for information.

Читайте также:  Как отключить оповещения брандмауэра windows 10

Prior to starting this guide, ensure that you have enabled virtualization in your system’s BIOS. Please refer to your platform supplier for information on configuring the BIOS. On some systems, you may also need to enable Secure Boot.

Prior to running the instructions below, activate sudo in your session by running sudo -l . This will allow you to copy/paste the instructions which use sudo without being prompted for your password.

Configure the host to bind vfio-pci to Intel Iris Xe MAX graphics adapter

Binding the Intel Iris Xe MAX graphics adapter to the vfio-pci driver detaches it from the host operating system, freeing it for use by the virtual machine. The PCI device and vendor ID for the Intel Iris Xe MAX graphics adapter is 8086:4905. Edit your system’s /etc/default/grub configuration to append intel_iommu=on vfio-pci.ids=8086:4905. The following shell script will check if those two parameters are set in /etc/default/grub, and set them if not.

The above should display the GRUB_CMDLINE_LINUX_DEFAULT including both intel_iommu=on and vfio-pci.ids=8086:4905.

Install the linux-oem-20.04 kernel

The default kernel provided in Ubuntu 20.04.1 does not provide a kernel driver for the Intel Iris Xe graphics adapter. To enable that graphics adapter, you need to configure the system to use the linux-oem-20.04 kernel.

Reboot

At this point, the system is configured to:

Enable Intel Iris Xe Graphics adapter for the host using linux-oem-20.04 kernel.

Bind the vfio-pci driver to the Intel Iris Xe MAX graphics adapter so it can be passed through to the VM.

Reboot into the new configuration. The next section provides steps to verify the devices enumerate correctly.

Identify PCI device bound to the vfio-pci driver

After rebooting, verify the changes worked. The following will output the PCI information as well as the kernel driver bound to those devices:

The output of the above command should look similar to the following, listing two devices. One will be bound to the i915 driver and the other to vfio-pci.

Make a note of the address of the PCI device that is bound to the vfio-pci driver, 03:00.0 in this case. This is the PCI address that will be provided to the VM, giving it access to the Intel Iris Xe MAX graphics adapter.

Configuring the VM guest

At this point the host is configured in a way which allow the Intel Iris Xe MAX graphics adapter to be passed to a VM guest. Next, you will compile a custom kernel to boot inside of that VM guest, with support for the Intel Iris Xe MAX graphics adapter.

On the host, we recommend you continue using the kernel supplied by the operating system vendor.

Prepare kernel for Intel Iris Xe MAX graphics

Install packages necessary for building the Linux kernel from source:

The following will clone the kernel sources from GitHub, configure it, and compile it in the $/kernel-xe-max directory. This path is also used later when copying the built kernel to the VM guest.

NOTE: Cloning and building the kernel can take a while, varying on Internet connection and hardware.

At the end of the build, a tarball will be ready in $/kernel-xe-max:

Create an Ubuntu virtual machine

The following steps will install the required packages to manage and configure a VM, create an initial disk image, download the Ubuntu 20.04.1 live server image, and boot the VM with that image.

We will be using QEMU directly from the command line, but you could use a graphical configuration tool such as virt-manager as well.

Install packages to manage the VM

Check that virtualization is enabled

You can now run the utility ‘kvm-ok’ to determine VT-d is enabled on your system:

You should see a message similar to:

If you do not see that, make sure that virtualization is enabled in your system’s BIOS. Please refer to your platform supplier for information on configuring the BIOS. On some systems, you may also need to enable Secure Boot.

Create a disk image file for the VM

The following will create disk image file for the VM with 50G. If you don’t want to place the disk image in /opt you can place it wherever you have write access on the host.

Install Ubuntu 20.04.1 LTS image into VM

You can install either Ubuntu Server or Ubuntu Desktop within the VM. Because the graphics display is not required for GPU offloading, you may chose to install the server image to reduce disk usage.

Since you just installed the Desktop image on the host platform, you may wish to re-use the ISO image you already downloaded, instead of downloading the Server image.

If you wish to download a new image, you can do so with the following command:

The above will download the file ubuntu-20.04.1-live-server-amd64.iso, which you will pass to QEMU below. We set those values into the BOOT_MEDIA environment variable:

Install OS into VM

The following will start the VM with 4G of RAM. The CPU configuration will be copied from the host CPU. The VM will boot the OS image specified in the BOOT_MEDIA variable declared previously.

Читайте также:  Проверка диска windows обнаружила ошибки

A window will open and after several seconds the Ubuntu installer will start.

NOTE: During the package installation, make sure to configure network and install openssh-server when prompted. ssh will be used later to connect to the VM.

If the installation asks how to partition the disk:

You do not need to use volume management (deselect LVM)

Add a 2G partition mounted to /boot, formatted as ext4. This will allow plenty of space for changing kernels. The default is closer to

Set the remaining space on / (approximately 47G)

After the installation has completed, shut down the VM during reboot.

Log into the VM guest and configure it

The disk image now includes an installed operating system, so you no longer need to pass the boot media to the VM, so start the VM without $.

On the host, launch the VM:

Once the virtual machine starts, it will boot the Ubuntu operating system you just installed.

If you didn’t install openssh-server when you installed the OS into the VM, you will need to do it from the virtual machine window launched when you started qemu-system-x86_64.

In the VM, run the following:

When the VM is started above, port 10022 on the host is forwarded to port 22 in the guest. The next command will use that local port forward to copy the built kernel from the host system into the guest. You can then ssh into the VM to run the commands to install that kernel.

Now you can ssh into the guest VM to install the kernel:

On the host, connect to the VM:

OPTIONAL: If you installed the Server OS version, you may want to disable ‘cloud-init’ inside the VM to improve boot times:

OPTIONAL: If you installed the Desktop OS version, you may want to disable the graphics display to reduce memory usage and improve performance:

Prior to installing the custom kernel, you need to install the firmware files required by the Intel Iris Xe MAX graphics adapter. The following will download an archive of the latest firmware files and decompress them into /lib/firmware/i915, where the kernel will look for them while booting:

You can now install the custom kernel. This is done after the firmware files are installed to make sure that the firmware files are available while the initial ramdisk is created during the kernel installation:

Next, modify grub to enable serial output so console output can be seen from the virtual machine manager (VMM). This will allow you to launch the VM later without a virtual display.

The two lines you want to modify are the GRUB_CMDLINE_LINUX_DEFAULT and GRUB_TERMINAL as follows. You can use ‘nano’ to edit the file:

Finally, update the bootloader with the additional grub configuation and power off the VM.

Start a VM with GPU passthrough

Now that the VM is configured to boot the kernel containing support for the Intel Iris Xe MAX graphics adapter, we will re-start QEMU kvm using the disk image we created using and passthrough the GPU to the guest OS.

In the below example, the address 03:00.0 used with the vfio-pci option corresponds to the PCI address for xe-max that we got from running lspci on the host.

Since this will now be passing in physical hardware, you need to run it as root:

It may take several seconds before you see any output from the VM.

Connection to the VM

As part of launching the VM, the above command forwards connections to port 10022 on the host to port 22 in the guest. This is then used for connecting to the guest:

It is recommended to login into the guest via SSH to execute below commands and to run demos requiring terminal output.

Verify the Intel Iris Xe MAX graphics driver is initialized

Use lspci to verify the PCI device was passed through and initialized by the i915 kernel driver:

Output should look similar to the following:

Install user space media and compute packages

The following is taken from the installation guides, and should be executed on the guest VM:

First, activate a sudo session so you are not prompted for a password while copy/pasting instructions to the terminal:

Configure the package repository

Install the compute and media packages

The following will install the latest versions of the OpenCL* runtime, Level Zero, Media SDK, and Media driver:

Configure permissions to access GPU

In order to access GPU capabilities, a user needs to have the correct permissions on the system. The following will add the user to the render group owning /dev/dri/render*:

Tests

Verify the kernel is the version you built

This should report ‘Linux 5.4.48-xe-max’.

Verify the graphics platform name

Verify ‘platform: DG1’ is listed in i915_capabilities:

Verify Open CL

To verify that the intel-opencl packages have installed correctly, you can use the clinfo program:

Verify media

To verify that media driver have installed correctly, you can use the vainfo program:

Additional guides

We have the following guides you can follow to demonstrate how to user the Intel Iris Xe MAX graphics adapter within the VM environment:

Feedback on this page?

If you have feedback on this page, please visit the community documentation project project on GitHub and file an issue.

Источник

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