This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

intel

From Gentoo Wiki (test)
Jump to:navigation Jump to:search

intel is the open source graphics driver for Intel GMA on-board graphics cards, starting with the Intel 810.

Hardware detection

To choose the right driver, first detect the graphics card. lspci can be used for this task:

root #lspci | grep -i VGA

This should show something like this:

root #lspci | grep -i VGA
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
Note
The lspci output for the graphics controller may refer to CPU generations, whereas the Feature support table below refers to GPU generations. E.g., “3rd Gen” in the example lspci output above corresponds to “Gen7” in the table below.

Feature support

Generation Chipset OpenGL OpenGL ES OpenCL VAAPI Vulkan VIDEO_CARDS
Gen 1 810, 815 No No No No No unsupported
Gen 2 i830M, 845G, 855GM, 865G 1.3 No No No No intel i915
Gen 3 915G/GM, 945G/GM, G/Q33, Q35, Atom D4xx/D5xx/N4xx/N5xx 1.4 No No No No intel i915
Gen 4 965G/GM/Q, G35, G41, G/Q43, G/GM/Q45 2.1 2.0 No G/GM45: MPEG2 only No intel i965
Gen 5 Nehalem (Ironlake) 2.1 2.0 No Yes No intel i965
Gen 6 Sandy Bridge 3.3 3.0 No Yes No intel i965
Gen 7 Ivy Bridge, Valley View[table 1] 3.3 3.0 1.1[table 2] Yes Partial intel i965
Gen 7.5 Haswell 4.5 3.1 1.1[table 2] Yes Partial intel i965
Gen 8 Broadwell, Cherryview[table 3] 4.5 3.1 1.1[table 2] Yes Yes intel i965 iris
Gen 9 Skylake, Broxton[table 4] 4.5 3.2 1.1[table 2] Yes Yes intel i965 iris
Gen 9.5 Kaby Lake, Coffee Lake 4.5 3.2 2.1[table 2] Yes Yes intel i965 iris
  1. Valley View is the name of the graphics core associated with the Silvermont microarchitecture (Bay Trail platform, among others)
  2. 2.0 2.1 2.2 2.3 2.4 Uses the dev-libs/beignet package (Upstream info)
  3. Cherryview is the name of the graphics core associated with the Airmont microarchitecture (Braswell, Cherry Trail platforms, among others)
  4. Broxton is the name of the graphics core associated with the Goldmont microarchitecture (Apollo Lake platform, among others)

A full list of Intel CPU graphic capabilities can be found here.

Installation

Firmware

Systems using Kaby Lake, Skylake or Broxton Intel graphics will need to install additional firmware[1] from sys-kernel/linux-firmware package:

root #emerge --ask sys-kernel/linux-firmware

Otherwise errors such as the following might be visible in dmesg:

kernel: i915 0000:00:02.0: Direct firmware load for i915/skl_dmc_ver1_26.bin failed with error -2
kernel: i915 0000:00:02.0: Failed to load DMC firmware [https://01.org/linuxgraphics/intel-linux-graphics-firmwares], disabling runtime power management.

Include the files required for the GPU in the kernel, in this case:

KERNEL Build firmware blobs into the kernel binary
Device Drivers  --->
    Generic Driver Options  --->
        -*- Userspace firmware loading support
        [*] Include in-kernel firmware blobs in kernel binary
            (i915/skl_dmc_ver1_26.bin) External firmware blobs to build into the kernel binary
            (/lib/firmware) Firmware blobs root directory
Warning
Including the firmware in-kernel may cause suspend-to-ram to fail, if this is a concern don't include the blob built into the kernel.

It is possible to add GuC firmware, too, but there are problems with it, so it won’t be loaded by default (passing additional parameters is needed). It’s actually for kernel 4.8.7 at least.

Please note that the firmware file name should match the one from MODULE_FIRMWARE in the source tree. Now it is i915/skl_dmc_ver1_26.bin (not i915/skl_dmc_ver1.bin) for DMC firmware. To check this for GuC and DMC firmware type the following command within Linux source:

user $grep -B 1 'MODULE_FIRMWARE.*SKL' drivers/gpu/drm/i915/intel_guc_loader.c drivers/gpu/drm/i915/intel_csr.c
drivers/gpu/drm/i915/intel_guc_loader.c-#define I915_SKL_GUC_UCODE "i915/skl_guc_ver6_1.bin"
drivers/gpu/drm/i915/intel_guc_loader.c:MODULE_FIRMWARE(I915_SKL_GUC_UCODE);
--
drivers/gpu/drm/i915/intel_csr.c-#define I915_CSR_SKL "i915/skl_dmc_ver1_26.bin"
drivers/gpu/drm/i915/intel_csr.c:MODULE_FIRMWARE(I915_CSR_SKL);

To enable GuC in older kernels (around 4.14), add kernel parameters i915.enable_guc_loading=1 i915.enable_guc_submission=1. For more recent versions (at least including 4.17), add enable_guc=2. For the exact parameter options, see source:drivers/gpu/drm/i915/i915_params.c.

Kernel

The following kernel options need to be activated:

KERNEL Prior to Linux 4.4
Processor type and features  --->
    [*] MTRR (Memory Type Range Register) support
Device Drivers  --->
    Graphics support  --->
        <*> /dev/agpgart (AGP Support)  --->
             <*> Intel 440LX/BX/GX, I8xx and E7x05 chipset support
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
            <*> Intel 8xx/9xx/G3x/G4x/HD Graphics
            [*]   Enable modesetting on intel by default
            [*]   Enable legacy fbdev support for the modesetting intel driver

The legacy fbdev support is required since kernel 3.14.14 at least for i915 (CONFIG_DRM_I915_FBDEV=y).[2][3] For hybrid Intel/AMD system, follow also the steps of radeon (open source) or fglrx (closed binary) drivers.

Since kernel version 4.4 the driver has been moved and the legacy fbdev support is now CONFIG_DRM_FBDEV_EMULATION=y.

KERNEL Since Linux 4.4
Device Drivers  --->
            Graphics support  --->
                <*> /dev/agpgart (AGP Support)  --->
                    --- /dev/agpgart (AGP Support)
                    < >   AMD Opteron/Athlon64 on-CPU GART support
                    -*-   Intel 440LX/BX/GX, I8xx and E7x05 chipset support
                    < >   SiS chipset support
                    < >   VIA chipset support
                [ ] VGA Arbitration
                [ ] Laptop Hybrid Graphics - GPU switching support
                <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
                    --- Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)
                    [*]   Enable legacy fbdev support for your modesetting driver
                [ ] Allow to specify an EDID data set instead of probing for it
                    I2C encoder or helper chips  --->
                < > 3dfx Banshee/Voodoo3+
                < > ATI Rage 128
                < > ATI Radeon
                < > AMD GPU
                < > Nouveau (NVIDIA) cards
                < > Intel I810
                <*> Intel 8xx/9xx/G3x/G4x/HD Graphics
                [ ]   Enable alpha quality support for new Intel hardware by default
                < > Matrox g200/g400
                < > SiS video cards
                < > Via unichrome video cards
                < > Savage video cards
                < > Virtual GEM provider
                < > DRM driver for VMware Virtual GPU
                < > Intel GMA5/600 KMS Framebuffer
                < > DisplayLink
                < > AST server chips
                < > Kernel modesetting driver for MGA G200 server engines
                < > Cirrus driver for QEMU emulated device
                < > QXL virtual GPU
                < > DRM Support for bochs dispi vga interface (qemu stdvga)
                    Display Panels  ----                 
                    Display Interface Bridges  ----
                    Frame buffer Devices  --->
                -*- Backlight & LCD device support  --->
                    Console display driver support  --->
                [*] Bootup logo  --->
Note
Kernel version 4.18 or later is recommended for Coffee Lake because it will work without enabling alpha support. Kernel 4.14 requires loading module i915 with alpha_support=1 or enabling CONFIG_DRM_I915_ALPHA_SUPPORT in kernel config.

X drivers

Portage uses the VIDEO_CARDS variable, which expands into the USE_EXPAND variable, for enabling support for various graphics cards. Assuming the x11-base/xorg-drivers package has already been installed, setting the VIDEO_CARDS variable in /etc/portage/make.conf will pull in the correct video driver:

VIDEO_CARDS="intel"
FILE /etc/portage/make.confGen 2 and Gen 3
VIDEO_CARDS="intel i915"
FILE /etc/portage/make.confGen 4 through Gen 9+
VIDEO_CARDS="intel i965"

The intel value is for x11-base/xorg-drivers. The i915 and i965 values are for media-libs/mesa.

Important
Beginning with x11-base/xorg-drivers-1.19, the x11-base/xorg-drivers package (in addition to the mesa package) includes support for the i965 USE flag. This will omit selection of the deprecating x11-drivers/xf86-video-intel driver in favor of the more maintained, generic modesetting DDX driver built into x11-base/xorg-server.

After making any make.conf modifications, update the system so the changes take effect by passing the --changed-use --deep options to emerge:

root #emerge --ask --changed-use --deep @world

Those wishing to not accept the Intel graphic driver defaults in the main repository can read on into the sub-sections below.

Intel DDX

Before proceeding with the Intel DDX driver, note that this driver has been slowly deprecating for several years. This has caused other major[4][5] Linux distributions to begin to move toward the modesetting DDX driver (detailed in the section below). Although presently faster than modesetting driver, there has been no official package release from Intel upstream for their DDX driver for quite some time[6], and is therefore causing a maintenance burden on Gentoo's X11 package maintainers.

With this being stated, the Intel DDX driver has slight speed advantages over the generic modesetting driver as it is able to more closely interact with hardware acceleration present in chips utilizing SNA and DRI3.

USE flags

Check the USE flags of x11-drivers/xf86-video-intel:

USE flags for x11-drivers/xf86-video-intel X.Org driver for Intel cards

debug Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
dri Enable direct rendering: used for accelerated 3D and some 2D, like DMA
sna Enable SandyBridge's New Acceleration (useful on all chipsets, not just SandyBridge)
tools Build the intel-virtual-output tool
udev Enable virtual/udev integration (device discovery, power and storage device support, etc)
uxa Enable UMA Acceleration Architecture
valgrind Enable annotations for accuracy. May slow down runtime slightly. Safe to use even if not currently using dev-debug/valgrind
xvmc Enables X-Video Motion Compensation support

Emerge
root #emerge --ask x11-drivers/xf86-video-intel
xorg.conf

To force Xorg server to use the Intel DDX driver with SNA for hardware accelleration, the following file can be created in /etc/X11/xorg.conf.d/:

FILE /etc/X11/xorg.conf.d/20-intel.confForce Intel DDX
Section "Device"
    Identifier  "Intel Graphics"
    Driver      "intel"
    Option      "AccelMethod"    "sna"
EndSection

Modesetting DDX

As mentioned above, the modesetting DDX driver is now the default driver on newer Intel graphics chipsets for Gentoo. This driver uses GLAMOR to accelerate 2D graphical over Mesa (the open source OpenGL implementation). As of x11-base/xorg-drivers-1.19, this has become the default for Gentoo.

To force the modesetting driver, first make sure glamor has been added to the USE variable:

FILE /etc/portage/make.confEnable glamor globally
USE="glamor"
VIDEO_CARDS="intel i965"
root #emerge --ask --changed-use --deep @world
xorg.conf

Now force Xorg server to load the modesetting driver:

FILE /etc/X11/xorg.conf.d/20-modesetting.confForce modesetting DDX
Section "Device"
    Identifier  "Intel Graphics"
    Driver      "modesetting"
    Option      "AccelMethod"    "glamor"
    Option      "DRI"            "3"
EndSection

Note, if both 20-intel.conf and 20-modesetting.conf are defined in /etc/X11/xorg.conf.d/, the X server will attempt to load the files in alpha-numeric order.

VAAPI

Intel GMA X4500HD / G45 / GM45 and newer supports VAAPI hardware video acceleration.

Vulkan

As of November 15th, 2016[7] Vulkan is supported in the main ebuild repository for Intel Core processors using the i965 mesa driver.

Please note, that this will build a working Vulkan driver, but it will not provide a libvulkan.so.1, but a drivers-specific libvulkan_intel.so. The package media-libs/vulkan-loader provides libvulkan.so.1.

Misc

Various utilities useful for debugging are provided by x11-apps/intel-gpu-tools package.

For example GPU min/max/current frequency can by displayed by:

root #intel_gpu_frequency

Configuration

Permissions

If the acl USE flag is enabled globally and ConsoleKit is being used (default for desktop profiles) permissions to video cards will be handled automatically. It is possible to check the permissions using getfacl:

user $getfacl /dev/dri/card0 | grep larry
user:larry:rw-

A broader solution is to add the user(s) needing access the video card to the video group:

root #gpasswd -a larry video

Note that users will be able to run X without permission to the DRI subsystem, but acceleration will be disabled.

xorg.conf

Choose one of the following configuration options:

As xorg is not aware of i915 or i965 they will need to be addressed as Driver intel.
FILE /etc/X11/xorg.conf.d/intel.confExplicit intel driver section
Section "Device"
   Identifier  "intel"
   Driver      "intel"
EndSection
  • Alternate Driver for Gen 4+ -- Modesetting
Note
Experiences of this configuration can be found in the Discussion of this page. Add any difficulties there so this section can be improved.
As of xorg-server-1.17, the modesetting driver was moved into x11-base/xorg-server. This driver has more features than the classic driver, such as the ability to support acceleration via GLAMOR.
This configuration is the default for VIDEO_CARDS="intel i965" beginning with x11-base/xorg-drivers-1.19. If you wish to use the classic driver, you will need to install x11-drivers/xf86-video-intel manually:
root #emerge --ask x11-drivers/xf86-video-intel
xorg-server is easily configured to prefer modesetting over the older intel driver.
FILE /etc/X11/xorg.conf.d/modesetting.confExplicit modesetting driver section
Section "Device"
   Identifier  "modesetting"
   Driver      "modesetting"
EndSection

The X server is designed to work out-of-the-box, with no need to manually edit X.Org's configuration files. It should detect and configure devices such as displays, keyboards, and mice.

However, the main configuration file of the X server is the xorg.conf.

Troubleshooting

HTML5/VAAPI GPU hangs

If the GPU hangs up when watching VAAPI-accelerated video (e.g. on YouTube) try enabling IOMMU:

KERNEL Enable IOMUU
Device Drivers  --->
    [*] IOMMU Hardware Support --->
        [*] Support for Intel IOMMU using DMA Remapping Devices
        [*]   Enable Intel DMA Remapping Devices by default

Related upstream bug report.

KDM freezes

A workaround is to set TerminateServer=true in all sections of the file /usr/share/config/kdm/kdmrc, which starts with X-.

KDE's plasma eating CPU

If /usr/bin/plasmashell is always consuming several percent of CPU, perhaps this is related to a vsync problem. QT Quick Animation seem to loop too fast when vsync is not managed by the driver (Reference).

A way to enable vsync with SNA is to enable the TearFree option in xorg.conf:

FILE /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
        Identifier "Device0"
        Driver "intel"

        Option      "AccelMethod" "SNA"
        Option      "TearFree"    "true"
EndSection

See also this Linux Mint tutorial.

Black screen

  • According to this Debian wiki, CONFIG_FRAMEBUFFER_CONSOLE must be set to y (aka built-in to the kernel). Otherwise, it is possible to always have a black screen unless nomodeset is passed to the kernel, thus disabling kernel mode setting (KMS). acpi_osi="Linux" can be passed to the kernel command line to try to solve this kind of issue. This is usually done through the bootloader.
  • Kernel with version 4.2 or newer is needed with some 8th generation chipsets[8].

Brightness does not change with keyboard shortcuts

First, make sure vendor compatibility is on in the kernel configuration. Toshiba for Toshiba, etc.

If it is, or when the brightness buttons are working, the issue is that the kernel can not detect where the brightness control is located.

Luckily, this is easy enough to modify, as long as the kernel version is >= 3.13.x and < 4.2.

Add the following argument to the kernel command-line:

CODE Kernel command-line argument
video.use_native_backlight=1

On kernels >= 4.2, the video.use_native_backlight option is no longer available.[9] You should use one of the following instead (experiment to see which works on your system):

CODE Kernel command-line argument
acpi_backlight=video
CODE Kernel command-line argument
acpi_backlight=native
CODE Kernel command-line argument
acpi_backlight=vendor

Do your key bindings map to actions viewable in xev? Can you adjust the screen brightness using xbacklight? You can always do a work around via a keyboard remapping. For LXDE it can be done via:

FILE ~/.config/openbox/lxde-rc.xml
<keybind key="XF86MonBrightnessUp">
      <action name="Execute">
          <command>xbacklight +5</command>
      </action>
</keybind>
<keybind key="XF86MonBrightnessDown">
      <action name="Execute">
          <command>xbacklight -5</command>
      </action>
</keybind>
Warning
Using the Modesetting DDX, the x11-apps/xbacklight package will not work[10]. Use sys-power/acpilight for a compatible interface.

White or missing textures in games

This is most likely caused by missing S3TC support. Possible solutions:

  • Either set force_s3tc_enable environment variable to true, or enable this option in ~/.drirc (using x11-misc/driconf):
root #emerge --ask --oneshot x11-misc/driconf
user $driconf
  • Install media-libs/libtxc_dxtn. On amd64, it might be a good idea to enable 32-bit build of this library since many games might be shipping 32-bit executables:
FILE /etc/portage/package.use
media-libs/libtxc_dxtn abi_x86_32
root #emerge --ask media-libs/libtxc_dxtn

See also

  • Xorg/Guide - A guide on how to configure Xorg.
  • hprofile - Switching between other graphics drivers and intel.

External resources

References