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

Adds a cuda stream synchronization before cuvidUnmapVideoFrame in nvDecoder #4426

Merged
merged 2 commits into from
Nov 13, 2022

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Nov 9, 2022

  • adds a GPU synchronization point before cuvidUnmapVideoFrame in nvDecoder
    similarly to the VideoSdk examples

Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com

Category:

Bug fix (non-breaking change which fixes an issue)

Description:

  • adds a GPU synchronization point before cuvidUnmapVideoFrame in nvDecoder
    similarly to the VideoSdk examples

Additional information:

Affected modules and functionalities:

  • dali/operators/reader/nvdecoder/nvdecoder.cc

Key points relevant for the review:

Tests:

  • Existing tests apply
    • test_video.py
    • VideoReaderDecoderCompareTest
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

…ecoder

- adds a GPU synchronization point before cuvidUnmapVideoFrame in nvDecoder
  similarly to the VideoSdk examples

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Nov 9, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6436020]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6436020]: BUILD PASSED

@szalpal szalpal self-assigned this Nov 9, 2022
@@ -427,6 +427,8 @@ void NvDecoder::receive_frames(SequenceWrapper& sequence) {
nv_time_base_));
if (stop_) break;
convert_frame(frame, sequence, i);
// synchronize before MappedFrame is destroyed and cuvidUnmapVideoFrame is called
cudaStreamSynchronize(stream_);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cudaStreamSynchronize(stream_);
CUDA_CALL(cudaStreamSynchronize(stream_));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@mzient mzient self-assigned this Nov 9, 2022
Copy link
Contributor

@mzient mzient left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, with a nitpick.

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Nov 9, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6444620]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6444620]: BUILD PASSED

@JanuszL JanuszL merged commit dfb72dd into NVIDIA:main Nov 13, 2022
@JanuszL JanuszL deleted the vidoe_sync_issue branch November 13, 2022 23:40
stiepan pushed a commit that referenced this pull request Nov 14, 2022
…ecoder (#4426)

- adds a GPU synchronization point before cuvidUnmapVideoFrame in nvDecoder
  similarly to the VideoSdk examples

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
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

Successfully merging this pull request may close these issues.

5 participants