Display settings lost on reboot on ubuntu 18.04

Going off of @sri krishna's answer and taking it a step further to explain where the config string came from. Run the Nvidia Settings GUI app directly and set up your display configuration the way you like it.

Then, in the terminal, run nvidia-settings -q=CurrentMetaMode. This will dump output of your current configuration:

Attribute 'CurrentMetaMode' (tx-0:0.0): id=50, switchable=no, source=nv-control :: 
   DPY-1: nvidia-auto-select @1920x1080 +4608+360 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0},
   DPY-3: nvidia-auto-select @2560x1440 +2048+0 {ViewPortIn=2560x1440, ViewPortOut=3840x2160+0+0},
   DPY-2: nvidia-auto-select @2048x1152 +0+288 {ViewPortIn=2048x1152, ViewPortOut=2048x1152+0+0}

Note that I've formatted it slightly here for readablility. I have three displays, here labeled as DPY-1, DPY-2, and DPY-3. Copy the output starting at the first display name all the way to the end of the output and use that for the --assign flag to assign the CurrentMetaMode varible with nvidia-settings:

nvidia-settings --assign CurrentMetaMode="DPY-1: nvidia-auto-select @1920x1080 +4608+360 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0}, DPY-3: nvidia-auto-select @2560x1440 +2048+0 {ViewPortIn=2560x1440, ViewPortOut=3840x2160+0+0}, DPY-2: nvidia-auto-select @2048x1152 +0+288 {ViewPortIn=2048x1152, ViewPortOut=2048x1152+0+0}"

Don't forget the quotes!

You can put this in a startup script or if you're using a shell like Zsh throw it in your .profile for GNOME to pick up when logging in.


just in case any one else has this issue

i added a script to my startup applications to apply the nvidia settings at every login.

#!/bin/bash
nvidia-settings --assign CurrentMetaMode="HDMI-0: 2560x1440 +0+0 {viewportin=2560x1440, viewportout=2560x1440+0+0}, DVI-D-0: 1600x900 +2560+0 {viewportin=1600x900, viewportout=1600x900+0+0}"

This makes my default screen as the HDMI output with the set resolution and the DVI output as my second screen next to my primary.


I was able to get my display settings to persist after reboot by installing the Nvidia X Server Settings application from the Ubuntu software center.

Steps taken:

1) Use proprietary Nvidia Drivers:

  • Click the Ubuntu menu button, or windows button if you have one on your keyboard.
  • Type Software & Upgrades and click the Icon that comes up with that name.
  • Click the Additional Drivers tab. And select the appropriate Nvidia Driver to use, click apply and wait for it to finish.
  • Reboot, although it might not be needed.

2) Install Nvidia X Server Settings:

  • Click the Ubuntu menu button again.
  • Type Nvidia
  • Click Nvidia X Server Settings
  • Click Install
  • Once done installing, set the display settings (again) you would like to keep in the Ubuntu Displays configuration
  • Save/Apply/Keep settings. Note: you may have to change the settings to something else and back again just to get it to save
  • Reboot to test

Some steps may not be necessary for others but this is what worked for me. Hopefully it helps someone else.