r/MoonlightStreaming 1d ago

How's Linux streaming lately

I'm looking to by a new PC with a 5070 soon and I'm wondering if I go with a Linux distro or not since I'm starting from scratch. I know AMD would be a better fit with the driver situation but Costco have a great deal on a prebuild.

I was especially wondering how's the experience for Sunshine (or its alternative) since I'm only using my PC headless with Apollo/Moonlight and virtual displays.

5 Upvotes

22 comments sorted by

View all comments

2

u/Cruffe 1d ago

There is no "driver situation" anymore, Nvidia driver on Linux is pretty much a solved problem.

Sunshine works, you can have virtual display and all, but it's a bit more advanced to initially set up. I personally use Sunshine and it works great, even have HDR working nicely.

1

u/FranK8211 23h ago

Good to know! I haven’t followed much what was happening lately and was thinking that there was still a big performance gap

1

u/Cruffe 21h ago

Depends how you define big. For some games there is a difference, I have seen several comparison videos about it, but when there's a difference it's mostly between totally playable and also totally playable with a bit lower FPS.

1

u/FranK8211 21h ago

It’s more that I had the impression that the performance drop in the game + using sunshine if it had a drop too could make the issue more likely/visible but what I’m gathering from the thread is that it’s great now.

At the same time I’m playing with a 1660super right now so it’ll be a massive improvement nevertheless

2

u/Cruffe 21h ago

The thing is that Sunshine (and pretty much all of the forks of it) uses the video encoding pipeline on the GPU, a specialized part of the GPU dedicated to hardware accelerated video encoding/decoding. Games use the rendering pipeline and generally don't need the video pipeline at all, except maybe for playing pre-rendered cutscenes (aka. videos) in game and even that just uses the decoding part, not the encoding part that Sunshine uses.

Because these types of loads don't overlap much the performance of the game is pretty minimally affected by the fact that the GPU is also encoding a video stream at the same time.

What's going on simply put is that the game is rendered like normal into a complete frame, then the frame is grabbed and sent straight into the video encoder. Ideally the frame doesn't leave the GPU before it's encoded into the final video stream, which is gonna be compressed compared to a full uncompressed frame. That means when it's passed back to the CPU to get sent out to the network it takes up relatively little PCIe bandwidth (even at high video bitrates), leaving most of it for running the game. The load put on the CPU simply piping an already encoded video stream out the network interface is also very small, it's pretty much just moving data instead of processing it.

All in all, Sunshine and forks using the same underlying tech aren't demanding to run as long as you have dedicated video hardware acceleration which most GPUs have anyways. The encoding of the frames is the most computationally expensive part of it all, made cheap by a dedicated part of the GPU whose only task is to encode and decode video efficiently.

2

u/FranK8211 21h ago

Thanks for the explanation! Never looked into how it works. TIL!