Where does the Nvidia driver save its settings and re-load them from

This seems to be a popular topic all over the internet but I have yet to find a solution that works. There must be a simple answer so I am hoping someone on here knows the answer.
I have a desktop with a GTX1650s installed.
My system will boot Win10, Win7, Debian Bullseye and Linux Mint 20.1.
I have installed the driver on all systems and they all work very well.

Where I have a problem - a minor annoyance really - is that settings are not preserved across reboots. Nothing serious but the resolution and name. It irks me considerably to see RTK, in Linux, or, worse, Do Not Use in Windows!

Where can I save these settings and re-load them every time I re-boot. I understand that different users have different requirements and want different settings sometimes and I understand that /etc/X11/xorg.conf does nothing.
I have checked the ~/nvidia-settings.rc file but cannot see any entries that resemble what I want.
I must have read at least 100 posts on different forums and no-one seems to know the answer. There really has to be a simple way to do this.

Does anyone here know please?

There isn’t actually one simple answer.
Which exact settings do you want to make persistent?

The only one that is a real pain is having to set the resolution every time I reboot.
Normally, I have 2 screens, the larger one is on the HDMI socket and isn’t a problem. It is the slightly smaller one that always reverts to 1024x768 whereas the manufacturer’s recommended setting is 1400 x 900. This one is on a VGA socket using an appropriate cable. If I was trying to force a mode, I could understand it but I am just setting the recommended resolution.

A setting that is preserved somewhere is the placing of the monitors. The larger monitor is on the left and always comes up as No.2 The smaller one is No.1. On a cold boot, say from a usb, the default always seems to be No.1, which I guess is logical, but the mouse won’t move between them properly. I have to exit the right monitor on the right side and then the cursor enters the left monitor on the left side - rather like Pacman! That is an easy fix, swapping monitors in the driver.
If I do that after installing a system then that setting is preserved and on subsequent boots it remains as set.

The other thing doesn’t matter really, it is just annoying. If I set the name and vendor of the monitor then that is not preserved and I get the strange entries as per my post.
I can’t swap the monitors around without buying new cables because the ports don’t match.

If you can shed some light on where these settings are written then I can experiment from there.

Thanks
Colin

Monitor resolution and arrangement are usually saved by the desktop environment (in ~/.config/monitors.xml) unless a simple window manager is used. Which DE are you using with debian? Mint should preserve it when set through Settings.

If you’re using a desktop environment that wants to control the display configuration, it might be using ~/.config/monitors.xml.

I’m curious where you’re setting the name and vendor of the monitor. Is that in a control panel somewhere?

[Edit: ninja’d by generix! :) ]

I use Cinnamonn desktop on both Debian and Mint. Mint is an older installation, Debian is new.
On both systems I have a file ~/.config/cinnamon-monitors.xml
On Mint there were 2 entries with values (as I had both monitors working then) but on Debian there is just the one. The Mint entry looked a little strange:

RTK
0x1d1a
0x01010101
1440
900
59,887000
1920
0
normal
<reflect_x>no</reflect_x>
<reflect_y>no</reflect_y>
no

Why was the x value set as 1920? That was the x value of the big monitor. I edited it and set it to 0, as per the other entry and also set the vendor to HP and rebooted.
My xorg log file says it set the monitor to 1400x900 from a config file and then futher down it says the setting is 1024x768?
The cinnamon-monitors.xml file is accessed on every boot but my edits were changed back to the previous values?
There must be another config file somewhere that is changing these values.
@aplattner I was setting the monitor name in the xorg.conf file but that doesn’t do anything. I tried in cinnamon-monitors.xml and thet gets overwritten. The name is irrelevent really; it’s the resolution that I would like to fix.

To avoid any confusion re. monitors, my big monitor has broken and is in for repair/replacement so I am left just with the smaller one and while squeezing a 1920 x 1080 desktop onto 1400x900 is acceptable, trying to display it on 1024x768 is a pain.

The name (model/vendor) entries in xorg.conf afaik have no use other than being comments on which entry is what. Maybe those had some more meaning 30 years ago before there was pci and ddc. The names nowadays are taken from the monitor’s edid and the pci-id-db.
The cinnamon-monitors.xml looks a bit odd since it’s not an xml file and I don’t know why they renamed it from standard monitors.xml. the 1920 entry is the x position, being right of your larger monitor. If it really looks like that I’d suspect some bug in cinnamon’s display setting application.
I don’t know though why the monitor gets set to 1024x768. Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

The name and vendor are really not important I just wondered if there was a file where I could set all the ‘wrong’ entries. Obviously, this is more complecated than I thought!

Re. the x setting: it is only present for the small monitor. The large one has the resolution set correctly but the x and y fields are 0.
Only the smaller HP monitor has the X field set, the Y is 0. The X field is wrong.
I was thinking that because the x = 1920 was placed in the HP monitor entry and the monitor obviously cannot display that resolution, maybe that’s why it defaults to a ‘safe’ setting. Is that possible?
Attached is my nvidia-bug-report.log.gz, I hope there is some clue in there.
nvidia-bug-report.log.gz (300.4 KB)

The names are read on the fly from the edid and are not editable stored in any file.
x/y are the position of the monitor, not the resolution. One monitor is placed at 0,0 with horizontal resolution 1920, so the next monitor is placed at 1920,0.
I checked the edid of your monitor and the 1024x768 res is reported as “preferred”.
Before login, lightdm starts the x-session without any prefernces, so I guess the prefered is always used. You could do some fiddling to set it:
https://askubuntu.com/questions/73804/wrong-login-screen-resolution
Why after login the cinnamon display manager doesn’t set the (saved) correct resolution, I don’t know, looks like some bug, maybe check with their developers.

Many thanks for the valuable information.
I understand now why the x value is set and I will investigate the link and see if that will give me any hints.
Just a couple of points:
When I turn on the computer from cold or from sleep, the monitor comes to life before the computer boots. The screen says ‘no data received’ as the computer is still booting but it also says ‘preferred screen resolution 1400x900’ and ‘selected screen resolution 1400 x 900’. I get the same message if I turn on the monitor without a data cable connected, therefore the monitor ‘knows’ what the ideal resolution should be.

In the log file, also included in the file I sent, there are numenous entries showing
98.815] (**) NVIDIA(0): Option “MetaModes” “1440x900_60 +0+0”

100.309] (II) NVIDIA(0): Validated MetaModes:
[ 100.309] (II) NVIDIA(0): “1440x900_60+0+0”
[ 100.309] (II) NVIDIA(0): Virtual screen size determined to be 1440 x 900

and
100.375] (II) NVIDIA(0): Setting mode “1440x900_60+0+0”

The (**) I believe indicate that the resolution is read from a config file.
The (II) I read as being informational only.

Then further down I see
[ 110.752] (II) NVIDIA(0): Setting mode “NULL”
[ 110.798] (II) NVIDIA(0): Setting mode “DP-0: nvidia-auto-select @1024x768 +0+0 {ViewPortIn=1024x768, ViewPortOut=1024x768+0+0}”
Which is strange?

Incidentally, I get the same entries in the debian xorg.log file. Something is not being read or interpreted correctly. The problem is that most of my distros are Debian based and are likely to give the same results. When I get time and a free disk I will experiment with a Red Hat derivative and see if that makes any difference.

Again, many thanks for your help.

Just a follow-up on this.
I made a fresh install of Rocky Linux and then I installed the Nvidia drivers following their tutorial. Everything installed perfectly and I was able to change the resolution. This change IS preserved across reboots, as you would expect.
The xorg.log file is very similar to Debian/Mint with the exception being there are no entries that mention 1024x768. Rocky 8.5 has the Gnome desktop.
It would appear to be either a Debian or Cinnamon issue.

@generix @aplattner
Solved!
I purchased a DVI cable and used that port instead of the DP - VGA cable I was using and the Nvidia driver reads both the name and the correct 1400x900 resolution. Obviously it couldn’t get the info through the other cable. With my other monitor it is a straight HDMI cable and I have never had problems with that.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.