1

I've been searching all over the net for the past couple of days, trying to get the integrated graphics on my Intel i5-6400 working, but no luck so far.

I'm running a fresh Ubuntu 15.10 and installed the 4.3.4 kernel. My AMD R9 380 works fine (using the open source drivers), but I want pass that through to a virtual machine, so I need to get the integrated i915 GPU working.

I have a single display, connected with DVI to the R9 380 and with a VGA cable to the integrated graphics card. In the "Display" settings panel only one display is detected, where there should be two.

Does anyone know how to to fix this?

Current kernel:

$ uname -r
4.3.4-040304-generic

Integrated GPU recognized:

$ dmesg | grep -i i915
5:[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-4.3.4-040304-generic root=/dev/mapper/vg--raid-lv--linux ro nomdmonddf nomdmonisw i915.preliminary_hw_support=1 intel_iommu=on
197:[    0.000000] Kernel command line: BOOT_IMAGE=/vmlinuz-4.3.4-040304-generic root=/dev/mapper/vg--raid-lv--linux ro nomdmonddf nomdmonisw i915.preliminary_hw_support=1 intel_iommu=on
748:[    0.869204] i915 0000:00:02.0: enabling device (0000 -> 0003)
902:[    1.485539] [drm] Initialized i915 1.6.0 20150731 for 0000:00:02.0 on minor 1
903:[    1.524441] i915 0000:00:02.0: fb1: inteldrmfb frame buffer device
1063:[  119.646979] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])

$ sudo lshw -enable pci -class display
  *-display               
       description: VGA compatible controller
       product: Tonga PRO [Radeon R9 285/380]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: f1
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=amdgpu latency=0
       resources: irq:128 memory:c0000000-cfffffff memory:d0000000-d01fffff ioport:e000(size=256) memory:df100000-df13ffff memory:df140000-df15ffff
  *-display
       description: Display controller
       product: Sky Lake Integrated Graphics
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 06
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm bus_master cap_list
       configuration: driver=i915 latency=0
       resources: irq:129 memory:de000000-deffffff memory:b0000000-bfffffff ioport:f000(size=64)

The above all looks fine to me. However, the following command shows that something is indeed wrong. Note the line that starts with Display Server: X.Org says FAILED: intel.

$ inxi -b
System:    Host: anthony-linux Kernel: 4.3.4-040304-generic x86_64 (64 bit) Desktop: Xfce 4.12.3
           Distro: Ubuntu 15.10 wily
Machine:   System: Gigabyte product: N/A
           Mobo: Gigabyte model: H110M-S2H-CF v: x.x Bios: American Megatrends v: F1 date: 09/08/2015
CPU:       Quad core Intel Core i5-6400 (-MCP-) speed/max: 799/3300 MHz
Graphics:  Card-1: Intel Sky Lake Integrated Graphics
           Card-2: Advanced Micro Devices [AMD/ATI] Tonga PRO [Radeon R9 285/380]
           Display Server: X.Org 1.17.2 drivers: ati (unloaded: fbdev,vesa,radeon) FAILED: intel
           Resolution: 1680x1050@59.88hz
           GLX Renderer: Gallium 0.4 on AMD TONGA (DRM 3.1.0, LLVM 3.6.2) GLX Version: 3.0 Mesa 11.0.2
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169
Drives:    HDD Total Size: 2060.4GB (22.5% used)
RAID:      Devices: 1: /dev/md1 2: /dev/md0
Info:      Processes: 247 Uptime: 41 min Memory: 1223.8/15993.4MB Client: Shell (bash) inxi: 2.2.16 

Edit 1: Here's some more details people requested:

$ dpkg -l xserver-xorg-video-intel
ii  xserver-xorg-video-intel    2:2.99.917+git20150808-0ubuntu4 amd64    X.Org X server -- Intel i8xx, i9xx display driver

Edit 2: Here's the xrandr output. Note that the AMD R9 380 has 1 DisplayPort, 1 HDMI & 2 DVI outputs. The iGPU has 1 VGA, 1 DVI & 1 HDMI. Not sure why only a single DVI output is listed here, but it's clear the iGPU outputs are not there, because then VGA would be in the list.

$ xrandr | grep connected
2:DisplayPort-1 disconnected (normal left inverted right x axis y axis)
3:HDMI-3 disconnected (normal left inverted right x axis y axis)
4:DVI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm

Edit 3: The system does seem to know about the outputs though:

$ ls -l /sys/class/drm
total 0
lrwxrwxrwx 1 root root    0 Jan 24 18:51 card0 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-DP-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-HDMI-A-2 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-HDMI-A-3 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-3
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-DP-2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-2
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-DVI-D-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DVI-D-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-DVI-I-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DVI-I-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-HDMI-A-4 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-HDMI-A-4
lrwxrwxrwx 1 root root    0 Jan 24 18:53 controlD64 -> ../../devices/pci0000:00/0000:00:02.0/drm/controlD64
lrwxrwxrwx 1 root root    0 Jan 24 18:53 controlD65 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/controlD65
lrwxrwxrwx 1 root root    0 Jan 24 18:53 renderD128 -> ../../devices/pci0000:00/0000:00:02.0/drm/renderD128
lrwxrwxrwx 1 root root    0 Jan 24 18:53 renderD129 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/renderD129
lrwxrwxrwx 1 root root    0 Jan 24 18:53 ttm -> ../../devices/virtual/drm/ttm
-r--r--r-- 1 root root 4.0K Jan 24 18:53 version

Edit 4: During boot the iGPU output seems to work. I get dmesg output on it during boot, but it halts at some point. The output from the iGPU stops after the lines starting with [dmr] below. The ones starting with fbcon are not visible on it:

$ dmesg | grep -A3 "\[drm\] fb"
[    1.357205] [drm] fb mappable at 0xC0C73000
[    1.357810] [drm] vram apper at 0xC0000000
[    1.358418] [drm] size 7299072
[    1.359027] [drm] fb depth is 24
[    1.359653] [drm]    pitch is 6912
[    1.360531] fbcon: amdgpudrmfb (fb1) is primary device
[    1.360532] fbcon: Remapping primary device, fb1, to tty 1-63

Here is the whole Xorg.0.log content: http://pastebin.com/BprgEdSj. Some snippets below. The first all seem to do with the AMD GPU:

$ grep '(EE)' /var/log/Xorg.0.log
15:     (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
73:[    26.937] (EE) Failed to load module "fglrx" (module does not exist, 0)
123:[    27.200] (EE) Failed to load module "fglrx" (module does not exist, 0)
751:[    29.273] (EE) modeset(0): [DRI2] No driver mapping found for PCI device 0x1002 / 0x6939
752:[    29.273] (EE) modeset(0): Failed to initialize the DRI2 extension.
756:[    29.277] (EE) AIGLX: reverting to software rendering

Here is some sections I picked out manually:

$ less /var/log/Xorg.0.log (then manual copy/paste)
[    27.200] (II) LoadModule: "intel"
[    27.201] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
[    27.201] (II) Module intel: vendor="X.Org Foundation"
[    27.201]    compiled for 1.17.2, module version = 2.99.917
[    27.201]    Module class: X.Org Video Driver
[    27.201]    ABI class: X.Org Video Driver, version 19.0
[    27.201] (II) UnloadModule: "intel"
[    27.201] (II) Unloading intel
[    27.201] (II) Failed to load module "intel" (already loaded, 0)
...
[    27.210] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
        i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
        915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
        Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
        GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
...
[    27.211] (II) intel(G0): Using Kernel Mode Setting driver: i915, version 1.6.0 20150731
[    27.211] (II) intel(G0): SNA compiled: xserver-xorg-video-intel 2:2.99.917+git20150808-0ubuntu4 (Robert Ancell <robert.ancell@canonical.com>)
[    27.211] (II) intel(G0): SNA compiled for use with valgrind
AVH
  • 200
  • give output of (version) : dpkg -l xserver-xorg-video-intel – EdiD Jan 24 '16 at 18:01
  • @EdiD I've added the output to my post. – AVH Jan 24 '16 at 18:24
  • I don’t understand what for have you connected one monitor to two cards? You can launch virtual machine using one. Probably intel is not in use – EdiD Jan 24 '16 at 18:37
  • @EdiD Presumably for VGA passthrough, so the guest OS can directly access the video card for better isolation and performance. – bain Jan 24 '16 at 19:11
  • What does xrandr | grep connected show? – bain Jan 24 '16 at 19:12
  • @EdiD It is indeed for VGA passthrough, so I can have a Windows VM at near native speeds using the AMD GPU while linux uses the Intel iGPU. I can switch between which OS I see using a KVM switch. – AVH Jan 24 '16 at 19:27
  • @bain Added xrandr output which does not show the iGPU outputs. – AVH Jan 24 '16 at 19:31
  • ls -l /sys/class/drm – bain Jan 24 '16 at 20:57
  • @bain: Added the content of that directory. All the outputs seem to be listed there, strange. – AVH Jan 24 '16 at 21:06
  • grep '(EE)' /var/log/Xorg.0.log (or any other odd messages from that file) – bain Jan 24 '16 at 22:38
  • @bain There you go. – AVH Jan 25 '16 at 07:43
  • Intel driver looks ok - reports monitor W2252. Errors are from AMD card which falls back to software rendering because R9 380 with PCI ID 1002:6939 is not recognised. There is a question about that card. I guess if you are only going to use it in passthrough mode then you don't actually need it to work in xorg. Your monitor is being detected by both drivers (grep 'Monitor name' /var/log/Xorg.0.log). – bain Jan 25 '16 at 12:14
  • I think what you want is for the AMD card to be ignored by Xorg rather than falling back to software mode. In which case you need to create an xorg.conf with only the Intel card configured (Xorg :0 -configure then edit and remove references to AMD device). Alternatively, just remove the non-Intel driver that is in use (apt-get purge xserver-xorg-video-modesetting) - but be warned you may have to boot from USB to reinstall this package if you then don't have video. – bain Jan 25 '16 at 12:16
  • @bain I can give it a try tonight, but that might leave me with no working display. I don't get why Ubuntu doesn't show me 2 detected displays, the Intel display outputs simply don't show up anywhere in a GUI. – AVH Jan 25 '16 at 12:40
  • I'd guess it's because Xorg generally doesn't work with a single desktop with multihead on multiple GPUs (the exception is multiple Nvidia cards on the closed source driver with option Xinerama, but apparently even that doesn't work anymore). The Ubuntu tools will be manipulating the Xorg screen attached to your AMD card. You can try the Xorg :0 -configure followed by Xorg -config xorg.conf.new to test without making permanent changes. You will need to be logged in without X running, as root, for the X configure stuff to work. – bain Jan 25 '16 at 13:29
  • @bain Your last comment (and some more reading on the net) put me on the right track! Setting the iGPU as the default one to use for POST in the BIOS/UEFI fixed the problem. Two displays now show up in the "Display" settings GUI. (The extended desktop on the AMD GPU is a garbled mess, but that doesn't matter for my use case.) Do you want to put your suggestions in an answer so I can accept it? I'm sure more people will have this problem at some point. – AVH Jan 25 '16 at 18:36

1 Answers1

2
$ xrandr | grep connected
2:DisplayPort-1 disconnected (normal left inverted right x axis y axis)
3:HDMI-3 disconnected (normal left inverted right x axis y axis)
4:DVI-0 connected 1680x1050+0+0 (normal left inverted right x axis y axis) 474mm x 296mm

Xorg only knows about 3 video outputs.

$ ls -l /sys/class/drm
total 0
lrwxrwxrwx 1 root root    0 Jan 24 18:51 card0 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-DP-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-DP-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-HDMI-A-1 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-HDMI-A-2 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-2
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card0-HDMI-A-3 -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-HDMI-A-3
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-DP-2 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DP-2
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-DVI-D-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DVI-D-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-DVI-I-1 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-DVI-I-1
lrwxrwxrwx 1 root root    0 Jan 24 18:53 card1-HDMI-A-4 -> ../../devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1/card1-HDMI-A-4

The kernel has detected 2 video cards with multiple outputs on both.

$ grep '(EE)' /var/log/Xorg.0.log
751:[    29.273] (EE) modeset(0): [DRI2] No driver mapping found for PCI device 0x1002 / 0x6939
752:[    29.273] (EE) modeset(0): Failed to initialize the DRI2 extension.
756:[    29.277] (EE) AIGLX: reverting to software rendering

The AMD R9 285 card has fallen back to software rendering because PCI ID 1002:6939 is not recognised. You could potentially fix this by upgrading the radeon driver, but for VGA passthrough you don't actually need Xorg to work.

$ `grep 'Monitor name' /var/log/Xorg.0.log
[    29.080] (II) modeset(0): Monitor name: W2252
[    29.173] (II) intel(G0): Monitor name: W2252

The monitor is detected by both drivers.

For VGA passthrough of the AMD GPU, you need Xorg to only use the Intel GPU. You could create an xorg.conf with only the Intel device configured (Xorg :0 -configure then edit and remove references to AMD device). Alternatively, just remove the non-Intel driver that is in use (apt-get purge xserver-xorg-video-modesetting in this case) - but be warned you may have to boot from USB to reinstall this package if you then don't have video.

But in this case the problem was solved by configuring the BIOS/UEFI to use the Intel iGPU as the default one to use for POST. This could indicate that the problem was caused by a bug in the Linux Skylake init code, where it sets up the display properly if the BIOS has already initialised it, but fails otherwise.

bain
  • 11,260