feat(nvenc): support for split frame encoding on GPUs with 2+ nvenc blocks#4892
feat(nvenc): support for split frame encoding on GPUs with 2+ nvenc blocks#4892andygrundman wants to merge 2 commits intoLizardByte:masterfrom
Conversation
|
Currently sunshine supports every nvidia gpu with nvenc ever made, and dropping runtime support for nvenc-11.0 (or more specifically nvenc-11.1) will cut off the ones for which the drivers stopped being updated years ago. Personally I'm indifferent about how sunshine will want to handle this, but you will get bug reports. |
You are probably right, but what cards are we talking about here? I have a GTX 1070 which has been EOL'ed recently and runs driver version 580 with SDK 13.0 (this is in Linux). NVENC goes back to the 600 series, so the issue is cards from 600-900? Wikipedia says NVENC 1st gen was used on all those cards with Maxwell 1000 series getting 2nd gen with HEVC. Do we support cards that old? I don't want to break anything, and I admit I did take the easy route here. But I'm also not worried about supporting people who choose to run older drivers (in this case they would have to be MUCH older drivers since 13.0 shipped in Jan 2025). It's sometimes smart to avoid the current Nvidia driver, but choosing to be a year out of date, probably on Windows 10, I find it hard to understand the mindset. Maybe these users are ok running an older Sunshine too. |
49d784c to
ed602e0
Compare
Yes, current sunshine does support them, on Windows at least. And you're going to have the same dilemma for every future version of nvenc sdk, unless dynamic sdk version selection is implemented. But to repeat myself, both paths are somewhat viable (even though one is superior) and I don't have a strong opinion regarding which one sunshine ends up going for. |
I am coming around to this concern a bit more after thinking about it, because a bug report that someone is stuck with software encoding without a good workaround really sucks. Do you think the approach you used in #3061 is still applicable? I notice you removed the I worry that supporting so many versions makes it difficult to test properly. Do you have any tips on testing older versions? Thanks for all your work on this issue. |
0999b1f to
efac4f9
Compare
efac4f9 to
6066365
Compare
|
Bundle ReportChanges will increase total bundle size by 1.23kB (0.16%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sunshine-esmAssets Changed:
Files in
Files in
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4892 +/- ##
==========================================
- Coverage 18.46% 17.35% -1.12%
==========================================
Files 107 72 -35
Lines 22524 15233 -7291
Branches 10019 7215 -2804
==========================================
- Hits 4159 2643 -1516
+ Misses 15988 11718 -4270
+ Partials 2377 872 -1505
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ReenigneArcher
left a comment
There was a problem hiding this comment.
@ns6089 Would supporting all these versions also mean that FFmpeg also needs to be build with all these versions simultaneously?
| Split the encoding of each video frame over multiple NVENC hardware units. | ||
| Significantly reduces encoding latency with a marginal compression efficiency penalty. | ||
| This option is ignored if your GPU has a singular NVENC unit. | ||
| @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder) with HEVC or AV1.} |
There was a problem hiding this comment.
| @note{This option only applies when using NVENC [encoder](#encoderhttpslocalhost47990configencoder) with HEVC or AV1.} | |
| @note{This option only applies when using NVENC [encoder](#encoder) with HEVC or AV1.} |
This should work.




Description
This PR adds new option
split_frame_encodingwith optionsdisabled,enabled, anddriver_decides. The majority of the changes are from #3061 .When
NV_ENC_CAPS_NUM_ENCODER_ENGINES> 1, these options setinit_params.splitEncodeModetoNV_ENC_SPLIT_DISABLE_MODE,NV_ENC_SPLIT_AUTO_FORCED_MODE, orNV_ENC_SPLIT_AUTO_MODErespectively.The encoder options string in the log will show
sfeorsfe-autowhen nvenc count > 1 and split_frame_encoding is not set to disabled.This also bumps build-deps in order to pull in ffmpeg 8.1 and nvenc SDK 13.0. (ffmpeg is not used when encoding with nvenc but is needed here due to the fact that ffmpeg owns
third-party/nv-codec-headers/include/ffnvcodec/nvEncodeAPI.hby including it in the prebuilt ffmpeg binary that comes from build-deps.)cc @ns6089 @Nonary
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage