Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

KMS Capture does not work on second monitor

Open tomjpalamattam opened this issue 1 year ago • 6 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your issue described in the documentation?

  • [X] I have read the documentation

Is your issue present in the nightly release?

  • [X] This issue is present in the nightly release

Describe the Bug

I have a hybrid gpu laptop with nvidia gpu as /dev/dri/renderD128 and intel igpu as /dev/dri/renderD129. If i choose kms as the capture method for monitor other than 0. I get error like below

I tried the nightly version and the flatpak version with both igpu and dgpu and still faces the same issue. I was able to use kms for monitor 0. Also note x11 and wlroots capture methods work on external displays, the issue was only with kms capture.

Expected Behavior

No response

Additional Context

No response

Host Operating System

Linux

Operating System Version

Arch Linux

Architecture

64 bit

Sunshine commit or version

22.2

Package

Linux - AUR (Third Party)

GPU Type

Nvidia

GPU Model

Geforce GTX 1650

GPU Driver/Mesa Version

550.67

Capture Method (Linux Only)

KMS

Config

adapter_name = /dev/dri/renderD129
output_name = 1
capture = kms
encoder = vaapi

Apps

No response

Relevant log output

`[2024:04:14:21:48:09]: Info: System tray created
[2024:04:14:21:48:09]: Info: Screencasting with KMS
[2024:04:14:21:48:09]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:09]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:09]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:09]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:09]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:09]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:09]: Info: Encoder [vaapi] failed
[2024:04:14:21:48:09]: Error: Couldn't find any working encoder matching [vaapi]
[2024:04:14:21:48:09]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:04:14:21:48:09]: Info: Trying encoder [nvenc]
[2024:04:14:21:48:09]: Info: Screencasting with KMS
[2024:04:14:21:48:09]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:09]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:09]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:09]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:09]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:09]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:09]: Info: Screencasting with KMS
[2024:04:14:21:48:09]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:09]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:09]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:09]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:09]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:09]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:10]: Info: Encoder [nvenc] failed
[2024:04:14:21:48:10]: Info: Trying encoder [software]
[2024:04:14:21:48:10]: Info: Screencasting with KMS
[2024:04:14:21:48:10]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:10]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:10]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:10]: Info: Screencasting with KMS
[2024:04:14:21:48:10]: Info: /dev/dri/card0 -> nvidia-drm
[2024:04:14:21:48:10]: Info: /dev/dri/card1 -> i915
[2024:04:14:21:48:10]: Error: Couldn't find monitor [1]
[2024:04:14:21:48:10]: Info: Encoder [software] failed
[2024:04:14:21:48:10]: Fatal: Unable to find display or encoder during startup.
[2024:04:14:21:48:10]: Fatal: Please ensure your manually chosen GPU and monitor are connected and powered on.
[2024:04:14:21:48:10]: Error: Video failed to find working encoder
[2024:04:14:21:48:10]: Error: Failed to create client: Daemon not running
[2024:04:14:21:48:10]: Info: Configuration UI available at [https://localhost:47990]`

tomjpalamattam avatar Apr 14 '24 19:04 tomjpalamattam

I'm getting the same issue - it worked on previous builds e.g. 0.21.x I'm using the same driver version, 550.67 - on an RTX 3070 (Pop OS) Also tried nightly builds and the issue persists across flatpak, deb, AppImage

[2024:04:27:16:44:23]: Info: Sunshine version: v0.23.1
[2024:04:27:16:44:23]: Info: System tray created
[2024:04:27:16:44:23]: Error: Failed to create session: This hardware does not support NvFBC
[2024:04:27:16:44:23]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:23]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:23]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:23]: Error: Environment variable WAYLAND_DISPLAY has not been defined
[2024:04:27:16:44:23]: Info: Detecting monitors
[2024:04:27:16:44:23]: Info: Detected monitor 0: DP-0, connected: true
[2024:04:27:16:44:23]: Info: Detected monitor 1: DP-1, connected: false
[2024:04:27:16:44:23]: Info: Detected monitor 2: HDMI-0, connected: false
[2024:04:27:16:44:23]: Info: Detected monitor 3: DP-2, connected: true
[2024:04:27:16:44:23]: Info: Detected monitor 4: DP-3, connected: false
[2024:04:27:16:44:23]: Info: Detected monitor 5: HDMI-1, connected: true
[2024:04:27:16:44:23]: Info: Detected monitor 6: DP-4, connected: false
[2024:04:27:16:44:23]: Info: Detected monitor 7: DP-5, connected: false
[2024:04:27:16:44:23]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2024:04:27:16:44:23]: Info: Trying encoder [nvenc]
[2024:04:27:16:44:23]: Info: Screencasting with KMS
[2024:04:27:16:44:23]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:23]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:23]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:23]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:23]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:23]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:23]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:23]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:23]: Info: Screencasting with KMS
[2024:04:27:16:44:23]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:23]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:23]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:23]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:23]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:23]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:23]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:23]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:24]: Info: Encoder [nvenc] failed
[2024:04:27:16:44:24]: Info: Trying encoder [vaapi]
[2024:04:27:16:44:24]: Info: Screencasting with KMS
[2024:04:27:16:44:24]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:24]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:24]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:24]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:24]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:24]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:24]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:24]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:24]: Info: Screencasting with KMS
[2024:04:27:16:44:24]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:24]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:24]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:24]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:24]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:24]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:24]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:24]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:24]: Info: Encoder [vaapi] failed
[2024:04:27:16:44:24]: Info: Trying encoder [software]
[2024:04:27:16:44:24]: Info: Screencasting with KMS
[2024:04:27:16:44:24]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:24]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:24]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:24]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:24]: Info: Screencasting with KMS
[2024:04:27:16:44:24]: Info: /dev/dri/card0 -> simpledrm
[2024:04:27:16:44:24]: Warning: No render device name for: /dev/dri/card0
[2024:04:27:16:44:24]: Info: /dev/dri/card1 -> nvidia-drm
[2024:04:27:16:44:24]: Error: Couldn't find monitor [5]
[2024:04:27:16:44:24]: Info: Encoder [software] failed
[2024:04:27:16:44:24]: Fatal: Unable to find display or encoder during startup.
[2024:04:27:16:44:24]: Fatal: Please ensure your manually chosen GPU and monitor are connected and powered on.
[2024:04:27:16:44:24]: Error: Video failed to find working encoder
[2024:04:27:16:44:24]: Info: Adding avahi service Sunshine
[2024:04:27:16:44:24]: Info: Configuration UI available at [https://localhost:47990]
[2024:04:27:16:44:25]: Info: Avahi service Sunshine successfully established.

Leonw43 avatar Apr 27 '24 15:04 Leonw43

0.21

I tried this version, but has the same issue. Are you facing this on external monitor (monitor 1) and also using kms capture?

tomjpalamattam avatar Apr 27 '24 22:04 tomjpalamattam

Sometimes the internal display and the external display outputs are not connected to the same GPU. I have an Asus laptop where the internal display is connected to the iGPU (or a mux) but the HDMI port is connected directly to the dGPU. That has implications for which GPUs can be used to encode each output (since GPUs generally don't support importing images with a different vendor's special tiling modifiers).

I suspect part of the problem is that you've specified an incompatible combination of encoder, adapter_name, and output_name in your config. I recommend starting over with all options at defaults, then try setting output_name alone. See if you get further that way.

cgutman avatar Apr 30 '24 23:04 cgutman

I tried doing this. But if i use KMS capture no matter which GPU I use or leave it to the default setting , results in the above error. And its only a KMS issue since i was able to use X11 and wlroot capture

tomjpalamattam avatar May 01 '24 18:05 tomjpalamattam

I had no issues before because (I'm guessing) KMS wasn't the default option. I had the same problem when in a newer build AV1 was introduced and set to "advertise based on encoder settings" which didn't work. Once I set it to not advertise support it worked fine.

X11 still works fine for me, it just falls over because of KMS capture. I'm also on a desktop with a 5800X3D, so no iGPU.

Leonw43 avatar May 02 '24 19:05 Leonw43

I'm also on a desktop with a 5800X3D, so no iGPU.

Your logs read more like this issue: https://docs.lizardbyte.dev/projects/sunshine/en/master/troubleshooting/linux.html#kms-streaming-fails-on-nvidia-gpus You could give it a try.

gschintgen avatar Jun 16 '24 06:06 gschintgen

It seems this issue hasn't had any activity in the past 90 days. If it's still something you'd like addressed, please let us know by leaving a comment. Otherwise, to help keep our backlog tidy, we'll be closing this issue in 10 days. Thanks!

LizardByte-bot avatar Sep 14 '24 10:09 LizardByte-bot

This issue was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Sep 24 '24 10:09 LizardByte-bot