Repository navigation
Decoding: GPU and CPU together faster with big GPUs - #511
Merged
Merged
Conversation
With fast decoders, 1 thread computing the MD5 of 8 frames in SIMD lanes (about 22 frames per second) was slower than the decoders: frames waited for an output thread and the decoders waited for the frames in flight (GPU idle 25% of the time, auto not faster than Vulkan). Twice more output threads and frames in flight, so a second thread computes hashes in lanes. Same speed with slower decoders, more memory.
The FFmpeg Vulkan FFV1 decoder waits for the previous frame before the next one, a big GPU is not fully used. A second FFmpeg decoder with Vulkan on the same device decodes other frames in parallel. Not faster on low end cards, so only with NVIDIA GPUs with at least 64 streaming multiprocessors (VK_NV_shader_sm_builtins). The second decoder starts after the first one decoded a frame: both initializations at the same time lost the device (VK_ERROR_DEVICE_LOST). Its threads and counters have their own names in the trace (thread names numbered by the trace are read as frame counts by test/decoders.sh), its stages are counted with the ones of the first decoder.
auto uses the second FFmpeg decoder with Vulkan only with a big GPU, values with vulkan twice (e.g. internal+vulkan+vulkan) always use it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a big GPU,
--decoder auto(GPU and CPU together) was not faster than--decoder vulkan(GPU alone), sometimes slower. Two limits:→ Twice more output threads and frames in flight, so a second thread computes hashes in lanes.
→ A second FFmpeg decoder with Vulkan, on the same device (a second device is slower, the GPU switches between devices), only with NVIDIA GPUs with at least 64 streaming multiprocessors (
VK_NV_shader_sm_builtins). It starts after the first decoder decoded a frame: initializing both at the same time lost the device (VK_ERROR_DEVICE_LOST).More frames in flight only when the decoding is fast. Peak memory in auto with 6K5K16bit frames: 5.4-5.8 GB instead of 4.0 GB.