Skip to content

nvproxy: support DMA-BUF export for GPU memory#13101

Draft
atoniolo76 wants to merge 1 commit intogoogle:masterfrom
modal-labs:alessio/support-dmabuf-nvproxy
Draft

nvproxy: support DMA-BUF export for GPU memory#13101
atoniolo76 wants to merge 1 commit intogoogle:masterfrom
modal-labs:alessio/support-dmabuf-nvproxy

Conversation

@atoniolo76
Copy link
Copy Markdown

Add NV_ESC_EXPORT_TO_DMABUF_FD ioctl handling to export GPU memory as DMA-BUF file descriptors that ibv_reg_dmabuf_mr can consume. This is the prerequisite for GPU-direct RDMA via the RDMA proxy.

Key changes:

  • Add HostFDProvider interface in pkg/sentry/vfs for cross-device FD translation (used by rdmaproxy to resolve sandbox FD -> host FD)
  • Add IoctlExportToDMABufFD struct in pkg/abi/nvgpu
  • Implement frontendExportToDMABufFD, ctrlExportObjectToFD, and ctrlExportObjectsToFD handlers
  • Add hostFDWrapper type for wrapping host DMA-BUF FDs in the sentry
  • Fix RawSyscall -> Syscall in UVM ioctl paths for preemption safety

@google-cla
Copy link
Copy Markdown

google-cla Bot commented May 6, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Add NV_ESC_EXPORT_TO_DMABUF_FD ioctl handling to export GPU memory as
DMA-BUF file descriptors that ibv_reg_dmabuf_mr can consume. This is
the prerequisite for GPU-direct RDMA via the RDMA proxy.

Key changes:
- Add HostFDProvider interface in pkg/sentry/vfs for cross-device FD
  translation (used by rdmaproxy to resolve sandbox FD -> host FD)
- Add IoctlExportToDMABufFD struct in pkg/abi/nvgpu
- Implement frontendExportToDMABufFD, ctrlExportObjectToFD, and
  ctrlExportObjectsToFD handlers
- Add hostFDWrapper type for wrapping host DMA-BUF FDs in the sentry
- Fix RawSyscall -> Syscall in UVM ioctl paths for preemption safety

Co-authored-by: Cursor <cursoragent@cursor.com>
@atoniolo76 atoniolo76 force-pushed the alessio/support-dmabuf-nvproxy branch from 36d1f7d to 7e452bd Compare May 6, 2026 17:01
@EtiennePerot EtiennePerot requested a review from tranji-cloud May 6, 2026 19:52
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.

1 participant