-
Notifications
You must be signed in to change notification settings - Fork 77
BETA CUDA interface: clarify 10->8 bit conversions #934
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1288,18 +1288,15 @@ def test_10bit_videos(self, device, asset): | |
| # This just validates that we can decode 10-bit videos. | ||
| # TODO validate against the ref that the decoded frames are correct | ||
|
|
||
| if device == "cuda:0:beta": | ||
| # This fails on our BETA interface on asset 0 (only!) with: | ||
| if device == "cuda:0:beta" and asset is H264_10BITS: | ||
| # This fails on the BETA interface with: | ||
| # | ||
| # RuntimeError: Codec configuration not supported on this GPU. | ||
| # Codec: 4, chroma format: 1, bit depth: 10 | ||
| # | ||
| # I don't remember but I suspect asset 0 is actually the one that | ||
| # fallsback to the CPU path on the default CUDA interface (that | ||
| # would make sense) | ||
| # We should investigate if and how we could make that fallback | ||
| # happen for the BETA interface. | ||
| pytest.skip("TODONVDEC P2 - investigate and unskip") | ||
| # It works on the default interface because FFmpeg fallsback to the | ||
| # CPU, while the BETA interface doesn't. | ||
| pytest.skip("Asset not supported by NVDEC") | ||
|
|
||
| decoder = VideoDecoder(asset.path, device=device) | ||
| decoder.get_frame_at(10) | ||
|
|
@@ -1674,12 +1671,11 @@ def test_beta_cuda_interface_backwards(self, asset, seek_mode): | |
|
|
||
| @needs_cuda | ||
| def test_beta_cuda_interface_small_h265(self): | ||
| # TODONVDEC P2 investigate why/how the default interface can decode this | ||
| # video. | ||
| # Test to illustrate current difference in behavior between the BETA and | ||
| # the default interface: this video isn't supported by NVDEC, but in the | ||
| # default interface, FFMPEG fallsback to the CPU while we don't. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Above is a drive-by, I was able to confirm that the default interface can decode this video because it falls back to the CPU. I will open a separate issue to discuss the CPU fallback behavior - I think we'll want to do a few changes eventually. |
||
|
|
||
| # This is fine on the default interface - why? | ||
| VideoDecoder(H265_VIDEO.path, device="cuda").get_frame_at(0) | ||
| # But it fails on the beta interface due to input validation checks, which we took from DALI! | ||
| with pytest.raises( | ||
| RuntimeError, | ||
| match="Video is too small in at least one dimension. Provided: 128x128 vs supported:144x144", | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note above how we're now not skipping this test anymore for the
H265_10BITSasset. Support forH265_10BITSisn't introduced by this PR, it was already working before, but now we know we can safely unskip it.Also, this isn't visible in this PR and not in scope anyway, but there's something interesting: on
H265_10BITS, the frame we decode with the BETA interface looks good, but it is slightly different than the on from the default CUDA interface. The difference is due to the fact that in the BETA interface, the 10 -> 8 bit conversion is done by NVDEC itself, while in the default interface it's done later via filtergraph inconvertAVFrameToFrameOutput().So overall we should expect small differences for 10bit videos between the BETA and default interface. I will follow-up on that by creating an issue. Generally, the BETA interfaces allows for drastically simpler code (no explicit conversion needed!)