PyNITROS: reuse CUDA buffer for raw Image uploads#67
Open
StanByriukov02 wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
Open
PyNITROS: reuse CUDA buffer for raw Image uploads#67StanByriukov02 wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
StanByriukov02 wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
Conversation
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.
In PyNitrosImageView, the fallback path for a regular ROS Image currently does cudaMalloc + H2D memcpy and then cudaFree during postprocess. On camera streams that malloc/free churn shows up as jitter and wasted work.
This adds an opt-in reusable device buffer pool for that raw-image upload path. When enabled it reuses a CUDA buffer with enough capacity instead of allocating/freeing every frame, while keeping the default behavior unchanged unless you turn it on.
Enable with PYNITROS_REUSE_RAW_CUDA_BUFFER=1. If you want a tiny receipt, set PYNITROS_RAW_CUDA_BUFFER_RECEIPTS=1 and it will print alloc vs reuse counts at exit.