Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerMizer options are ignored #7

Open
luiscastro193 opened this issue Mar 4, 2024 · 4 comments
Open

PowerMizer options are ignored #7

luiscastro193 opened this issue Mar 4, 2024 · 4 comments

Comments

@luiscastro193
Copy link

All PowerMizer options seem to be ignored by the driver. Apparently this is a known issue: https://forums.developer.nvidia.com/t/kernel-module-option-nvreg-registrydwords-for-powermizerenable-doesnt-work-on-530-41-03/247610

Do you know how to force max performance with the battery as well? Essentially what _override_max_perf=2 should do. nvidia-smi shows P0 with AC, P3 with the battery and P5 on "low" battery. I would like at least P3 always. Preferably P0 always.

@ventureoo
Copy link
Owner

All PowerMizer options seem to be ignored by the driver. Apparently this is a known issue: https://forums.developer.nvidia.com/t/kernel-module-option-nvreg-registrydwords-for-powermizerenable-doesnt-work-on-530-41-03/247610

Yep, that's sad. I need to update information in the README in that case.

Do you know how to force max performance with the battery as well? Essentially what _override_max_perf=2 should do. nvidia-smi shows P0 with AC, P3 with the battery and P5 on "low" battery. I would like at least P3 always. Preferably P0 always.

You can use nvidia-smi with its --lock-gpu-clocks and --lock-memory-clocks options respectively along with the udev rules. E. g:

# Sets max memory and GPU clocks frequency for my 3050 Mobile
sudo nvidia-smi -lmc 5500,5500
sudo nvidia-smi -lgc 1747,1747

As I said, you can use udev conditions to automatically adjust depending on battery power or AC power supply:

# Rule for when switching to battery
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{name}=="BAT0", RUN+="/usr/bin/nvidia-smi  -lmc min,max", RUN+="/usr/bin/nvidia-smi -lgc min,max"
# Rule for when switching to AC
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{name}=="AC0", RUN+="/usr/bin/nvidia-smi  -lmc min,max", RUN+="/usr/bin/nvidia-smi -lgc min,max"
# Rule for when switching to battery + low battery charge (less than 5%)
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="[0-5]", RUN+="/usr/bin/nvidia-smi -lmc min,max", RUN+="/usr/bin/nvidia-smi -lgc min,max"

Please note that the -lgc and -lmc options only work for Volta+ (Turing and above). You can get the possible frequencies via nvidia-smi -q -d SUPPORTED_CLOCKS

@luiscastro193
Copy link
Author

Power limit seems to be the main bottleneck, even if you set lock-gpu-clocks for example. It's so sad there isn't a simple option to set everything anymore. Please let me know if someone finds something.

@ryanmusante
Copy link

ryanmusante commented Mar 5, 2024

$ sudo nvidia-smi -pl 80

[sudo] password for ryan: 
Changing power management limit is not supported for GPU: 00000000:01:00.0.
Treating as warning and moving on.
All done.

$ \cat /etc/modprobe.d/modprobe.conf | grep -i RegistryDwords

options nvidia NVreg_RegistryDwords="OverrideMaxPerf=0x1" 
options nvidia NVreg_RegistryDwords="PowerMizerDefault=0x1" 
options nvidia NVreg_RegistryDwords="PowerMizerDefaultAC=0x1" 
options nvidia NVreg_RegistryDwords="PowerMizerEnable=0x1" 
options nvidia NVreg_RegistryDwords="PerfLevelSrc=0x2222"

$ \cat /etc/systemd/system/system-startup.sh

#!/bin/bash
nvidia-smi -pm 1
#nvidia-smi -i 0 -pl 80
nvidia-smi -i 0 -lmc 6000,6000
nvidia-smi -i 0 -lgc 1710,1710

I'm not able to set power limits on my mobile gpu.
I assume these are useless entries in my modprobe for now.
However, pushing clocks works fine.

Manjaro/6.7.7/Gnome/11th gen Intel/RTX3080 mobile

@ventureoo
Copy link
Owner

There was a partial solution to increase TDP, on laptops with Ampere and above you need to enable the nvidia-powerd service:

sudo systemctl enable --now nvidia-powerd

In my case on a 3050 Mobile this raises the TDP limit from 35W to 40W, which in turn gives a gain of about ~10 FPS in Furmark without significant temperature changes.

Without nvidia-powerd

image

With nvidia-powerd

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants