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

AV1 is incorrectly detected as supported on unsupported gpus on Linux #1880

Closed Reual4412 closed 10 months ago

Reual4412 commented 11 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

For NVIDIA geforce series graphics cards below the 4000 series using propriety NVIDIA drivers on linux, AV1 is not supported on encode. sunshine's default setting "Sunshine will advertise support for AV1 based on encoder capabilities" Will result in it attempting to use AV1.

Expected Behavior

Expected Behavior is that of on Windows, in which the auto detect will correctly notice the graphic's card doesn't support AV1. This could be a issue with the NVIDIA driver but ideally things should just worktm.

Additional Context

I run a archlinux setup, however I use the flatpak version of the app. The same problem exists on the AUR as well however. And presumably all arch based setups. I'm not sure if this affects Debian based systems.

Host Operating System

Linux

Operating System Version

6.6.3.arch1-1

Architecture

64 bit

Sunshine commit or version

0.21.0.5bca024.dirty

Package

Linux - AppImage

GPU Type

Nvidia

GPU Model

Zotac Nvidia 2060

GPU Driver/Mesa Version

545.29 (NVIDIA driver version)

Capture Method (Linux Only)

X11

Config

encoder = nvenc
av1_mode = 0

Apps

No response

Relevant log output

[2023:12:02:22:05:00]: Info: Trying encoder [nvenc]
[2023:12:02:22:05:00]: Info: Screencasting with X11
[2023:12:02:22:05:00]: Info: Screencasting with X11
[2023:12:02:22:05:00]: Info: SDR color coding [Rec. 601]
[2023:12:02:22:05:00]: Info: Color depth: 8-bit
[2023:12:02:22:05:00]: Info: Color range: [JPEG]
[2023:12:02:22:05:00]: Info: Screencasting with X11
[2023:12:02:22:05:00]: Info: SDR color coding [Rec. 601]
[2023:12:02:22:05:00]: Info: Color depth: 8-bit
[2023:12:02:22:05:00]: Info: Color range: [JPEG]
[2023:12:02:22:05:00]: Info: Screencasting with X11
[2023:12:02:22:05:00]: Info: SDR color coding [Rec. 601]
[2023:12:02:22:05:00]: Info: Color depth: 8-bit
[2023:12:02:22:05:00]: Info: Color range: [JPEG]
[2023:12:02:22:05:00]: Warning: [av1_nvenc @ 0x559f8e0eae40] Codec not supported
[2023:12:02:22:05:00]: Fatal: [av1_nvenc @ 0x559f8e0eae40] Provided device doesn't support required NVENC features
[2023:12:02:22:05:00]: Error: Could not open codec [av1_nvenc]: Function not implemented
[2023:12:02:22:05:00]: Info: Screencasting with X11
[2023:12:02:22:05:00]: Info: SDR color coding [Rec. 601]
[2023:12:02:22:05:00]: Info: Color depth: 8-bit
[2023:12:02:22:05:00]: Info: Color range: [JPEG]
[2023:12:02:22:05:00]: Warning: [av1_nvenc @ 0x559f8e0ebd80] Codec not supported
[2023:12:02:22:05:00]: Fatal: [av1_nvenc @ 0x559f8e0ebd80] Provided device doesn't support required NVENC features
[2023:12:02:22:05:00]: Error: Could not open codec [av1_nvenc]: Function not implemented
[2023:12:02:22:05:00]: Info: Screencasting with X11
[2023:12:02:22:05:00]: Info: SDR color coding [Rec. 709]
[2023:12:02:22:05:00]: Info: Color depth: 10-bit
[2023:12:02:22:05:00]: Info: Color range: [JPEG]
[2023:12:02:22:05:00]: Error: cuda::cuda_t doesn't support any format other than AV_PIX_FMT_NV12
[2023:12:02:22:05:00]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:12:02:22:05:00]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2023:12:02:22:05:00]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
ReenigneArcher commented 11 months ago

How is it detected as supported? In your logs it's clear that it's not supported.

Error: Could not open codec [av1_nvenc]: Function not implemented

Reual4412 commented 11 months ago

Alright I'll try to clarify. "based on encoder abilities" implies that it checks if the encoder (and overall driver, which should check the gpu) supports AV1.

What's happening is that despite it not being supported, it attempts to use AV1 anyways.

You have to manually go into the advanced tab and explicitly set it to "sunshine will not advertise support for AV1"

Which in windows, this doesn't happen. As it autodetects that no, it doesn't support AV1, without needing to go into the advance tab and explicitly change the setting.

ReenigneArcher commented 11 months ago

What's happening is that despite it not being supported, it attempts to use AV1 anyways.

I believe this is expected behavior. The encoders are probed to verify them.