optimus-manager power management assistance needed

I've been trying set-up power management options for optimus-manager; however, it doesn't seem to disable the GPU at all.

I read the guide here on the forums, the ArchWiki, and the official GitHub.
I also read this.

I tried a lot of different configurations:

nouveau switching
[optimus]
switching=nouveau
pci_power_control=yes
pci_remove=no
pci_reset=no

This configuration prevents shutdown, makes boot time slower, and doesn't switch to GPU with optimus-manager --switch nvidia
Intel energy-rate: 12.3354 W
Nvidia energy-rate: Didn't switch so can't tell.

none switching, no pci_remove
[optimus]
switching=none
pci_power_control=yes
pci_remove=no
pci_reset=no

This configuration seems to work, but doesn't disable GPU.
Intel energy-rate: 12.3354 W
Nvidia energy-rate: 12.3354 W

none switching, yes pci_remove
[optimus]
switching=nouveau
pci_power_control=yes
pci_remove=yes
pci_reset=no

This configuration seems to work, but doesn't disable GPU.
Intel energy-rate: 12.3354 W
Nvidia energy-rate: 12.3354 W

bbswitch switching, no pci_remove
[optimus]
switching=bbswitch
pci_power_control=yes
pci_remove=no
pci_reset=no

This configuration seems to work, but doesn't disable GPU.
Intel energy-rate: 12.3354 W
Nvidia energy-rate: 12.3354 W

Finally, I tried to remove the configuration with sudo rm /etc/optimus-manager/optimus-manager.conf
Then optimus-manager --set-startup hybrid
Hybrid energy-rate: 12.3354 W
Nvidia energy-rate: 12.3354 W

Am I missing something?

Method for testing configuration
  1. Set startup to intel with optimus-manager --set-startup intel
  2. Changed the config file in /etc/optimus-manager/optimus-manager.conf (--temp-config PATH doesn't seem to work for me)
  3. Reboot
  4. Run glxspheres64 and watch upower -i /org/freedesktop/UPower/devices/battery_BAT0 until the energy-rate is updated
  5. Switch to nvidia with optimus-manager --switch nvidia
  6. Run glxspheres64 and watch upower -i /org/freedesktop/UPower/devices/battery_BAT0 until the energy-rate is updated
  7. Start again from step 2
inxi -Fxxxz

System:

  Host: LAPTOP-4JDS3FOA Kernel: 5.3.6-1-MANJARO x86_64 bits: 64 
  compiler: gcc v: 9.2.0 Desktop: Xfce 4.14.1 tk: Gtk 3.24.12 
  info: xfce4-panel wm: xfwm4 dm: LightDM 1.30.0 Distro: Manjaro Linux 
Machine:
  Type: Laptop System: HP product: HP ENVY Laptop 13-aq0xxx 
  v: Type1ProductConfigId serial: <filter> Chassis: type: 10 
  serial: <filter> 
  Mobo: HP model: 85E3 v: 29.26 serial: <filter> UEFI: Insyde v: F.07 
  date: 08/01/2019 
Battery:
  ID-1: BAT0 charge: 52.6 Wh condition: 52.6/52.6 Wh (100%) volts: 17.5/15.4 
  model: 333-2B-49-A KC04053XL type: Li-ion serial: <filter> status: Full 
CPU:
  Topology: Quad Core model: Intel Core i7-8565U bits: 64 type: MT MCP 
  arch: Kaby Lake rev: C L2 cache: 8192 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 32012 
  Speed: 600 MHz min/max: 400/4600 MHz Core speeds (MHz): 1: 600 2: 600 
  3: 600 4: 600 5: 600 6: 600 7: 600 8: 600 
Graphics:
  Device-1: Intel UHD Graphics 620 vendor: Hewlett-Packard driver: i915 
  v: kernel bus ID: 00:02.0 chip ID: 8086:3ea0 
  Device-2: NVIDIA GP108BM [GeForce MX250] vendor: Hewlett-Packard 
  driver: nvidia v: 435.21 bus ID: 01:00.0 chip ID: 10de:1d52 
  Display: server: X.Org 1.20.5 driver: modesetting,nvidia 
  resolution: 1920x1080~60Hz 
  OpenGL: renderer: Mesa DRI Intel UHD Graphics (Whiskey Lake 3x8 GT2) 
  v: 4.5 Mesa 19.2.1 compat-v: 3.0 direct render: Yes 
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio 
  vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
  chip ID: 8086:9dc8 
  Sound Server: ALSA v: k5.3.6-1-MANJARO 
Network:
  Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi 
  v: kernel port: 4000 bus ID: 00:14.3 chip ID: 8086:9df0 
  IF: wlo1 state: up mac: <filter> 
Drives:
  Local Storage: total: 953.87 GiB used: 49.28 GiB (5.2%) 
  ID-1: /dev/nvme0n1 vendor: Intel model: SSDPEKNW010T8H size: 953.87 GiB 
  speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: HPS0 scheme: GPT 
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci 
  v: 3.0 port: 4060 bus ID: 00:17.0 chip ID: 8086.282a rev: 30 
Partition:
  ID-1: / size: 475.40 GiB used: 24.61 GiB (5.2%) fs: ext4 
  dev: /dev/nvme0n1p5 
  ID-2: swap-1 size: 16.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/dm-0 
Sensors:
  System Temperatures: cpu: 48.0 C mobo: 36.0 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 298 Uptime: 3m Memory: 15.38 GiB used: 1.63 GiB (10.6%) 
  Init: systemd v: 242 Compilers: gcc: 9.2.0 Shell: bash (sudo) v: 5.0.11 
  running in: xfce4-terminal inxi: 3.0.36

EDIT: Just ran nvidia-smi while in intel mode, and I got this output:

nvidia-smi in intel mode
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.26       Driver Version: 440.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce MX250       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   36C    P0    N/A /  N/A |      0MiB /  2002MiB |      2%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

Then, under nvidia mode:

nvidia-smi in nvidia mode
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.26       Driver Version: 440.26       CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce MX250       Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   48C    P0    N/A /  N/A |    159MiB /  2002MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      3149      G   /usr/lib/Xorg                                157MiB |
|    0      3292      G   xfwm4                                          1MiB |
+-----------------------------------------------------------------------------+

So obviously, it is not using the GPU under intel mode, but I can't tell if it's powered on or not because it says N/A under power usage.
Btw, this is using the "none switching, no pci_remove" configuration from above.

1 Like

using upower to read power usage it not reliable. use powertop instead. if you tab over to devices and the nvidia shows 0% then it's powered down, if it shows anything above %0 then it's not

ON

100.0%        PCI Device: NVIDIA Corporation GM107M [GeForce GTX 960M]

OFF

0.0%        PCI Device: NVIDIA Corporation GM107M [GeForce GTX 960M]
1 Like

Hi. Thanks for the reply.

I'm currently using the "none switching, no pci_remove" configuration.
When in intel mode, the graphics card does not show up at all, but when in nvidia mode, it shows 100%.
Is that supposed to happen? I have pci_remove set to no in /etc/optimus-manager/optimus-manager.conf.
Also, how can I be sure it is disabled when in intel mode if it is not showing up in powertop?

Edit: I also forgot to mention in the original post that a terminal is always open with nothing running on it when I login, even from a shutdown. I checked the Application Autostart, and I don't have a terminal set there.

i just wanted to suggest a better option for monitoring power usage, i try to stay away from optimus-manager problems. sorry. maybe @michaldybczak could answer that?

This looks like a question to optimus-manager developer. Please, start an issue here:

and give your hardware specs and driver version as well.
Personally, I never tested is so thoroughly when it comes to power usage so I can't tell anything.

1 Like

I'm not very familiar with GitHub and such (still a newbie), but I always assumed that opening an issue meant that there was a bug with the program, not a personal problem(?)

So, should I open an issue asking for power monitoring options, or saying that the graphics card is not showing up in powertop even though I have pci_remove set to no?

Edit: Also should I open a separate issue about the terminal being launched automatically on login?

It turns out I was being stupid. :stuck_out_tongue:
The powertab out was full, so it didn't show the Nvidia card.
I couldn't scroll down with down arrow, so I thought that was it. Apparently it's a bug in version 2.1.
I ran powertab -C to generate a .csv file and saw the whole output (the GPU was indeed turned off).

Just edit your first reply and add that information, so I can mark it as a solution.

Edit: Also, in a situation like this, should I email the packager of powertop and ask for the patch to be added, or just wait for the next version to be released?

1 Like

you should check if it's already reported as a bug first, if it's not then report it.

added, i think :man_shrugging:

he a question about this where do you put this configuration
[optimus]
switching=nouveau
pci_power_control=yes
pci_remove=yes
pci_reset=no

iirc there's an optimus-manager.conf and i think it's located /etc/optimus-manager/ or something like that

so just create the file and paste like that ?
thanks

no, there should already be an optimus manager .conf file somewhere

there is one here /usr/share/optimus-manager.conf . but it says it should not be edited when i try
a error occurer with optimus so maybe create one ?
/etc/optimus-manager/optimus-manager.conf

If you don't have this file, create it. The inner structure looks like this:

[intel]
DRI=3
accel=
driver=modesetting
modeset=yes
tearfree=

[nvidia]
DPI=96
PAT=yes
ignore_abi=no
modeset=yes
options=overclocking

[optimus]
auto_logout=yes
pci_power_control=yes
pci_remove=yes
pci_reset=no
switching=bbswitch
1 Like

Can SOmeone help with this issue?I too am facing this problem,My battery is getting hot, and drains quickly within 2 to 2:30 hours (it never happened in windows).
I am using intel gfx but still the powertop uses NVIDIA
The output of powertop Device Stats is:

The battery reports a discharge rate of 11.7 W
The power consumed was 0.00 J
System baseline power is estimated at 2.55 W

Power est.    Usage     Device name
  1.49 W      8.0%        CPU misc
  676 mW      8.0%        CPU core
  381 mW      8.0%        DRAM
    0 mW     30.0%        Display backlight
            100.0%        PCI Device: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16)
            100.0%        Radio device: iwlwifi
            100.0%        Radio device: ideapad_acpi
            100.0%        PCI Device: Intel Corporation Cannon Lake Mobile PCH SATA AHCI Controller
            100.0%        PCI Device: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
            100.0%        PCI Device: Intel Corporation Wireless-AC 9560 [Jefferson Peak]
            100.0%        PCI Device: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile]
            100.0%        PCI Device: Intel Corporation UHD Graphics 630 (Mobile)
            100.0%        PCI Device: Intel Corporation 8th Gen Core 4-core Processor Host Bridge/DRAM Registers [Coffee Lake H]
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH Thermal Controller
            100.0%        PCI Device: Union Memory (Shenzhen) Device 5008
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH PCI Express Root Port #9
              0.0%        USB device: xHCI Host Controller

It shows:

100.0% PCI Device: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile]

SO Nvidia gfx is still using power right?
How to swtich it off?
What should be the conf file /etc/optimus-manager/optimus-manager.conf
here is the my ouput:

[intel]
DRI=3
accel=
driver=intel
modeset=yes
tearfree=yes

[nvidia]
DPI=96
PAT=yes
ignore_abi=no
modeset=yes
options=overclocking

[optimus]
auto_logout=yes
pci_power_control=no
pci_remove=no
pci_reset=no
switching=bbswitch

Any help is appreciated.
Sorry I am still new to this dealing with graphics drivers.
Thanks in advance.

Are you in Hybrid or Intel mode? The powertop suggests you are in Hybrid mode, if so, just use Intel mode. I don't know what hardware you have, but for older one (1-few years old), hybrid is hardly less energy consuming then Nvidia mode, so it's beneficial to not use it but use Intel mode as default and switch to Nvidia whenever you really need it.

the optimus-manager shows intel icon in the panel in the lower right side. So it should be intel right?Can you tell me how to switch to intel in command line.Sorry i am completely new to this thing

ok i tried sitching into intel using

optimus-manager --switch intel

but the powertop devuce stats still contains nvidia at 100%

          100.0%        Radio device: iwlwifi
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH Shared SRAM
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH USB 3.1 xHCI Host Controller
            100.0%        Radio device: ideapad_acpi
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH Serial IO I2C Controller #0
            100.0%        PCI Device: Union Memory (Shenzhen) Device 5008
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH Thermal Controller
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH cAVS
            100.0%        PCI Device: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH SPI Controller
            100.0%        PCI Device: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile]
            100.0%        PCI Device: Intel Corporation 8th Gen Core 4-core Processor Host Bridge/DRAM Registers [Coffee Lake H]
            100.0%        PCI Device: Intel Corporation UHD Graphics 630 (Mobile)
            100.0%        PCI Device: Intel Corporation Cannon Lake PCH Serial IO UART Host Controller

here it is

Then the optimus-manager configuration is wrong. Maybe you need to use different switch or you tampered with it somehow.

Show me output of:

cat /etc/X11/xorg.conf.d/10-optimus-manager.conf

systemctl status optimus-manager.service

Ok,
Here is the output for:

cat /etc/X11/xorg.conf.d/10-optimus-manager.conf

Section "Device"
        Identifier "intel"
        Driver "intel"
        BusID "PCI:0:2:0"
        Option "TearFree" "true"
        Option "DRI" "3"
EndSection

and the output for :

systemctl status optimus-manager.service

● optimus-manager.service - Optimus Manager Commands Daemon
   Loaded: loaded (/usr/lib/systemd/system/optimus-manager.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2020-03-13 09:11:39 IST; 11min ago
  Process: 867 ExecStartPre=/usr/bin/prime-switch-boot (code=exited, status=0/SUCCESS)
 Main PID: 3226 (python3)
    Tasks: 1 (limit: 4915)
   Memory: 43.6M
   CGroup: /system.slice/optimus-manager.service
           └─3226 /usr/bin/python3 -u /usr/bin/optimus-manager-daemon

Mar 13 09:11:39 srinjoy-xavier prime-switch-boot[867]: Setting up Intel state
Mar 13 09:11:39 srinjoy-xavier prime-switch-boot[867]: Setting GPU power to OFF via bbswitch
Mar 13 09:11:39 srinjoy-xavier prime-switch-boot[867]: Loaded extra Intel Xorg options (0 lines)
Mar 13 09:11:39 srinjoy-xavier prime-switch-boot[867]: Loaded extra Nvidia Xorg options (0 lines)
Mar 13 09:11:39 srinjoy-xavier prime-switch-boot[867]: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf
Mar 13 09:11:39 srinjoy-xavier systemd[1]: Started Optimus Manager Commands Daemon.
Mar 13 09:11:39 srinjoy-xavier python3[3226]: Optimus Manager (Daemon) version 1.2.2
Mar 13 09:11:39 srinjoy-xavier python3[3226]: Automatic log cropping
Mar 13 09:11:39 srinjoy-xavier python3[3226]: Opening UNIX socket
Mar 13 09:11:39 srinjoy-xavier python3[3226]: Awaiting commands

What should i change?

Forum kindly sponsored by