I confirm the issue on Ubuntu 18.04 base with kernel 4.15.0-88, NVidia
drivers 435.21 and 440.59 make no difference in the behavior. After
'prime-select intel' the nvidia driver is not loaded at all and intel
graphcs are active, but according to PowerTop the NVIDIA chip still
consumes the power. Acer laptop, NVidia 1050 Ti, Intel i5-7300HQ.

(TLDR: see SOLUTION at the end of the comment!)

Good thing is: as reported in comment #61 above by Vincente, command
from PowerTop Tunables tab (Runtime PM for PCI device NVIDIA Corporation
GP107M) actually helps to power off the NVidia chip and power
consumption goes down by a ~10W. Unfortunately, that does not persist
after system restart.

After checking the relevant NVidia driver manual 
http://us.download.nvidia.com/XFree86/Linux-x86_64/440.59/README/dynamicpowermanagement.html
 I have found that same command to enable the runtime power management which 
PowerTop uses:
 echo auto > /sys/bus/pci/devices/0000\:01\:00.0/power/control
or a variant with proper privileges:
 sudo sh -c 'echo auto > /sys/bus/pci/devices/0000:01:00.0/power/control'
That does the trick as well, so PowerTop is not needed to enable it.

GREAT THING AND THE SOLUTION: after reading the 'Automated Setup'
section in the nvidia manual above, I have found a way to automate that.
No bbswitch, no tlp tools, no extra scripts/services! Just create a file
named 80-nvidia-poweroff.rules in /lib/udev/rules.d/ directory with the
following content:

# Enable runtime PM for NVIDIA VGA/3D controller devices by default (if the 
driver is not / will not be bound)
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", 
ATTR{class}=="0x030000", DRIVER=="", TEST=="power/control", 
ATTR{power/control}="auto"
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", 
ATTR{class}=="0x030200", DRIVER=="", TEST=="power/control", 
ATTR{power/control}="auto"

Save and reboot the system. Done! The nvidia chip will be in power off
mode already when you open the PowerTop to check that. And that will
work only when the intel is selected as an active controller by prime-
select tool, so should be safe when nvidia is set as active instead.

P.S. I wish this to be done automatically when installing the nvidia
driver... No magic for installer to create that file.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to nvidia-prime in Ubuntu.
https://bugs.launchpad.net/bugs/1765363

Title:
  prime-select intel is not powering off the nvidia card

Status in nvidia-prime package in Ubuntu:
  Confirmed

Bug description:
  Right now, it seems that prime-select intel makes sure the nvidia driver is 
not loaded, as nvidia-settings reports.
  But my power consumption is > 20W.
  cat /proc/acpi/bbswitch reports the card is still on. 

  
  If bbswitch and powertop are reliable, then the nvidia card is still powered.
  This is a thinkpad w520 in Optimus mode.

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: nvidia-prime 0.8.7
  ProcVersionSignature: Ubuntu 4.15.0-15.16-generic 4.15.15
  Uname: Linux 4.15.0-15-generic x86_64
  ApportVersion: 2.20.9-0ubuntu5
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Thu Apr 19 19:56:21 2018
  Dependencies:
   
  EcryptfsInUse: Yes
  InstallationDate: Installed on 2017-12-14 (125 days ago)
  InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
  PackageArchitecture: all
  SourcePackage: nvidia-prime
  UpgradeStatus: Upgraded to bionic on 2018-03-09 (41 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nvidia-prime/+bug/1765363/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to