Skip to content

Conversation

@zlatinski
Copy link
Contributor

No description provided.

Fix the parameters passed to InitVulkanDecoderDevice() from the
applications.

There was a change that added a codec to the InitVulkanDecoderDevice()
but did not update all of the clients.

Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>
During sequence reconfiguration (e.g., resolution change), the
NvPerFrameDecodeImageSet::init() function was unconditionally creating
new timeline semaphores without checking if they already existed.

This caused two problems:
1. Memory leak: Old semaphores were never destroyed (the 8 allocations
   / 1456 bytes leak seen in debug builds)
2. Synchronization corruption: In-flight GPU work was still waiting on
   the OLD semaphore values, but the NEW semaphores started at
   initialValue=0. This caused device lost when using display
   presentation, because the swap chain consumer was using the
   corrupted timeline synchronization.

Headless mode (--noPresent) was unaffected because timeline semaphores
are not used for presentation synchronization in that path.

Fix: Only create the timeline semaphores if they don't already exist.
On reconfigure, reuse the existing semaphores to preserve in-flight
synchronization state.

Signed-off-by: Tony Zlatinski <tzlatinski@nvidia.com>
@srinathkr-nv
Copy link
Contributor

The fix to avoid re-creating the semaphores looks good to me.

I see that this PR also contains the changes from #184, but I'm not aware of any connection between these changes. Is there something I'm missing when reviewing this change? Or did that change get included here accidentally?

@zlatinski zlatinski closed this Dec 24, 2025
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.

3 participants