NvFBC is incorrectly rejected when XRandR is unavailable, despite valid virtual desktop capture support

未关闭
#5,707 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp, docker, linux

调研方向

首先跟踪与日志行“Found [0] outputs”、“Virtual Desktop”和“XrandR: unavailable”相关的显示检测和 NvFBC 初始化路径。使用提供的 X 配置重现,并确认 Sunshine 不再崩溃,同时 NvFBC 可以在没有 XRandR 的情况下捕获报告的 1920x1080 虚拟桌面。

由索引模型根据 Issue 内容生成。

描述

Is there an existing issue for this?
  • I have searched the existing issues
Is your issue described in the documentation?
  • I have read the documentation
Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

I'm running Sunshine inside an LXC container with an NVIDIA GPU and a headless X server. The X server provides a valid virtual desktop, but does not expose the XRandR extension (I intentionally disabled the XRandR extension to resolve the Xfce desktop environment issue).

In this environment, NvFBC appears to initialize successfully and reports a valid virtual desktop size:

[2026-09-13 23:14:03.366]: Info: Found [0] outputs
[2026-09-13 23:14:03.366]: Info: Virtual Desktop: 1920x1080
[2026-09-13 23:14:03.366]: Info: XrandR: unavailable

However, Sunshine then crashes:

Xlib:  extension "RANDR" missing on display ":0".
Segmentation fault         (core dumped) sunshine

The crash is unexpected because the lack of XRandR should only prevent selecting individual monitors, not prevent NvFBC screen capture entirely.

Expected Behavior

If NvFBC reports (1) capture is possible, (2) a valid non-zero virtual desktop size, and (3) XRandR is unavailable / there are no individual outputs, Sunshine should still consider NvFBC a valid capture backend and capture the entire virtual desktop. Eventually, Sunshine should be able to start in this case.

Additional Context

Below is my X config for your reference:

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/mouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA RTX A6000"
    BusID          "PCI:65:0:0"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "UseDisplayDevice" "none"
    Option         "MetaModes" "NULL"

    SubSection "Display"
        Depth       24
        Modes       "1920x1080"
        Virtual     1920 1080
    EndSubSection

EndSection

Section "Extensions"
    Option "RANDR" "Disable"
EndSection
Host Operating System

Docker

Operating System Version

Ubuntu 26.04

Architecture

amd64/x86_64

Package

Linux - deb

GPU Type

NVIDIA

GPU Model

RTX A6000

GPU Driver/Mesa Version

615.71.09

Capture Method

NvFBC (Linux)

Apps
The issue is not specific to a certain app
Log output
$ sunshine 
[2026-09-13 23:14:03.102598] [0x00007fccd0c86000] [info]    config: 'output_name' = 0
[2026-09-13 23:14:03.102]: Info: Sunshine version: 2026.912.143204 commit: fbf12d019c16c6f8ff6fb4aaff8519d74e298fdf
[2026-09-13 23:14:03.102]: Info: Package Publisher: LizardByte
[2026-09-13 23:14:03.102]: Info: Publisher Website: https://app.lizardbyte.dev
[2026-09-13 23:14:03.102]: Info: Get support: https://app.lizardbyte.dev/support
[2026-09-13 23:14:03.102]: Info: config: 'output_name' = 0
[2026-09-13 23:14:03.366]: Info: Found [0] outputs
[2026-09-13 23:14:03.366]: Info: Virtual Desktop: 1920x1080
[2026-09-13 23:14:03.366]: Info: XrandR: unavailable
[2026-09-13 23:14:03.389]: Error: Couldn't release NvFBC context from current thread: 
[2026-09-13 23:14:03.389]: Error: Couldn't open: /dev/dri/card1: Permission denied
[2026-09-13 23:14:03.389]: Error: [wayland] Environment variable WAYLAND_DISPLAY has not been defined
[2026-09-13 23:14:03.389]: Info: Detecting displays
Xlib:  extension "RANDR" missing on display ":0".
Segmentation fault         (core dumped) sunshine
Online logs

No response

主要语言
C++
星标
43k
派生
2.4k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

LizardByte/Sunshine 的其他 Issue

查看 LizardByte/Sunshine 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。