Data

A pointer to a GPU buffer where the data should be copied.

The GPU buffer is only used for the duration of the command. Ownership of the buffer or handle stays with the user.

Pointers must be represented as a string (e.g. "0x1234cdef"). This is due to the NxLib using double for number nodes, which cannot represent all possible 64 bit pointers.

Buffers can be one of the following depending on the specified Type:

CUDA Buffers (Type = "Cuda")

The specified pointer must be known to the CUDA runtime as a device pointer. This is the case for

  • buffers allocated using cudaMalloc, cudaMallocPitch or similar

  • buffers mapped by cudaExternalMemoryGetMappedBuffer.

Vulkan Buffers (Type = "Vulkan")

A GPU buffer exported from Vulkan. Since the NxLib uses CUDA internally, the buffer has to be imported to CUDA using cudaImportExternalMemory, which causes some overhead. To limit this overhead you can import the buffer yourself and specify a CUDA buffer instead.

The buffer is identified differently depending on the operating system.

Linux

On Linux Vulkan buffers are identified by a Linux file descriptor obtained from vkGetMemoryFdKHR. The user is responsible for closing the file descriptor.

Note that even though the file descriptor is an integer and not a pointer, it is also specified as a string like the other pointer types. The string can be a decimal number without the 0x prefix.

Windows

On Windows Vulkan buffers are identified by a Windows handle obtained from vkGetMemoryWin32HandleKHR. The user is responsible for closing the handle.

JSON Format

Type

String