What is the usage of nvidia_p2p_get_pages and nvidia_p2p_dma_map_pages


I’m trying to copy a data-chunk to my GPU device-memory using GPU-direct RDMA.

In the documentation:

“Function nvidia_p2p_get_pages()… This function makes the pages underlying a range of GPU virtual memory accessible to a third-party device.”

“Function nvidia_p2p_dma_map_pages()… This function makes the physical pages retrieved using nvidia_p2p_get_pages() accessible to a third-party device.”

I don’t understand how to use the nvidia_p2p_page_table, or the nvidia_p2p_dma_mapping the I got from the functions to transfer the data. Can someone help?

Thanks in advance

Hi @oshinover , please see nv_peer_mem as an example: