Hi! I’m having an issue getting the settings from .nvidia-settings-rc to load on startup.
I had a issue with my monitor flickering and stuttering when GSync was enabled. I don’t care about it so instead of going through the agony of trying to fix nvidia stuff, I just disabled it which fixed issue.
But now when I reboot, the stuttering and flickering returns untill I open the nvidia settings panel or run nvidia-settings --load-config-only
.
I tried to create a systemd service to run nvidia-settings --load-config-only
on boot, but failed (mostly because I don’t know what I am doing, I have never created a systemd service before, and I am still new to NixOS). Untill I found this post of someone also having a nvidia issue and needing to run nvidia-settings on each boot.
systemd.services.nvidia-load-settings = {
description = "Loads the .nvidia-settings-rc file on boot";
serviceConfig = {
#Type = "simple";
Type = "oneshot";
ExecStart = "${config.hardware.nvidia.package.settings}/bin/nvidia-settings --load-config-only";
};
wantedBy = [ "multi-user.target" ];
};
This actually creates the service but has an error running it.
➜ ~ systemctl status nvidia-load-settings.service
× nvidia-load-settings.service - Loads the .nvidia-settings-rc file on boot
Loaded: loaded (/etc/systemd/system/nvidia-load-settings.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Wed 2024-04-24 22:11:29 CEST; 29s ago
Process: 13295 ExecStart=/nix/store/ry9g089jgzj1agpdb8yy5r5rb3byvgwc-nvidia-settings-545.29.02/bin/nvidia-settings --load-config-only (code=exited, status=1/FAILURE)
Main PID: 13295 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 13ms
apr 24 22:11:29 titanium systemd[1]: Starting Loads the .nvidia-settings-rc file on boot...
apr 24 22:11:29 titanium nvidia-settings[13295]: ERROR: The control display is undefined; please run `/nix/store/ry9g089jgzj1agpdb8yy5r5rb3byvgwc-nvidia-settings-545.29.02/bin/nvidia-settings --help` for usage information.
apr 24 22:11:29 titanium systemd[1]: nvidia-load-settings.service: Main process exited, code=exited, status=1/FAILURE
apr 24 22:11:29 titanium systemd[1]: nvidia-load-settings.service: Failed with result 'exit-code'.
apr 24 22:11:29 titanium systemd[1]: Failed to start Loads the .nvidia-settings-rc file on boot.
Manually restarting the service gives the same result.
Looking up the “The control display is undefined” error didn’t result in any insights for me.
When I run the command myself it runs fine. It does appear to output some kind of error but it has exit code 0 so I assume that is not what the service is complaining about.
➜ ~ nvidia-settings --load-config-only
ERROR: libGL setup error : libGL.so.1: cannot open shared object file: No such file or directory
ERROR: libEGL setup error : libEGL.so.1: cannot open shared object file: No such file or directory
ERROR: libEGL setup error : libEGL.so.1: cannot open shared object file: No such file or directory
➜ ~ echo $?
0
Any help would be appreciated!