Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sunshine server limits the FPS of *some* games even when not streaming #3703

Open
2 tasks done
aserrallerios opened this issue Mar 4, 2025 · 9 comments
Open
2 tasks done

Comments

@aserrallerios
Copy link

aserrallerios commented Mar 4, 2025

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?

I'm too lazy to test (I had the problem in an older version, and also in the latest release version)

Describe the Bug

When I launch Doom Eternal (Vulkan, exclusive fullscreen) it is limited to HALF the max FPS I set in nvidia frame limiter.

My screen is configured with fixed refresh rate of 120hz and I have 121 fps limit in nvidia settings:

  • When I launch the game while Sunshine is running in the background I get 60-61 fps.
  • If I close the Sunshine server the game runs at 121 fps.

Other games are unaffected (like Counter Strike 2).

Expected Behavior

I expect Doom Eternal (and maybe others) FPS to not be limited in any way while Sunshine is running in the background and I'm not streaming to any client.

Additional Context

I checked my settings, and I disconnected all my clients and restarted Sunshine, but the problem persists. I've installed the latest Sunshine version, and the problem persists.

Host Operating System

Windows

Operating System Version

10, build 19045.5555

Architecture

amd64/x86_64

Sunshine commit or version

v2025.122.141614

Package

Windows - installer (recommended)

GPU Type

NVIDIA

GPU Model

RTX 3090

GPU Driver/Mesa Version

572.16

Capture Method

None

Config

resolutions = [
    352x240,
    480x360,
    858x480,
    1280x720,
    1920x1080,
    2560x1080,
    2560x1440,
    3440x1440,
    1920x1200,
    3840x2160,
    3840x1600,
    640x480,
    800x600,
    1024x768
]

Apps

Relevant log output

[2025-03-04 16:45:10.054]: Info: Sunshine version: v2025.122.141614
[2025-03-04 16:45:10.054]: Info: Package Publisher: LizardByte
[2025-03-04 16:45:10.054]: Info: Publisher Website: https://app.lizardbyte.dev
[2025-03-04 16:45:10.054]: Info: Get support: https://app.lizardbyte.dev/support
[2025-03-04 16:45:10.054]: Info: Provided workaround settings for SettingsManager:
{
  "hdr_blank_delay": null
}
[2025-03-04 16:45:10.057]: Info: Currently available display devices:
[
  {
    "device_id": "{933442bc-caba-564f-b2d4-d43802bc167a}",
    "display_name": "\\\\.\\DISPLAY1",
    "friendly_name": "XB271HU A",
    "info": {
      "hdr_state": null,
      "origin_point": {
        "x": 0,
        "y": 0
      },
      "primary": true,
      "refresh_rate": {
        "type": "rational",
        "value": {
          "denominator": 1000,
          "numerator": 119998
        }
      },
      "resolution": {
        "height": 1440,
        "width": 2560
      },
      "resolution_scale": {
        "type": "rational",
        "value": {
          "denominator": 100,
          "numerator": 100
        }
      }
    }
  }
]
[2025-03-04 16:45:10.309]: Info: nvprefs: No need to modify application profile settings
[2025-03-04 16:45:10.309]: Info: nvprefs: Changed OGL_CPL_PREFER_DXPRESENT to OGL_CPL_PREFER_DXPRESENT_PREFER_ENABLED for base profile
[2025-03-04 16:45:10.374]: Info: Compiling shaders...
[2025-03-04 16:45:10.391]: Info: System tray created
[2025-03-04 16:45:10.476]: Info: Compiled shaders
[2025-03-04 16:45:10.489]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2025-03-04 16:45:10.489]: Info: Trying encoder [nvenc]
[2025-03-04 16:45:10.774]: Info: 
Device Description : NVIDIA GeForce RTX 3090
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002204
Device Video Mem   : 24326 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16355 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2025-03-04 16:45:10.774]: Info: Active GPU has HAGS enabled
[2025-03-04 16:45:10.774]: Info: Using realtime GPU priority
[2025-03-04 16:45:10.775]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2025-03-04 16:45:10.777]: Info: Desktop resolution [2560x1440]
[2025-03-04 16:45:10.777]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-03-04 16:45:10.777]: Info: Display refresh rate [119.998Hz]
[2025-03-04 16:45:10.777]: Info: Requested frame rate [60fps]
[2025-03-04 16:45:10.777]: Info: Creating encoder [h264_nvenc]
[2025-03-04 16:45:10.777]: Info: Color coding: SDR (Rec. 601)
[2025-03-04 16:45:10.777]: Info: Color depth: 8-bit
[2025-03-04 16:45:10.777]: Info: Color range: JPEG
[2025-03-04 16:45:10.824]: Info: NvEnc: created encoder H.264 P1 two-pass rfi
[2025-03-04 16:45:10.846]: Info: Creating encoder [hevc_nvenc]
[2025-03-04 16:45:10.846]: Info: Color coding: SDR (Rec. 601)
[2025-03-04 16:45:10.846]: Info: Color depth: 8-bit
[2025-03-04 16:45:10.846]: Info: Color range: JPEG
[2025-03-04 16:45:10.888]: Info: NvEnc: created encoder HEVC P1 two-pass rfi
[2025-03-04 16:45:10.914]: Info: Creating encoder [av1_nvenc]
[2025-03-04 16:45:10.914]: Info: Color coding: SDR (Rec. 601)
[2025-03-04 16:45:10.914]: Info: Color depth: 8-bit
[2025-03-04 16:45:10.914]: Info: Color range: JPEG
[2025-03-04 16:45:10.937]: Error: NvEnc: encoding format is not supported by the gpu
[2025-03-04 16:45:10.944]: Info: Creating encoder [h264_nvenc]
[2025-03-04 16:45:10.944]: Info: Color coding: SDR (Rec. 601)
[2025-03-04 16:45:10.944]: Info: Color depth: 8-bit
[2025-03-04 16:45:10.944]: Info: Color range: JPEG
[2025-03-04 16:45:10.989]: Info: NvEnc: created encoder H.264 P1 yuv444 two-pass rfi
[2025-03-04 16:45:11.250]: Info: 
Device Description : NVIDIA GeForce RTX 3090
Device Vendor ID   : 0x000010DE
Device Device ID   : 0x00002204
Device Video Mem   : 24326 MiB
Device Sys Mem     : 0 MiB
Share Sys Mem      : 16355 MiB
Feature Level      : 0x0000B100
Capture size       : 2560x1440
Offset             : 0x0
Virtual Desktop    : 2560x1440
[2025-03-04 16:45:11.250]: Info: Active GPU has HAGS enabled
[2025-03-04 16:45:11.250]: Info: Using realtime GPU priority
[2025-03-04 16:45:11.250]: Info: 
Colorspace         : DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709
Bits Per Color     : 8
Red Primary        : [0.639648,0.330078]
Green Primary      : [0.299805,0.599609]
Blue Primary       : [0.150391,0.0595703]
White Point        : [0.3125,0.329102]
Min Luminance      : 0.5 nits
Max Luminance      : 270 nits
Max Full Luminance : 270 nits
[2025-03-04 16:45:11.252]: Info: Desktop resolution [2560x1440]
[2025-03-04 16:45:11.252]: Info: Desktop format [DXGI_FORMAT_B8G8R8A8_UNORM]
[2025-03-04 16:45:11.252]: Info: Display refresh rate [119.998Hz]
[2025-03-04 16:45:11.252]: Info: Requested frame rate [60fps]
[2025-03-04 16:45:11.252]: Info: Creating encoder [hevc_nvenc]
[2025-03-04 16:45:11.253]: Info: Color coding: SDR (Rec. 709)
[2025-03-04 16:45:11.253]: Info: Color depth: 10-bit
[2025-03-04 16:45:11.253]: Info: Color range: JPEG
[2025-03-04 16:45:11.368]: Info: NvEnc: created encoder HEVC P1 yuv444 10-bit two-pass rfi
[2025-03-04 16:45:11.413]: Info: 
[2025-03-04 16:45:11.413]: Info: // Ignore any errors mentioned above, they are not relevant. //
[2025-03-04 16:45:11.413]: Info: 
[2025-03-04 16:45:11.413]: Info: Found H.264 encoder: h264_nvenc [nvenc]
[2025-03-04 16:45:11.413]: Info: Found HEVC encoder: hevc_nvenc [nvenc]
[2025-03-04 16:45:11.416]: Info: Configuration UI available at [https://localhost:47990]
[2025-03-04 16:45:12.188]: Info: Registered Sunshine mDNS service
@buthig666
Copy link

Have you tried the game in Windowed Fullscreen mode? I have found frame-gen doesn't seem to pass to client for me in Fullscreen mode with all titles.

@andygrundman
Copy link
Contributor

Does the problem go away if you uncheck this option in Sunshine NVENC settings?

Present OpenGL/Vulkan on top of DXGI
Default: checked

Sunshine can't capture fullscreen OpenGL and Vulkan programs at full frame rate unless they present on top of DXGI. This is system-wide setting that is reverted on sunshine program exit.

@aserrallerios
Copy link
Author

aserrallerios commented Mar 6, 2025

Yes, that was it @andygrundman! The problem is not present if I uncheck that option.

Looking at the description of the option it looks like it's not actually succeeding at its purpose.

@andygrundman
Copy link
Contributor

Yeah it's the only thing I know of that Sunshine could affect while not streaming. I don't know the history of this feature but there's probably a good reason it doesn't get enabled on-demand only during streaming. If you Google for the name of the Nvidia control panel setting "Prefer layered on DXGI Swapchain" you'll find a lot of discussion about it on Reddit.

I just looked at your log again and noticed you have a 3090, but you also mentioned using framegen. Did you mean the Lossless Scaling tool? I wish they hadn't used the same term, it leads to a lot of confusion. From what people have said whatever that tool does has a problem getting captured by Sunshine. I wonder if that could also mess with the stream framerate (i.e. the generated frames are all getting lost for some reason).

@aserrallerios
Copy link
Author

aserrallerios commented Mar 7, 2025

I just looked at your log again and noticed you have a 3090, but you also mentioned using framegen

I actually never mentioned it, did I? 😆

@buthig666 did also mention it, which I found a bit weird, so I don't know where the confusion comes from.

I said that I limit my FPS via nvidia control panel. I have an upper limit of 121 because I set my screen refresh rate to 120 fixed hz (and I also use Fast vsync so I discard 1 frame per second). Given that configuration, Sunshine will limit my FPS in-game (Doom Eternal) to exactly half of the limit I set on NCP.

@andygrundman
Copy link
Contributor

It was in the Sunshine log. Well you've actually just solved the problem! Fast Vsync is a tricky setting that is probably not very relevant these days, and due to the tricks it employs, it's not compatible with streaming video capture. It causes frames to not be captured correctly, and is exactly what you've described. I should have thought of this but it's a very obscure setting. There should probably be some detection and warning around this setting actually...

I would recommend to disable vsync on the host, limit in the control panel to your client's framerate (or -3 fps if client has a VRR display). The client can enable vsync or if you have a VRR/G-sync display, don't enable vsync and as long as the framerate from the server remains within the VRR range you will avoid any tearing.

@aserrallerios
Copy link
Author

Not sure if you meant that vsync was the cause, but I've re-enabled the check, and disabled fast vsync, but the problem came back.

@andygrundman
Copy link
Contributor

OK, I am at least pretty sure that fast vsync can cause problems. I suppose it's actually off-topic for this bug but you might need to compare vsync modes in a non-Vulkan game to see if fast vsync causes stream issues.

I'm not sure what to do about the DXGI setting, I think it's just a current limitation of Sunshine's capture method. There is a second capture method (Windows Graphics Capture) which has its own set of issues, and I don't know if it works better with Vulkan games.

@aserrallerios
Copy link
Author

The main problem being that some settings are system-wide and are always enabled, even when not streaming. But I guess it's kinda inevitable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants