Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 414725 - x11-drivers/nvidia-drivers: The nvidia driver needs to run nvidia-settings on login to restore user settings (patch included)
Summary: x11-drivers/nvidia-drivers: The nvidia driver needs to run nvidia-settings on...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Freedesktop bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-05 12:12 UTC by Nikos Chantziaras
Modified: 2016-05-17 20:56 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
X session script for executing nvidia-settings (95-nvidia-settings,107 bytes, text/plain)
2012-05-05 12:13 UTC, Nikos Chantziaras
Details
Patch against nvidia-drivers-295.49.ebuild for installing the X session script (xsession-script.patch,573 bytes, patch)
2012-05-05 12:13 UTC, Nikos Chantziaras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nikos Chantziaras 2012-05-05 12:12:20 UTC
Currently, any settings changed through the nvidia-settings control panel (like digital vibrance, Xv Sync to VBlank, anti-aliasing, etc.) are not restored on login. For that to happen, "nvidia-settings --load-config-only" needs to run.

Gentoo does not currently install an X session script (/etc/X11/xinit/xinitrc.d/) for this.  I am attaching an X session script for nvidia-settings, as well as a patch against nvidia-drivers-295.49.ebuild that installs it.
Comment 1 Nikos Chantziaras 2012-05-05 12:13:18 UTC
Created attachment 310869 [details]
X session script for executing nvidia-settings
Comment 2 Nikos Chantziaras 2012-05-05 12:13:59 UTC
Created attachment 310871 [details, diff]
Patch against nvidia-drivers-295.49.ebuild for installing the X session script
Comment 3 Doug Goldstein gentoo-dev 2012-05-06 21:47:50 UTC
I'm not sure if this will result in a double run since GNOME and KDE both appear to do this on startup when using the nvidia-driver.
Comment 4 Nikos Chantziaras 2012-05-06 21:52:50 UTC
(In reply to comment #3)
> I'm not sure if this will result in a double run since GNOME and KDE both
> appear to do this on startup when using the nvidia-driver.

I'm on KDE.  It's not executed.  I'm not sure how other distros do this.  Might be worth looking how Ubuntu solves this issue.
Comment 5 Nikos Chantziaras 2012-05-07 12:56:05 UTC
OK, I took a look at nvidia-current_295.40-0ubuntu1_i386.deb. It installs "nvidia-autostart.desktop" to /etc/xdg/autostart with an exec line of:

  Exec=sh -c '/usr/bin/nvidia-settings --load-config-only'

Should we do the same instead of using xinitrc? I'm not sure what the difference would be.
Comment 6 Doug Goldstein gentoo-dev 2012-05-07 14:44:13 UTC
Ask the X11 maintainers. I'm not really sure.
Comment 7 Chí-Thanh Christopher Nguyễn gentoo-dev 2012-05-07 14:48:17 UTC
xdg is freedesktop stuff.
Unless it makes sense to launch nvidia-settings before login, nothing that X11 maintains is involved.
Comment 8 Nikos Chantziaras 2012-05-07 14:56:51 UTC
(In reply to comment #7)
> xdg is freedesktop stuff.
> Unless it makes sense to launch nvidia-settings before login, nothing that
> X11 maintains is involved.

It's per-user.  "nvidia-settings -l" applies driver settings stored in ~/.nvidia-settings-rc.

Putting a script in /etc/X11/xinit/xinitrc.d/ does exactly this though, at least here (using KDM); it runs it *after* login. Which seems to be the same result as when using XDG's autostart.
Comment 9 Samuli Suominen gentoo-dev 2012-05-07 15:29:26 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > xdg is freedesktop stuff.
> > Unless it makes sense to launch nvidia-settings before login, nothing that
> > X11 maintains is involved.
> 
> It's per-user.  "nvidia-settings -l" applies driver settings stored in
> ~/.nvidia-settings-rc.
> 
> Putting a script in /etc/X11/xinit/xinitrc.d/ does exactly this though, at
> least here (using KDM); it runs it *after* login. Which seems to be the same
> result as when using XDG's autostart.

The only difference here would propably be that /etc/X11/xinit/xinitrc.d/ doesn't need the XDG support from the desktop, as in, /etc/xdg/autostart/ will only work for desktops supporting it, such as, GNOME, KDE, Xfce, LXDE and ROX.

In my opinion, if people want to run minimalistic window managers without proper freedesktop.org support(s) they need to run these type of things own their own as they already are doing for a lot of other things.

So I guess +1 from me for installing the file in /etc/xdg/autostart/
Comment 10 Samuli Suominen gentoo-dev 2012-05-07 15:34:56 UTC
And the file /usr/bin/nvidia-settings is owned by media-video/nvidia-settings instead of x11-drivers/nvidia-drivers. Which one to run? Both can't be installing the .desktop file.

$ qfile -v nvidia-settings
media-video/nvidia-settings-295.40 (/usr/bin/nvidia-settings)
x11-drivers/nvidia-drivers-295.49 (/opt/bin/nvidia-settings)
Comment 11 Samuli Suominen gentoo-dev 2012-05-07 15:38:01 UTC
(In reply to comment #10)
> And the file /usr/bin/nvidia-settings is owned by
> media-video/nvidia-settings instead of x11-drivers/nvidia-drivers. Which one
> to run? Both can't be installing the .desktop file.
> 
> $ qfile -v nvidia-settings
> media-video/nvidia-settings-295.40 (/usr/bin/nvidia-settings)
> x11-drivers/nvidia-drivers-295.49 (/opt/bin/nvidia-settings)

Actually, I lied, both just can't be installing the same named .desktop file, but both could install the .desktop file. This would only lead to a double load of the file.

I guess this bug is pending on nvidia-drivers and nvidia-settings maintainers finally sorting out the mess in between the two packages.
Comment 12 Doug Goldstein gentoo-dev 2012-07-14 20:52:06 UTC
(In reply to comment #11)
> (In reply to comment #10)
> > And the file /usr/bin/nvidia-settings is owned by
> > media-video/nvidia-settings instead of x11-drivers/nvidia-drivers. Which one
> > to run? Both can't be installing the .desktop file.
> > 
> > $ qfile -v nvidia-settings
> > media-video/nvidia-settings-295.40 (/usr/bin/nvidia-settings)
> > x11-drivers/nvidia-drivers-295.49 (/opt/bin/nvidia-settings)
> 
> Actually, I lied, both just can't be installing the same named .desktop
> file, but both could install the .desktop file. This would only lead to a
> double load of the file.
> 
> I guess this bug is pending on nvidia-drivers and nvidia-settings
> maintainers finally sorting out the mess in between the two packages.

That is the solution. The officially supported version is installed in /opt/bin/nvidia-settings, while the Gentoo customized version is installed in /usr/bin/nvidia-settings.
Comment 13 Doug Goldstein gentoo-dev 2012-07-22 21:22:30 UTC
I've added this exactly how Ubuntu does it to 304.22 and newer.
Comment 14 Nikos Chantziaras 2012-07-23 20:17:11 UTC
I noticed a big problem with this.  The .desktop file is executed too late in the startup process (with KDE at least.)  The new driver (302 and later) have GL VSync enabled by default.  This results in much stuttering in KDE's animations (like minimizing/maximizing windows.)

Disabling GL VSync in nvidia-settings and restarting KDE doesn't solve the stuttering problem.  This is because KDE is fully up and running when XDG autostart files are started.  Using /etc/X11/xinit/xinitrc.d/ solves it and the desktop is smooth once again.

In the end, xinit is the only real solution; nvidia-settings needs to run before the window manager, or else the WM will initialize itself using the default driver settings rather than user settings.
Comment 15 Nikos Chantziaras 2012-07-23 20:18:20 UTC
PS:
That means Ubuntu's way of doing it is buggy.
Comment 16 Doug Goldstein gentoo-dev 2012-07-23 20:38:37 UTC
Well I'll let the Freedesktop guys decide how this should be done then.
Comment 17 Pacho Ramos gentoo-dev 2012-07-23 20:57:13 UTC
I agree with using /etc/X11/xinit/xinitrc.d/ for this (I remember to manually add a similar script there long time ago to load some gamma settings for an old monitor that finally died)
Comment 18 Nikos Chantziaras 2012-09-07 11:30:23 UTC
Can we add that now? I think enough time passed and no one seems to have anything against it.

At this point, it's not just a "stylistic" issue, it's a real bug. So the sooner this is changed, the better :-)
Comment 19 Doug Goldstein gentoo-dev 2012-09-13 16:26:40 UTC
Fixed in 304.48.
Comment 20 C.J. Wijtmans 2016-05-17 16:02:36 UTC
Its not fixed, my settings are not restored on relogging.
Comment 21 Doug Goldstein gentoo-dev 2016-05-17 20:56:05 UTC
(In reply to C.J. Wijtmans from comment #20)
> Its not fixed, my settings are not restored on relogging.

Don't comment on a 4 year old closed bug. Open a new one. Your issue might be entirely unrelated.