2

We have a Ubuntu 20.04 server with Nvidia GPUs and want to change the Power Mode / GpuPowerMizerMode to Prefer Maximum Performance.

One way to do this is

nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=1"

However, that would require an X session with access to the respective GPU; editing /etc/X11/xorg.conf would not work for the same reason.

Is there another way to read and set the GpuPowerMizerMode of a Nvidia GPU in Ubuntu?

2 Answers2

1

According to this comment, you need to have a dummy X server running. Here is how I've been able to accomplish this in Ubuntu 20.04.

  1. Install the necessary packages:
sudo apt install xorg
  1. Run nvidia-xconfig:
sudo nvidia-xconfig -a
  1. Edit /etc/X11/Xwrapper.config and add:
allowed_users=anybody
  1. Start the X server:
startx
  1. In another terminal, run nvidia-settings:
DISPLAY=:0.0 nvidia-settings -a "[gpu:0]/GpuPowerMizerMode=1"

It happily replies with:

Attribute 'GPUPowerMizerMode' (orion:0[gpu:0]) assigned value 1.

Now the Performance State of my GPU stays at P2.

jamix
  • 121
  • 4
1

this is how i solved it on my machines (headless servers, using SSH);

make sure tmux is installed, or use SCREEN

tmux new-session -s [your new session's name here]

sudo ls 

sudo X :0 &

export DISPLAY=:0

nvidia-settings -a [whatever commands you want to use]
nvidia-settings -a [whatever commands you want to use]
nvidia-settings -a [whatever commands you want to use]
Butt
  • 11
  • 1