graphics/driver_version is always reporting fglrx in Intel+AMD hybrid systems, despite the loaded card

Bug #1522355 reported by Ara Pulido on 2015-12-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Provider for Plainbox - Checkbox
Undecided
Po-Hsu Lin

Bug Description

We have several systems with Intel+AMD hybrid configuration and our driver_version script is always reporting fglrx as the driver, no matter whether the AMD card or the Intel one is the selected one.

------------- VIDEO DRIVER INFORMATION -------------
Video Driver: fglrx
Driver Version: 15.20.3

------------- HYBRID GRAPHICS CHECK ----------------
Graphics Chipset: Intel (8086:1916)
Graphics Chipset: AMD (1002:6907 (rev ff))
Loaded DDX Drivers: fglrx, intel
Hybrid Graphics: yes

This is probably a bug in our script

Related branches

Ara Pulido (ara) on 2015-12-03
Changed in plainbox-provider-checkbox:
assignee: nobody → Po-Hsu Lin (cypressyew)
Po-Hsu Lin (cypressyew) on 2015-12-04
Changed in plainbox-provider-checkbox:
status: New → In Progress
Po-Hsu Lin (cypressyew) on 2015-12-04
tags: added: scripts
Po-Hsu Lin (cypressyew) wrote :

On this I+A hybrid graphic system, this is the Xorg log when running with the AMD GPU:
(grep -i -e 'switch to mode' -e 'Setting mode' -e 'EDID for output' -e 'Assigned')
[ 12.911] (II) fglrx(0): EDID for output eDP1
[ 12.916] (II) fglrx(0): EDID for output DP1
[ 12.922] (II) fglrx(0): EDID for output HDMI1

This is exactly what we expected to capture when running on the AMD GPU.

This is what it returns with the power-saving mode (Intel GPU):
[ 11.911] (II) fglrx(0): switch to mode 1366x768@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none

This comply with the rule that we expected to see with the Intel GPU, however it's reporting fglrx here.

Therefore it's always reporting fglrx in both Performance / Power-saving mode.

But from the /usr/lib/nux/unity_support_test -c -p, the driver will be different there.

Po-Hsu Lin (cypressyew) wrote :

It's obvious that the old method we use is not reliable anymore, my assumption is that when using the power-saving mode, it will call the Intel driver through the fglrx driver. This yet needs to be confirmed with driver experts.

From the diff between the Performance and the Power-saving mode, there are some clues that might be helpful for us to re-write the code:

AMD:
(II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/modules/extensions/libglx.so
(II) Module glx: vendor="Advanced Micro Devices, Inc."

Intel:
(II) Loading /usr/lib/xorg/modules/extensions/libglx.so
(II) Module glx: vendor="X.Org Foundation"
(==) AIGLX enabled

---------------------------
AMD:
(II) fglrx(0): pEnt->device->identifier=0x7f5ce7a6ab50
(II) intel(1): pEnt->device->identifier=(nil)

Intel:
(II) fglrx(0): pEnt->device->identifier=0x7f08a9456b50
(II) intel(1): Using Kernel Mode Setting driver: i915_bpo, version 1.6.0 20150522
(II) intel(1): SNA compiled: xserver-xorg-video-intel-lts-vivid 2:2.99.917-1~exp1ubuntu2.2~trusty1 (Timo Aaltonen <email address hidden>)
(II) intel(1): SNA compiled for use with valgrind
(II) intel(1): pEnt->device->identifier=(nil)

---------------------------
AMD:
(II) fglrx(0): PowerXpress: Discrete GPU is selected.

Intel:
(II) fglrx(0): PowerXpress: Integrated GPU is selected.
...
(II) fglrx(0): Turned off the discrete card

Po-Hsu Lin (cypressyew) wrote :

Discussed with Alberto, he confirmed my assumption for the fglrx loading intel driver stuff:
"Your assumption is correct. Fglrx loads the intel driver, hence the entry in the log."

So,
there are two ways to fix this for an I+A system running in power-saving mode:
1. Force the script to return "intel" when it founds the pattern that matches what we expected to see on Intel GPU, that is:

    # For 4th Intel on 3.11
    m = re.search(
        r'\(II\) (.*)\(\d+\): switch to mode .* using (.*),', line)
    if m:
        self.displays[display_name] = display
        self.video_driver = m.group(1)

In this code, it will match with the following line in Xorg.log:
(II) fglrx(0): switch to mode 1366x768@60.0 on eDP1 using pipe 0, position (0, 0), rotation normal, reflection none

And return "fglrx", which we expect it should be "intel", we just need to replace the "m.group(1)" with "intel", and this issue will gone.

2. Alberto provides another approach to do the driver detection, which is by detecting the loaded modules. For an I+A system in power-saving mode, we can check if fglrx is NOT loaded, then we check with the dmesg to see if it was ever loaded (thus we know we have fglrx installed, and it's unloaded as we're in the power-saving mode. Check if i915 is loaded in the end)

Or, we can combine these two method as a double safe.

Po-Hsu Lin (cypressyew) on 2015-12-15
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
milestone: none → 0.24
Pierre Equoy (pieq) on 2015-12-15
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
Pierre Equoy (pieq) on 2015-12-15
Changed in plainbox-provider-checkbox:
status: Fix Released → Fix Committed
milestone: 0.24 → 0.25
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers