LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
19.33k stars 940 forks source link

"Fatal: Couldn't find any working encoder" After switching to wayland. #1916

Closed KelvinGuy1 closed 10 months ago

KelvinGuy1 commented 10 months ago

Is there an existing issue for this?

Is your issue described in the documentation?

Is your issue present in the nightly release?

Describe the Bug

After moving to Wayland, when attempting to run sunshine on Ubuntu, it can't find an encoder.

Host Operating System

Linux

Operating System Version

Ubuntu 22.04.2 LTS

Architecture

64 bit

Sunshine commit or version

0.19 to latest ver and flathub build

Package

Linux - deb + flatpak

GPU Type

Nvidia

GPU Model

GeForce 1660 Ti

GPU Driver/Mesa Version

525 proprietary

Capture Method (Linux Only)

No response

Config

output_name = 1
sw_preset = ultrafast
origin_web_ui_allowed = pc
nv_preset = p1
sw_tune = fastdecode
min_threads = 36
qp = -2
encoder = vaapi
address_family = both
capture = wlr
av1_mode = 1

Apps

No response

Relevant log output

[encoder] -- [nvenc]
[qp] -- [-2]
[min_threads] -- [36]
[sw_tune] -- [fastdecode]
[nv_preset] -- [p1]
[origin_web_ui_allowed] -- [pc]
[capture] -- [nvfbc]
[sw_preset] -- [ultrafast]
[output_name] -- [1]
Warning: Unrecognized configurable option [nv_preset]
[2023:12:16:03:03:11]: Info: Sunshine version: 0.21.0.4c984cacb54c09ee954e8855b6341e699bbfd535
[2023:12:16:03:03:11]: Info: System tray created
[2023:12:16:03:03:11]: Error: Failed to create session: Version mismatch between NvFBC and the X driver interface
[2023:12:16:03:03:11]: Error: Unable to initialize capture method
[2023:12:16:03:03:11]: Error: Platform failed to initialize
[2023:12:16:03:03:11]: Info: Trying encoder [nvenc]
[2023:12:16:03:03:12]: Info: Encoder [nvenc] failed
[2023:12:16:03:03:12]: Error: Couldn't find any working encoder matching [nvenc]
[2023:12:16:03:03:12]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:12:16:03:03:12]: Info: Trying encoder [vaapi]
[2023:12:16:03:03:12]: Info: Encoder [vaapi] failed
[2023:12:16:03:03:12]: Info: Trying encoder [software]
[2023:12:16:03:03:13]: Info: Encoder [software] failed
[2023:12:16:03:03:13]: Fatal: Couldn't find any working encoder
[2023:12:16:03:03:13]: Error: Video failed to find working encoder
KelvinGuy1 commented 10 months ago

Update: Switching back to x11 does not resolve the issue.

Nitrousoxide commented 10 months ago

I have this issue on Fedora as well with the flatpak. Encoders are installed as flatpak runtimes and accessible to other streaming/recording flatpaks like OBS.

PaperReaper commented 10 months ago

For me on Pop!_OS it works on X11 but not wayland. OBS doesnt have any encoders available either except CPU, and sunshine doesnt even have that on wayland.

Nitrousoxide commented 10 months ago

hmm, yeah X11 finds vaapi with the Sunshine flatpak on Fedora 39. Nothing under wayland though.

PaperReaper commented 10 months ago

Oh a note: I am on a Vega 64, so it appears the issue is vendor agnostic.

Nitrousoxide commented 10 months ago

I have this issue on amd gpu and I've seen other people with nvidia gpus's complain about it on the discord, so I think it's also not dependent on hardware issue. I'm almost certain it's a documentation issue or a bug that needs the devs to resolve.

SimonSchwendele commented 10 months ago

You'll see it in the CI https://github.com/LizardByte/Sunshine/blob/nightly/docker/fedora-39.dockerfile#L70

nowadays most of us are already on gcc13 while cuda is only supported until gcc12.3. Cuda is the piece of software that is required by sunshine to allow hardware acceleration on nvidia gpus.

For the time being we might've to wait until cuda gets updated. https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#system-requirements

ReenigneArcher commented 10 months ago

@SimonSchwendele that's a Fedora issue. It doesn't affect Debian or Flatpak.

SimonSchwendele commented 10 months ago

@SimonSchwendele that's a Fedora issue. It doesn't affect Debian or Flatpak.

aah damn, the reply didn't work. That should've replied to @Nitrousoxide

Nitrousoxide commented 10 months ago

@SimonSchwendele that's a Fedora issue. It doesn't affect Debian or Flatpak.

I have this issue in flatpak using Wayland. Though with an AMD GPU. But regardless it should still find a software encoder at the very least regardless of which packaging utility and compositor is used. Doing literally nothing else other than logging out from a Wayland session into an X11 session will let the flatpak version properly screencast as it is able to find encoders.

There's something clearly wrong with either its settings for Wayland or the instructions that people are given in the docs.

pearagit commented 10 months ago

My comment on #1631 may be relevant, I am also using Wayland on Fedora.

ReenigneArcher commented 10 months ago

Duplicate of #1631

gittykrabs commented 9 months ago

Exact same problem for me regardless of what Linux distro I choose. Switching to Xorg results in the Fatal: Couldn't find any working encoder message going away however, it still doesn't work. Only in software mode which is impossible to use. In my case, an Intel N100 based machine. Haven't been able to find a fix as yet.

SimonSchwendele commented 9 months ago

Exact same problem for me regardless of what Linux distro I choose. Switching to Xorg results in the Fatal: Couldn't find any working encoder message going away however, it still doesn't work. Only in software mode which is impossible to use. In my case, an Intel N100 based machine. Haven't been able to find a fix as yet.

huh... this issue is just an nvidia problem. What das vainfo tell you ? Maybe you need to test some stuff. LIBVA_DRIVER_NAME=i965 vainfo or LIBVA_DRIVER_NAME=iHD vainfo. If both yield errors then maybe your chip can't do hardware acceleration.

Either way till nvidia eventually releases cuda13 I am too using the intel vaapi ( i9-13900H ), offload the applications and deal with the performance impact.

Anyways please check that your hardware accelerations works at all, this should not be a sunshine issue

gittykrabs commented 8 months ago

Thanks for the reply. Is it true thag the Quicksync Encoder option is only on Windows?

I'll have a look at your suggestions when I'm at my PC. Many thanks again!