Bug 815796 - Can't turn off discrete graphics using vgaswitcheroo
Can't turn off discrete graphics using vgaswitcheroo
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
17
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-24 10:25 EDT by Jonathan Dieter
Modified: 2012-06-04 21:23 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-26 18:24:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Dieter 2012-04-24 10:25:20 EDT
Description of problem:
In Fedora 17 kernels (and it may be tied in to X, I'm not sure), the system is unable to detect which display adapter is in use.  Because of this, echoing OFF to /sys/kernel/debug/vgaswitcheroo/switch turns off *both* graphics adapters, not just the unused one.

On Fedora 16, even with the latest F16 kernels, the system does detect the active adapter and echoing OFF to /sys/kernel/debug/vgaswitcheroo/switch only shuts off the unused device (which for me is most often the discrete adapter).

Version-Release number of selected component (if applicable):
kernel-3.3.2-8.fc17.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Boot computer and log in to Gnome 3
2. Type "echo OFF > /sys/kernel/debug/vgaswitcheroo/switch"
  
Actual results:
Both graphics adapters are shut off, display freezes and the only way to access the system is through ssh.

Expected results:
Unused graphics adapter shuts off, laptop draws less power and fans aren't running all the time.

Additional info:
This is a HP dv6t, with both an Intel integrated adapter and a discrete AMD adapter.  My main goal is that the unused adapter be shut down and I'm not really pushed on how that happens.

$ lspci
00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200/2nd Generation Core Processor Family PCI Express Root Port (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
00:16.0 Communication controller: Intel Corporation 6 Series/C200 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 1 (rev b5)
00:1c.1 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 2 (rev b5)
00:1c.2 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 3 (rev b5)
00:1c.3 PCI bridge: Intel Corporation 6 Series/C200 Series Chipset Family PCI Express Root Port 4 (rev b5)
00:1d.0 USB Controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller (rev 05)
00:1f.3 SMBus: Intel Corporation 6 Series/C200 Series Chipset Family SMBus Controller (rev 05)
01:00.0 VGA compatible controller: ATI Technologies Inc NI Seymour [AMD Radeon HD 6470M]
07:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
0d:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000
13:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5209 (rev 01)
19:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)

Relevant devices are 00:02.0 and 01:00.0.
Comment 1 lukas boehm 2012-05-13 14:25:15 EDT
For me it worked at least on 3.3.3, but on 3.3.4 it is broken (again?).
I am also running Fedora 17 x86-64, my system (acer 3820tg) contains a core i5 (1st gen) and a ati 5650.

What I saw when I went through lspci (which I wanted to add here), is that it doesn't list the intel VGA controller any more. Before, I had a script to change between both cards that used 
lspci | grep VGA | sed -n '1p' | cut -f 1 -d " "
to get the cards' pci IDs, which now of course doesn't work any more.
I hope this helps a little.
Comment 2 lukas boehm 2012-05-13 15:19:01 EDT
Sorry, please forget about the info that it may have worked on 3.3.3 fedora release. Chances are high that I only tried it with a cutom kernel built from kernel.org sources.
Comment 3 zero_slash_dot-redhat 2012-05-14 17:39:46 EDT
Hi,

I have the same issue with my notebook: HP TouchSmart tm2

Besides when I try to disable the dedicated graphics card, the output of '/sys/kernel/debug/vgaswitcheroo/switch' doesn't change:

$ cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD: :Pwr:0000:00:02.0
1:DIS: :Pwr:0000:01:00.0

$ echo "DIGD" > /sys/kernel/debug/vgaswitcheroo/switch

$ cat /sys/kernel/debug/vgaswitcheroo/switch
0:IGD: :Pwr:0000:00:02.0
1:DIS: :Pwr:0000:01:00.0


$ lspci                                                                       
00:00.0 Host bridge: Intel Corporation Mobile 4 Series Chipset Memory Controller Hub (rev 07)
00:01.0 PCI bridge: Intel Corporation Mobile 4 Series Chipset PCI Express Graphics Port (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller (rev 07)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 03)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 03)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 03)
00:1b.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 1 (rev 03)
00:1c.1 PCI bridge: Intel Corporation 82801I (ICH9 Family) PCI Express Port 2 (rev 03)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 03)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 03)
00:1d.2 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #3 (rev 03)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 93)
00:1f.0 ISA bridge: Intel Corporation ICH9M-E LPC Interface Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation ICH9M/M-E SATA AHCI Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801I (ICH9 Family) SMBus Controller (rev 03)
01:00.0 VGA compatible controller: ATI Technologies Inc M93 [Mobility Radeon HD 4300/4500 Series]
01:00.1 Audio device: ATI Technologies Inc RV710/730
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 03)
03:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000
Comment 4 alpheex 2012-05-22 15:47:25 EDT
Hi,

I have also this issue(Acer TimelineX 5820TG, AMD+Intel MUX, x86_64).

It worked in kernel-3.3.2-1.fc17, and does not work in kernels later than kernel-3.3.2-5.fc17.

It seems like the vgaswitcheroo fails to register any of the gfx-adapters as active(hence the missing '+' when doing 'cat switch'), and consequently turn off both.

Additional info: 
Also after both adapters are shut down, it's possible to turn both on again by echoing ON > switch (without seeing or over ssh). However, if X is running while doing this, there's some "screen corruption". Switching to the discrete card before powering down does not help.
Comment 5 alpheex 2012-05-22 17:02:07 EDT
It seems like the culprit is the patch named 'vgarb-vga_default_device.patch', I've just recompiled the 3.3.4-5.fc17 kernel without this - and switching works  again.
Comment 6 alpheex 2012-05-22 19:20:32 EDT
Fixed in updates-testing

Sorry for the noise...
Comment 7 Jonathan Dieter 2012-05-23 07:35:36 EDT
Verified that kernel-3.3.6-3.fc17 fixes the bug.
Comment 8 Fedora Update System 2012-05-23 08:30:54 EDT
kernel-3.3.7-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/kernel-3.3.7-1.fc17
Comment 9 Fedora Update System 2012-05-24 11:36:12 EDT
Package kernel-3.3.7-1.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing kernel-3.3.7-1.fc17'
as soon as you are able to, then reboot.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-8314/kernel-3.3.7-1.fc17
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2012-05-26 18:24:29 EDT
kernel-3.3.7-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 budiman 2012-06-04 18:16:28 EDT
It still happens to me using Fedora 17 final release. What I did was:
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
And the screen freeze.

I tried to switch between graphics cards. But the out put of /sys/kernel/debug/vgaswitcheroo/switch doesn't change.
0:IGD: :Pwr:0000:00:02.0
1:DIS: :Pwr:0000:01:00.0
Comment 12 budiman 2012-06-04 21:23:18 EDT
Sorry, I forgot to update the kernel.

Note You need to log in before you can comment on or make changes to this bug.