Problem with nvidia-persistenced not working

I'm having a problem which I think I've narrowed down to the nvidia persistence daemon.

Issue: I have my HTPC connected to my Onkyo receiver. When I turn off the receiver and turn it back on, I have no signal from the HTPC. I can press Ctrl + Alt + F1 and run sudo stop lightdm then sudo start lightdm. Once I do this I'm back to the regular screen. This is not a long-term solution though as

  1. it's a pain
  2. I will have other users who want to watch TV and will not know what to do.

Through my googlefu I found that I need to set persistence-mode to on, though this will be going away. I have tried this method with sudo "nvidia-smi -pm 1" and it will set it to on, but it doesn't appear to work as the issue will re-occur.

I have also tried running sudo nvidia-persistenced --user [user] --persistence-mode and I can see a process start. When I turn my receiver off though, the same thing occurs.

The syslog has the following:

... nvidia-persistenced: Failed to open PID file: File exists
... nvidia-persistenced: Shutdown (5232)

I have made sure the user I have nvidia-persistenced running as is part of the nvidia-persistenced group. I have also set permissions on the /var/run/nvidia-persistenced/ folder to 777.

I'm going crazy trying to resolve this. I want to be able to turn my receiver off and when I turn it back on have the screen where I left off.

  • Running Ubuntu 14.04 (Mythbuntu install)
  • Video card is Nvidia GT 730 using driver 352.63

Also, once I get the nvidia-persistenced daemon working, I need to set it up to start at system startup. How would I go about doing that?


Solution 1:

May 2019

With regards to the errors:

... nvidia-persistenced: Failed to open PID file: File exists
... nvidia-persistenced: Shutdown (5232)

I got this error on Ubuntu 18.04.02 LTS after installation of the CUDA toolkit (10.0) and trying to follow the recommended post installation actions. I followed the guide to install via the nvidia repository.

https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#install-persistenced

The issue for me was that the daemon was actually running already.

To verify run:

ps aux | grep persistenced

and you should get something along the lines

root       714  0.0  0.0   8864  1396 ?        Ss   19:44   0:00 /usr/bin/nvidia-persistenced --verbose
root      6723  0.0  0.0  22000  1112 pts/0    S+   20:25   0:00 grep --color=auto persistenced

Process 714 (in your case the pid will likely be different) is the daemon already running which is why when I executed the command again it failed.

So the service was actually installed already by the cuda packages. To confirm this run:

systemctl list-units --type service --all | grep nvidia

and you should get something like the following:

  nvidia-persistenced.service                           loaded    active   running NVIDIA Persistence Daemon  

This confirms the service is already up and running.

Solution 2:

I was able to resolve this issue with assistance from another forum, but here is the resolution in-case anyone is interested.

Basically follow the instructions in this link: https://www.mythtv.org/wiki/Nvidia-cards_and_no_picture_when_box_is_on_before_the_TV

In case that link is removed, here's the gist of what I did:

  • Run 'nvidia-settings' on the local X-Server
  • Click the entry corresponding to your TV (e.g. DFP-0) Click 'Acquire
  • EDID' and save the 'edid.bin' file someplace safe, for instance
    '/etc/X11/tv-edid.bin'
  • Open your existing config file, usually in /etc/X11/xorg.conf
  • Find the 'Device' section for your video card.
  • Add a line to force the stored EDID:
  • Option "CustomEDID" "DFP-0:/etc/X11/edid.bin"
  • Reboot

I ended up adding the following lines as well, not sure if they are needed or not though:

Option "ModeValidation" "NoDFPNativeResolutionCheck"
Option "ExactModeTimingsDVI" "True"
Option "UseDisplayDevice" "DFP-0"
Option "ConnectedMonitor" "DFP-0" `

Now I'm able to turn off my receiver and/or change the inputs and I can return to my HTPC exactly where I left off.