Score:2

How do I troubleshoot nvidia-settings not persisting between sessions?

in flag

I'm running Ubuntu 20.04 and using the nvidia-495 driver.

nvidia-settings simply do not persist between sessions. Specifically resolution but also opengl settings etc.

I have a specific resolution of

viewportin: 1830x1020 viewportout: 1830x1020+45+30 panning: 1830x1020

Without this viewport out my display is "stretched" past visability.

On reboot standard 1920x1080 resolution is applied.

I have tried:

  • Adding /etc/X11/xorg.conf ( no resolution fix )
  • Adding /etc/X11/xorg.conf.d/10-nvidia.conf (no noticeable effect)
  • Adding /usr/share/X11/xorg.conf.d/10-nvidia.conf (Resolution changes to 640x480)
  • Running nvidia-settings --load-config-only (no noticeable effect)

The only solution I have found is:

  • Open nvidia-settings
  • Change the resolution manually: > viewportout=1830x1020+45+30
  • Click "Apply"

then settings are applied.

I have posted some configs and logs on github.

xorg.conf file == 10-nvidia.conf.

Nmath avatar
ng flag
Several of your details are ambiguous or unclear, and some details are missing. Can you [edit](https://askubuntu.com/posts/1383557/edit) your question with more details? 1) What settings are you changing that don't persist? 2) What exactly do you mean in the first two bullets ("adding...") Are you creating blank files in at these paths? Because there are no matching `.conf` files in your github link. 3) Edit your solution so that it is clear. It's not clear what you mean "change the resolution by x", and "change back to setting" also is not clear. What exactly are you doing?
lloydie avatar
in flag
thanks @Nmath. Resolution specically viewport in/out/panning will not persist.
Nmath avatar
ng flag
Your response raises more questions than it answers. What are you using viewport for? Are these valid screen resolutions to begin with? Do they match your display's native resolution? What about all of the other follow-up questions I asked? Please be thorough in your responses otherwise it's difficult to understand the problem well enough to assist
lloydie avatar
in flag
I have a specific resolution of viewportin: 1830x1020 viewportout: 1830x1020+45+30 panning: 1830x1020 Without this viewport out my display is "stretched" past visability. On reboot standard 1920x1080 resolution is applied.
lloydie avatar
in flag
when i boot my screen looks like this : https://lloydie.com.au/onboot.png
lloydie avatar
in flag
with nvidia-settings applied thru UI. i get: https://lloydie.com.au/with_settings.png
lloydie avatar
in flag
please look at top right corner of screen !
Nmath avatar
ng flag
So you are just trying to get your desktop to fit on your screen? I don't think you're supposed to use viewport settings for that. What is the native screen resolution of the display? I've never heard of a display with 1830x1020 resolution
lloydie avatar
in flag
yup. thats all. 1080p . BUT it's a tv ! 1920x1080. i think overscan or some issue like that. I get it's a hack.
lloydie avatar
in flag
But regardliess. Nvidia-settings should persist !
Nmath avatar
ng flag
I don't think you are on the right path. You can disable overscan on the TV and then you can use the native screen resolution. A LED or LCD shouldn't be set to anything else.
lloydie avatar
in flag
I appreciate your help. Seriously how do i make the nvidia-settings persist. It's all over the net people asking how to do this. Im not the only one with problem.
lloydie avatar
in flag
If clicking Apply in UI. FIXES PROBLEM. It's not the HARDWARE
lloydie avatar
in flag
cant diable overscan !
lloydie avatar
in flag
The screen is perfect with resolution
lloydie avatar
in flag
where is the default / global xorg.conf stored ?
Nmath avatar
ng flag
Clearly the problem is not fixed if you are trying to solve it here. I don't know how to solve *the question that you asked* but I definitely know how to solve *the problem that you have*. We call this an [XY Problem](https://meta.stackexchange.com/a/66378). If a TV has an overscan feature it can be disabled. Read the documentation if you need to. There are other problems you will experience setting a display to a non native resolution. Your proposed solution is far from perfect, but if you insist on solving it that way, unfortunately I don't know how to help, but good luck to you.
lloydie avatar
in flag
How do you make nvidia-settings persist ?
lloydie avatar
in flag
I dont know what to say mate thanks but i cant disable overscan. what am i gunna do.
Nmath avatar
ng flag
In your case, I don't. Maybe someone else will know. Good luck
lloydie avatar
in flag
How do you make nvidia-settings persist ? I just don't understand why you can't answer the question
heynnema avatar
ru flag
@lloydie Nvidia 495 is BETA software. Purge it, and install the correct driver for your specific Nvidia card... probably 470. Go to `Software & Updates` Additional Drivers tab.
lloydie avatar
in flag
@heynnema, installed 470. I've realized that when trying to "apply": stderr:Package xorg-server was not found in the pkg-config search path. Perhaps you should add the directory containing `xorg-server.pc' to the PKG_CONFIG_PATH environment variable No package 'xorg-server' found
lloydie avatar
in flag
interestingly just found : sh -c '/usr/bin/nvidia-settings --load-config-only'. in gnome startup applications. So i use xrandr in my normal i3 setup. Didn't even think this would be gnome related.
heynnema avatar
ru flag
@lloydie You purged Nvidia 495, yes? Installed 470 from `Software & Updates`, yes? At your login screen, have you set your session to X11/xorg? You don't want Wayland. Settings/About should say X11. Rebooted?
lloydie avatar
in flag
495 purged. 470 installed. How would i set session to X11/xorg ? I would like wayland, but will be happy with whatever applies nvidia settings properly.
heynnema avatar
ru flag
At login screen, select your username, then click on icon in lower-right corner, select "Ubuntu on X11/xorg", enter password. Check your Nvidia settings. I suspect it'll work now. When leaving comments for me, start the with @heynnema or I'll miss them.
lloydie avatar
in flag
@heynnema. Really Appreciate your help, logging in X11/xorg didn't help at all. I have complete removed gnome now. against your advice. I gave gnome a try just can't deal with it. So i'm back on i3. lxde login manager. Still can't get nvidia setting loaded by default. Nvidia make it clear in docs that i need to run nvidia-settings --load-config prior to loading i3. Where should be looking /etc/X11 ? or do i need ~/.xinitrc. So which script starts lightdm, allowing me to add something like: nvidia-settings --load-config && lightdm.
heynnema avatar
ru flag
@lloydie I don't know how to help you now. I'd say, make sure Secure Boot is disabled in your BIOS, backup your data, wipe the disk (or just wipe Ubuntu, if you also have Windows), reinstall Ubuntu fresh from a Ubuntu Live USB, set X11/xorg for your session via the login screen, install Nvidia from `Software & Updates`. Reboot. Retest.
heynnema avatar
ru flag
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/132611/discussion-between-heynnema-and-lloydie).
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.