Skip to content

PyNITROS: reuse CUDA buffer for raw Image uploads#67

Open
StanByriukov02 wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
StanByriukov02:perf/pynitros-raw-image-buffer-reuse
Open

PyNITROS: reuse CUDA buffer for raw Image uploads#67
StanByriukov02 wants to merge 1 commit intoNVIDIA-ISAAC-ROS:mainfrom
StanByriukov02:perf/pynitros-raw-image-buffer-reuse

Conversation

@StanByriukov02
Copy link

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.

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.

2 participants