# A question about NvBufferCreate API

**URL:** <https://forums.developer.nvidia.com/t/a-question-about-nvbuffercreate-api/219722>\
**Category:** Jetson Xavier NX\
**Tags:** cuda\
**Created:** [July 5, 2022, 1:50am UTC](https://forums.developer.nvidia.com/t/a-question-about-nvbuffercreate-api/219722 "2022-07-05T01:50:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinson.Chau](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Vinson.Chau](https://forums.developer.nvidia.com/u/Vinson.Chau)\
**Post date:** [July 5, 2022, 1:50am UTC](https://forums.developer.nvidia.com/t/a-question-about-nvbuffercreate-api/219722/1 "2022-07-05T01:50:48Z")

</div>

In NVIDIA’s API for creating NvBuffer, using the Buffer created by NvBufferCreate, layout=NvBufferLayout\_Pitch, and the created DMA memory, can the user specify the data layout in it?  
At present, it has been tested and found that the image stored in the memory, after storing a line, will jump a segment of memory, and then store the data of the next line. (For example, to store the 1920x1080 image , after storing 1920 Y data in the memory, 128 bytes of data will be vacated, and then the next line of Y data will be stored) Is there a way to continue the DMA transfer without writing additional code for copy line by line?

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [July 5, 2022, 3:13am UTC](https://forums.developer.nvidia.com/t/a-question-about-nvbuffercreate-api/219722/3 "2022-07-05T03:13:45Z")

</div>

Hi,  
NvBuffer is DMA buffer and we have to fit the data alignment. You can get pitch, width,height of each plane by calling _NvBufferGetParams()_. Or can call _Raw2NvBuffer()_ to copy data to the buffer.

---

<div class="post-metadata">

**Author:** ![Vinson.Chau](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Vinson.Chau](https://forums.developer.nvidia.com/u/Vinson.Chau)\
**Post date:** [July 5, 2022, 3:59am UTC](https://forums.developer.nvidia.com/t/a-question-about-nvbuffercreate-api/219722/4 "2022-07-05T03:59:22Z")

</div>

Good received ! Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [July 27, 2022, 2:49am UTC](https://forums.developer.nvidia.com/t/a-question-about-nvbuffercreate-api/219722/6 "2022-07-27T02:49:00Z")

</div>

Closed on July 27, 2022, 2:49am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
