| Crates.io | cuda_d3d11_interop_bindings |
| lib.rs | cuda_d3d11_interop_bindings |
| version | 0.1.1 |
| created_at | 2025-06-14 20:57:19.604538+00 |
| updated_at | 2025-06-14 21:02:13.710716+00 |
| description | Register and map D3D11 buffers with CUDA |
| homepage | https://github.com/jathoms/cuda_d3d11_interop_bindings |
| repository | https://github.com/jathoms/cuda_d3d11_interop_bindings |
| max_upload_size | |
| id | 1712662 |
| size | 19,948 |
For when you need to register and unregister Direct3D11 buffers with CUDA, as well as map/unmap those buffers for CUDA kernels.
CUDA Toolkit is installed.
Environment variable CUDA_PATH points to your CUDA install.
For example:
On windows, something like: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vXX.X where XX.X is the version you have installed
On linux: /usr/local/cuda
/// When we have device_ctx: ID3D11DeviceContext and d3d_buffer: ID3D11Buffer
/// both from the Windows API through a crate like `windows` or `winapi`
let mut cuda_res = CudaD3D11Resource::new(device_ctx, d3d_buffer)?;
cuda_res.with_mapped(stream, |mapped| {
let (dev_ptr, size) = mapped.as_ptr();
// use dev_ptr in CUDA kernel launch
Ok(())
})?;
MIT