Quick Start
Install
Install via PyPI:
For CUDA 13:
Bare pip install nixl defaults to nixl[cu12] for backwards compatibility, so existing workflows continue to work without changes.
NIXL is supported on Linux only. It is tested on Ubuntu (22.04/24.04) and Fedora. macOS and Windows are not currently supported.
To verify the installation:
Expected output:
The sections below follow the Transfer Agent lifecycle: initialization, backend creation, memory registration, metadata exchange, transfer, and teardown.
If you installed NIXL via pip above, you’re ready to go. For building from source, see Building NIXL from Source.
The NIXL workflow follows a strict order:
- Create an agent
- Create backends (C++ and Rust only — Python auto-initializes)
- Register memory
- Exchange metadata with remote agents
- Create and execute transfers
- Check transfer status
- Clean up resources
Memory must be registered before metadata exchange. Metadata exchanged before memory registration will not include the memory segment information needed for transfers.
Agent Initialization
A Transfer Agent represents one endpoint in a data transfer. Create one per process with a unique name.
The Python API auto-initializes backends listed in nixl_agent_config.backends
(default: ['UCX']). In C++ and Rust, backends must be created explicitly as
shown in the next section.
Backend Creation
Backends handle data transfer over specific transports. Python auto-initializes backends from the agent config. C++ and Rust require explicit creation.
You can create multiple backends on the same agent. NIXL will automatically select the best one for each transfer based on source and destination memory types. See NIXL Backends for guidance on which backends to enable.
Memory Registration
Register memory segments before they can participate in transfers. Registration creates the internal structures backends need for tracking and remote access metadata.
Python automatically detects the memory type from the tensor’s device. A CUDA
tensor registers as VRAM, a CPU tensor as DRAM. You can also pass raw memory
tuples (address, size, device_id, tag) for manual control.
Metadata Exchange
Transfer Agents must exchange metadata before transfers. NIXL supports three modes:
Side-Channel (Direct)
etcd (Distributed)
Programmatic
The simplest approach for getting started. Agents exchange metadata directly over a TCP connection. One agent listens for incoming metadata, while the other fetches and sends.
The Python side-channel API (send_local_metadata/fetch_remote_metadata) uses
built-in TCP communication. The C++ and Rust examples above show the programmatic
approach for same-process usage. For cross-process C++/Rust with side-channel,
use the etcd mode or implement your own transport for the metadata blobs.
Creating and Executing Transfers
Create a transfer request, post it (non-blocking), and poll for completion.
Checking Transfer Status
Poll transfer status after posting. The post call returns immediately.
Transfer status returns differ across languages. Python returns strings
("DONE", "PROC", "ERR"). C++ returns nixl_status_t enum values
(NIXL_SUCCESS, NIXL_IN_PROG, negative error codes). Rust returns
Result<XferStatus, NixlError> with variants Success and InProgress.
Always use the language-appropriate status check.
Teardown
Release resources in order: transfer handles, then memory, then remote metadata.
In Rust, resources are automatically cleaned up when they go out of scope via the
Drop trait. Explicit cleanup calls are optional but can be useful for controlling
the order of resource release.