FS#52452 - [linux] lspci and every Qt 5 app and wake up dGPU on launch

Attached to Project: Arch Linux
Opened by Eugene Shalygin (eshalygin) - Monday, 09 January 2017, 08:51 GMT
Last edited by Tobias Powalowski (tpowa) - Friday, 24 March 2017, 08:08 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Description:
After a recent update when I launch any Qt 5 app, it wakes up discrete GPU, beginning with Plasma XSession startup programs.

Additional info:
$ lspci
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor DRAM Controller (rev 06)
00:01.0 PCI bridge: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller (rev 06)
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
00:03.0 Audio device: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor HD Audio Controller (rev 06)
00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05)
00:16.0 Communication controller: Intel Corporation 8 Series/C220 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #2 (rev 05)
00:1b.0 Audio device: Intel Corporation 8 Series/C220 Series Chipset High Definition Audio Controller (rev 05)
00:1c.0 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #1 (rev d5)
00:1c.1 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #2 (rev d5)
00:1c.2 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #3 (rev d5)
00:1c.3 PCI bridge: Intel Corporation 8 Series/C220 Series Chipset Family PCI Express Root Port #4 (rev d5)
00:1d.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB EHCI #1 (rev 05)
00:1f.0 ISA bridge: Intel Corporation HM87 Express LPC Controller (rev 05)
00:1f.2 SATA controller: Intel Corporation 8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode] (rev 05)
00:1f.3 SMBus: Intel Corporation 8 Series/C220 Series Chipset Family SMBus Controller (rev 05)
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Neptune XT [Radeon HD 8970M]
03:00.0 PCI bridge: Texas Instruments XIO2213A/B/XIO2221 PCI Express to PCI Bridge [Cheetah Express] (rev 01)
04:00.0 FireWire (IEEE 1394): Texas Instruments XIO2213A/B/XIO2221 IEEE-1394b OHCI Controller [Cheetah Express] (rev 01)
05:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411 PCI Express Card Reader (rev 01)
05:00.2 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 0a)
06:00.0 Network controller: Intel Corporation Wireless 7260 (rev bb)

Wow, lspci does this too.

$ uname -a
Linux kitty 4.8.13-1-ARCH #1 SMP PREEMPT Fri Dec 9 07:24:34 CET 2016 x86_64 GNU/Linux

Steps to reproduce:
launch any Qt 5 app (assistant) or lspci
This task depends upon

Closed by  Tobias Powalowski (tpowa)
Friday, 24 March 2017, 08:08 GMT
Reason for closing:  Upstream
Comment by Doug Newgard (Scimmia) - Tuesday, 10 January 2017, 17:36 GMT
I have no idea what this means.
Comment by Eugene Shalygin (eshalygin) - Tuesday, 10 January 2017, 17:46 GMT
In the meantime I found that firefox does this too. Perhaps it's a kernel problem?
Comment by Doug Newgard (Scimmia) - Thursday, 12 January 2017, 14:45 GMT
I still have no idea what you're talking about.
Comment by Eugene Shalygin (eshalygin) - Thursday, 12 January 2017, 14:54 GMT
Ups, sorry. I thought that you don't know what is the cause of the problem.

I'll try to explain. I have a laptop with two GPU cards (see lspci output above). The AMD one is discrete (dGPU). Normally it is not used and powered off. However, after a recent update launching some software wakes the card up. It switches on, works for a few seconds, and then turns off again. This sequence is similar to results of launching, for instance, glxinfo with DRI_PRIME environment variable set tot 1. dmesg log contains similar entries for these events. The list of software that wake up dGPU I found so far includes all Qt5, lspci, and firefox. Was it clear now?
Comment by Eugene Shalygin (eshalygin) - Monday, 23 January 2017, 23:27 GMT
A few bits of new information: the dGPU wakes up when file /sys/bus/pci/devices/0000:01:00.0/config is accessed (i.e. 'cat /sys/bus/pci/devices/0000:01:00.0/config' is enough). linux-lts (4.4.44-1-lts) is not affected. I can share a kernel config from an identical machine running Gentoo with kernel 4.9 without this problem.
Comment by Eugene Shalygin (eshalygin) - Saturday, 25 February 2017, 15:31 GMT
Persists in kernel 4.9.11
Comment by Eugene Shalygin (eshalygin) - Saturday, 25 February 2017, 15:42 GMT
When I use acpi_call to disable the dGPU, lspci hangs reading that file:
$ strace lspci
...
open("/sys/bus/pci/devices/0000:01:00.0/config", O_RDONLY) = 3
pread64(3,
Comment by Eugene Shalygin (eshalygin) - Monday, 27 February 2017, 09:23 GMT

Loading...