1

I'm on Ubuntu 22.04, I have a MSI G272QPF display monitor and my issue is that when I turn it off the resolution and refresh rate settings (that I had previously set in nvidia-settings) are reset to auto.

$ nvidia-smi output:

+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.58.02              Driver Version: 555.58.02      CUDA Version: 12.5     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4060 Ti     Off |   00000000:26:00.0  On |                  N/A |
| 32%   50C    P5             16W /  165W |    1148MiB /  16380MiB |     32%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

$ xrandr output:

Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-4 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   2560x1440     59.95 + 164.99*  143.97   120.00    85.00  
   1920x1080    119.93   119.88    60.00    59.94  
   1680x1050     59.95  
   1440x900      59.89  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
DP-5 disconnected (normal left inverted right x axis y axis)

NVIDIA configuration:

enter image description here

and I also did "Save X Configuration File".

What can I do to fix that?

Thanks

Frank
  • 1,583

1 Answers1

0

Sounds like you could benefit from a Cron Job

You can create a script that runs on boot to assign your nvidia settings to your statically defined values you listed. I should say this is more of a work around than anything. I'm not sure what is reverting your settings but setting up a cron job should negate the need to constantly update the settings by hand.

Go to your NVIDIA X Server Settings application or simply run nvidia-settings in your CLI. Navigate to your X Server Display Configuration and set the values you want. Click the 'Save to X Configuration File' and ensure your new xorg.conf file is in your /etc/X11/ folder.

Let's create the script that will be run on boot. You can change the path to anywhere you'd like but for this it will just assign in your home directories '.local' folder.

nano ~/.local/nvidia-settings-boot.sh

Now include the Nvidia-settings command to load a configuration file.

nvidia-settings --load-config-only

Now let's make the cron job that will apply your nvidia-settings config file on every boot.

crontab -e

and then add the cron job as

@reboot ~/.local/nvidia-settings-boot.sh

Once this is added you've now got a cron job that will update your nvidia settings on every boot.

I made this post with the combination for a few sources.

  1. Cron Jobs creation
  2. Chaning Screen resolution question

I'm sorry this isn't a solution to what is changing your display settings but I hope this workaround could atleast assist you while you discover other avenues.

Cade Bray
  • 301
  • 1
  • 11