AMD/AMD hybrid graphics

Boszormenyi Zoltan zboszor at pr.hu
Wed Feb 19 00:11:56 PST 2014


Hi,

I just got a Lenovo Thinkpad Edge E545 notebook and
I have installed Fedora 20/x86_64.

The CPU is Richland A10-5750 (contains ARUBA graphics)
and there is also a discrete HAINAN chip with 2GB dedicated
memory on the mainboard.

The problems started during installation, it looked like the machine
was frozen when using KMS so I had to use VESA during installation.

I was able to install from the network and the latest kernel upgrade
is 3.13.3-201.

So, I was happy at first when I removed "nomodeset" and it booted up
properly in KMS mode and did so after the first few restarts.

Initially lspci showed both cards. dmesg told me that HAINAN was
not posted by the BIOS but the kernel did it and also loaded the
firmware into both cards. Xorg used the integrated ARUBA chip only.

Then I looked up info about PRIME and wanted to test it.
However, "xrandr --listproviders" showed only one line and
"DRI_PRIME=1 glxinfo64 | grep -i renderer" showed that
Mesa is using the ARUBA chip regardless of the DRI_PRIME setting.
I am sorry, I didn't save the xrandr output, so I can't prove it.
Anyway, Xorg.0.log had only traces about the ARUBA, nothing
about the discrete chip. Unfortunately, I didn't save neither dmesg
nor Xorg.0.log at the time.

The UEFI BIOS has a knob to switch between "Integrated Graphics"
and "Switchable Graphics" and switchable was the default. There
is another one for "OS detection for Switchable Graphics: enable/disable"

I started playing with the BIOS settings and this was (or was it?)
a mistake. (But this is how I discovered that the virtualization
enabled/disabled setting in the BIOS is actually reversed and I also
need KVM.)

The result of changing to "Integrated Graphics" in the BIOS and
changing back to "Switchable Graphics" and toggling the
"OS detection" switch to disabled and back to enabled changed
the system behavior.

The symptom is that after systemd loaded all the services, the
machine doesn't seem to do anything at first sight. The systemd
messages are left on the screen but the X greeter (lightdm) doesn't
show up. However, the system reacts to the power button and
shuts down properly. This was encouraging and on the next boot
I tried to ssh into the machine and successfully collect dmesg and
Xorg logs.

It turned out that now, when "Switchable Graphics" is active,
regardless of the state of "OS detection for Switchable Graphics",
Xorg initializes both cards and apparently wants to use the HAINAN
to display the X screen but dies in the process:

[zozo at localhost ~]$ ps auxw | grep Xorg
root       626  0.0  0.0 209748  4320 ?        Ss   08:51   0:00 /usr/bin/abrt-watch-log 
-F Backtrace /var/log/Xorg.0.log -- /usr/bin/abrt-dump-xorg -xD
zozo      1245  0.0  0.0 112680   976 pts/0    S+   08:56   0:00 grep --color=auto Xorg
[zozo at localhost ~]$ ps auxw | grep dm
zozo      1247  0.0  0.0 112676   976 pts/0    S+   08:57   0:00 grep --color=auto dm

Since this is a very new machine it seems footnote 5 from
http://wiki.x.org/wiki/RadeonFeature/ applies and the HAINAN chip
is not connected to the display output.

So, currently I can only get it to display X when I use the "Integrated
Graphics" setting in the BIOS. In this state, the discrete graphics chip
doesn't even show up in lspci:

[zozo at localhost ~]$ cat lspci-hainan-disabled
00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Complex
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Richland [Radeon 
HD 8650G]
00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller
00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Port
00:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Port
00:07.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Port
00:10.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 09)
00:10.1 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB XHCI Controller (rev 09)
00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI 
mode] (rev 40)
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB OHCI Controller (rev 11)
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD] FCH USB EHCI Controller (rev 11)
00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller (rev 16)
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)
00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge (rev 11)
00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD] FCH PCI Bridge (rev 40)
00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 0
00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 1
00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 2
00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 3
00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 4
00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 5
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express 
Gigabit Ethernet Controller (rev 07)
02:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card 
Reader (rev 01)
[zozo at localhost ~]$

[zozo at localhost ~]$ diff -u lspci-hainan-disabled lspci-hainan-active
--- lspci-hainan-disabled    2014-02-19 08:50:00.137888540 +0100
+++ lspci-hainan-active    2014-02-19 08:53:23.523601738 +0100
@@ -1,6 +1,7 @@
  00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Complex
  00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Richland 
[Radeon HD 8650G]
  00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Trinity HDMI Audio Controller
+00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Port
  00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Port
  00:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Port
  00:07.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Root Port
@@ -21,6 +22,7 @@
  00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 3
  00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 4
  00:18.5 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 15h (Models 10h-1fh) 
Processor Function 5
-01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI 
Express Gigabit Ethernet Controller (rev 07)
-02:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)
-03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card 
Reader (rev 01)
+01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun PRO [Radeon HD 
8570A/8570M]
+02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI 
Express Gigabit Ethernet Controller (rev 07)
+03:00.0 Network controller: Broadcom Corporation BCM43142 802.11b/g/n (rev 01)
+04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card 
Reader (rev 01)
[zozo at localhost ~]$

But I would like to have PRIME functional eventually.
What xorg.conf magic should I add to achieve it?

I have dmesg and Xorg logs from this new behavior, both with
"Integrated" and "Switchable" states if you are interested.

With the previous state after installation (which I didn't save logs from),
dmesg matched the new dmesg with "Switchable" set in the BIOS,
so both chips are initialized but the Xorg.0.log matched the log
from the "Integrated" state, i.e. only RADEON(0) lines were found.
Now, with the "Switchable" state, RADEON(0) lines (for ARUBA) and
RADEON(G0) lines (for HAINAN) are present.

On second thought, the usage of VESA for installation and then
switching to KMS might have caused the mixed behaviour, i.e. that
the kernel recognized and initialized both chips but X used only the
integrated one. But I don't want to reinstall the system to test
this theory.

Let me ask again, in case you accidentally skipped the question above:

I would like to have PRIME functional so I will need to set "Switchable
Graphics" in the BIOS. What xorg.conf magic should I add to make it
use the ARUBA chip for display but still keep HAINAN active for PRIME?

Is it possible at this time with Fedora 20 at all? Can Mesa/Xorg use
both r600g and radeonsi at the same time?

[zozo at localhost ~]$ rpm -q kernel mesa-libGL xorg-x11-server-Xorg
kernel-3.13.3-201.fc20.x86_64
mesa-libGL-9.2.5-1.20131220.fc20.x86_64
mesa-libGL-9.2.5-1.20131220.fc20.i686
xorg-x11-server-Xorg-1.14.4-6.fc20.x86_64

Thanks in advance,
Zoltán Böszörményi



More information about the dri-devel mailing list