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?
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.
nvidia-xconfig
:/etc/X11/Xwrapper.config
and add:nvidia-settings
:It happily replies with:
Now the Performance State of my GPU stays at P2.
this is how i solved it on my machines (headless servers, using SSH);
make sure tmux is installed, or use SCREEN