[Bug] Starting sunshine as ubuntu service cause failure in capture display and drivers #280
-
Is there an existing issue for this?
Is your issue described in the documentation?
Is your issue present in the nightly release?
Describe the BugSunshine works properly when launching from terminal. When I registered it as a ubuntu service as follows:
The executable cannot find display or encoders. Here is what the log shows:
Moonlight connections will also fail with prompt regarding "video capture failure" Note that starting sunshine over ssh would yield identical log outputs. I did not find solutions to this in the documentation, issue #348 indicates similar senario but I did not encounter permission issues like him. Expected BehaviorFunction as normal sunshine command in command prompt on host machine Additional ContextNo response Host Operating SystemLinux Operating System VersionLinux 5.19.0-50-generic, Ubuntu 22.04 Architecture64 bit Sunshine commit or versionvv0.20.0 PackageLinux - deb GPU TypeNvidia GPU ModelNVIDIA RTX 6000 Ada Generation GPU Driver/Mesa Version535.54.03 Capture Method (Linux Only)X11 Configorigin_web_ui_allowed = wan
nv_preset = p7 AppsNo response Relevant log output[nv_preset] -- [p7]
[2023:08:01:01:01:11]: Info: Sunshine version: v0.20.0
[2023:08:01:01:01:11]: Warning: Failed to create system tray
[2023:08:01:01:01:12]: Error: Failed to create session: Unable to open display
[2023:08:01:01:01:12]: Error: Couldn't expose some/all drm planes for card: /dev/dri/card0
[2023:08:01:01:01:12]: Error: Unable to initialize capture method
[2023:08:01:01:01:12]: Error: Platform failed to initialize
[2023:08:01:01:01:12]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:08:01:01:01:12]: Info: Trying encoder [nvenc]
[2023:08:01:01:01:13]: Info: Encoder [nvenc] failed
[2023:08:01:01:01:13]: Info: Trying encoder [vaapi]
[2023:08:01:01:01:15]: Info: Encoder [vaapi] failed
[2023:08:01:01:01:15]: Info: Trying encoder [software]
[2023:08:01:01:01:16]: Info: Encoder [software] failed
[2023:08:01:01:01:16]: Fatal: Couldn't find any working encoder
[2023:08:01:01:01:16]: Error: Video failed to find working encoder
[2023:08:01:01:01:16]: Info: Adding avahi service Sunshine
[2023:08:01:01:01:16]: Info: Configuration UI available at [https://localhost:47990/]
[2023:08:01:01:01:17]: Info: Avahi service Sunshine successfully established. |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 1 reply
-
You are trying to run it as a global service with a process owned by the user dylan so it can't see the display of your session. What you need to do it run it as a user service (i.e. systemctl --user start sunshine). Also you don't need to invent your own unit file, you can use the one provided. |
Beta Was this translation helpful? Give feedback.
You are trying to run it as a global service with a process owned by the user dylan so it can't see the display of your session. What you need to do it run it as a user service (i.e. systemctl --user start sunshine). Also you don't need to invent your own unit file, you can use the one provided.