Thursday, 18 January 2018

Nouveau and constant power-state cycling/loop in (X)Ubuntu 16.04/XFCE with Optimus

You've got yourself an Optimus machine, you've installed nouveau, and one thing that caught your eye is this:

entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynPwr:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynPwr:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynPwr:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynOff:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynOff:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynOff:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynPwr:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$ sudo cat /sys/kernel/debug/vgaswitcheroo/switch
0:DIS: :DynPwr:0000:02:00.0
1:IGD:+:Pwr:0000:00:02.0
entropy@symplex:~$


Your card is cycling between the Dynamic power-on (DynPwr) and Dynamic power-off (DynOff) state. It's wasting your battery and you want it to stay off when it's not being used.

You'll also notice that dmesg shows you this:

[ 1096.319606] nouveau 0000:02:00.0: DRM: resuming kernel object tree...
[ 1096.362341] nouveau 0000:02:00.0: priv: HUB0: 10ecc0 ffffffff (1f70822c)
[ 1096.362355] nouveau 0000:02:00.0: priv: GPC0: 4188ac 00000001 (1a70822e)
[ 1096.434465] nouveau 0000:02:00.0: DRM: resuming client object trees...
[ 1101.536496] ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 1101.537262] ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 1101.537955] nouveau 0000:02:00.0: DRM: evicting buffers...
[ 1101.537962] nouveau 0000:02:00.0: DRM: waiting for kernel channels to go idle...
[ 1101.537988] nouveau 0000:02:00.0: DRM: suspending client object trees...
[ 1101.539366] nouveau 0000:02:00.0: DRM: suspending kernel object tree...
[ 1106.758460] nouveau 0000:02:00.0: DRM: resuming kernel object tree...
[ 1106.801176] nouveau 0000:02:00.0: priv: HUB0: 10ecc0 ffffffff (1b70822c)
[ 1106.801187] nouveau 0000:02:00.0: priv: GPC0: 4188ac 00000001 (1c70822e)
[ 1106.860253] nouveau 0000:02:00.0: DRM: resuming client object trees...
[ 1112.528066] ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 1112.528321] ACPI Warning: \_SB_.PCI0.PEG_.VID_._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[ 1112.528545] nouveau 0000:02:00.0: DRM: evicting buffers...
[ 1112.528548] nouveau 0000:02:00.0: DRM: waiting for kernel channels to go idle...
[ 1112.528566] nouveau 0000:02:00.0: DRM: suspending client object trees...
[ 1112.529810] nouveau 0000:02:00.0: DRM: suspending kernel object tree...
[ 1117.593058] nouveau 0000:02:00.0: DRM: resuming kernel object tree...
[ 1117.635657] nouveau 0000:02:00.0: priv: HUB0: 10ecc0 ffffffff (1870822c)
[ 1117.635664] nouveau 0000:02:00.0: priv: GPC0: 4188ac 00000001 (1e70822e)
[ 1117.680262] nouveau 0000:02:00.0: DRM: resuming client object trees...

Over and over again. Suspending, resuming, suspending, resuming ...

Well, it turns out that it's a Window Manager tweak in XFCE(xfwm4) . This is what you're looking for:


Untick/unselect/disable the "Synchronise drawing to the vertical blank" and you will find that the problem disappears. The card will now stay in DynOff mode while it's not being used.

No comments:

Post a Comment