How do I install xFormers on a cloud GPU?

Install PyTorch and xFormers together from one PyTorch CUDA index, for example pip install torch xformers --index-url https://download.pytorch.org/whl/cu130, then run python -m xformers.info to see which attention kernels your GPU can use; on an RTX 5090 or RTX PRO 6000 (compute capability 12.0), test memory_efficient_attention before you rely on it, because current xFormers wheels may stop with “No operator found” on those cards.
Updated 2026-11-01
This guide follows the official xFormers README, CHANGELOG and PyPI metadata, the xFormers 0.0.35 source, the PyTorch wheel indexes, related GitHub issues and the NVIDIA CUDA GPUs list, all read on 2026-11-01. It is for people whose ComfyUI, diffusion or training setup needs xFormers on a rented GPU and hits a pip conflict or a missing-kernel error.
What xFormers 0.0.35 needs
According to the xFormers README, CHANGELOG and PyPI page (read 2026-11-01):
- The latest release on PyPI is 0.0.35, uploaded on 2026-02-20. It needs Python 3.9 or newer and declares
torch>=2.10andnumpyas dependencies. - Older releases pin one exact PyTorch: 0.0.34 depends on
torch==2.10.0and 0.0.33.post1 ontorch==2.9.0. If pip picks one of those, it will try to replace the PyTorch you already have. - The README installs CUDA builds from the PyTorch index:
cu126,cu128andcu130(plusrocm7.1, marked experimental). On 2026-11-01, download.pytorch.org has xFormers 0.0.35 in thecu126,cu128andcu130indexes and no xFormers folder incu132orcu134. - The CHANGELOG lists a future 0.0.36 (date “2026-??-??”, not on PyPI on 2026-11-01) that becomes a pure Python package with its kernels moved to MSLK.
| xFormers | PyTorch requirement (PyPI) |
|---|---|
| 0.0.35 | torch>=2.10 |
| 0.0.34 | torch==2.10.0 |
| 0.0.33.post1 | torch==2.9.0 |
Step 1: Deploy a Raw GPU and connect
- Open /deploy and choose Raw GPU. Our deploy page describes it as “a raw GPU with JupyterLab + CUDA pre-installed. SSH access, root on a dedicated container, install any Python/CUDA libs you want.”
- Pick a card. Cards listed on /pricing on 2026-11-01 include the RTX 5090 32G, RTX PRO 6000 96G, RTX 4090 48G, RTX 4090 24G, RTX 4090D 24G, RTX 3090 24G, RTX 2080, A100 80G, A100 40G, A800 80G, A800 40G, H20 96G and V100 32G. See current rates on /pricing. VRAM need depends on model, precision and workflow; see How much VRAM do I need to run an LLM?.
- Open a terminal in JupyterLab, or connect over SSH with your instance’s connection details:
ssh -p <port> <user>@<host>
Step 2: Check the environment first
nvidia-smi # driver and "CUDA Version" in the header
nvidia-smi --query-gpu=name,compute_cap --format=csv # card name and compute capability
nvcc --version # CUDA toolkit, only needed for a source build
python3 --version # xFormers 0.0.35 needs 3.9 or newer
python3 -c "import torch; print(torch.__version__, torch.version.cuda, torch.cuda.is_available())"
Write down compute_cap, the “CUDA Version” in the nvidia-smi header and, if PyTorch is present, its version and torch.version.cuda.
Compute capability from the NVIDIA CUDA GPUs list (read 2026-11-01) for cards on our pricing page: RTX 5090 and RTX PRO 6000 Blackwell 12.0, RTX 4090 8.9, RTX 3090 8.6, A100 8.0, RTX 2080 7.5, V100 7.0. For other cards, read compute_cap from the command above.
Our deploy page lists “JupyterLab + CUDA pre-installed” for Raw GPU but does not list the driver version, whether nvcc is on PATH, or whether PyTorch is pre-installed, so read them from the commands above on your own instance.
Step 3: Install PyTorch and xFormers from the same CUDA index
Use a virtual environment so the install does not touch system packages:
python3 -m venv ~/venvs/xformers
source ~/venvs/xformers/bin/activate
pip install -U pip
Option A: fresh environment (matched pair from one index). Pick cu130, cu128 or cu126, choosing one whose CUDA version is not newer than the “CUDA Version” shown by nvidia-smi:
pip install torch "xformers>=0.0.35" --index-url https://download.pytorch.org/whl/cu130
On 2026-11-01 the newest Linux PyTorch build in the cu130 index is 2.14.1. The current PyTorch stable release (2.15.0, per the PyTorch install page) is built for CUDA 13.2 and 13.4, and those two indexes have no xFormers wheels, so a matched pair from one index is one PyTorch release behind.
Option B: keep the PyTorch you already have. If your app already depends on a working CUDA PyTorch 2.10 or newer, install only xFormers and keep the version floor so pip cannot fall back to a release that pins an older torch:
python -c "import torch; print(torch.__version__)" # note the version
pip install "xformers>=0.0.35" --index-url https://download.pytorch.org/whl/cu130
python -c "import torch; print(torch.__version__)" # should print the same version
The xFormers 0.0.34 CHANGELOG says its wheels moved to the PyTorch stable API/ABI so that builds for PyTorch 2.10 also work with later versions. Whether that holds for your exact PyTorch build is something to confirm with Step 4, not to assume.
If you use ComfyUI or another app with a requirements.txt, install xFormers into the same environment that app runs in.
Step 4: Verify the install on the GPU
python -m xformers.info
According to the xFormers README, this command shows which kernels are available. Look at the pytorch.version, pytorch.cuda, gpu.compute_capability and gpu.name lines and at the memory_efficient_attention.* lines, which read available or unavailable.
Then run one real call, since xformers.info only lists kernels:
python - <<'PY'
import torch
import xformers.ops as xops
# xFormers expects [batch, sequence, heads, head_dim]
q = torch.randn(1, 1024, 8, 64, device="cuda", dtype=torch.float16)
out = xops.memory_efficient_attention(q, q, q)
print("ok", out.shape, out.dtype)
PY
If it prints a line that starts with ok, xFormers found a kernel for your card. If it raises NotImplementedError, read the next section.
Fix: “No operator found for memory_efficient_attention_forward with inputs:”
xFormers raises this NotImplementedError when none of its attention kernels accepts your inputs on your GPU. Under the message it prints one reason per kernel. Common reasons:
requires device with capability <= (9, 0) but your GPU has capability (12, 0) (too new): in the xFormers 0.0.35 source, the CUTLASS kernel checks for a maximum capability of (9, 0). An RTX 5090 or RTX PRO 6000 Blackwell reports 12.0. Reports in xFormers issue #1374 (RTX 5090, official CUDA 13 wheel) and ComfyUI issue #11329 show this exact error. In a 2026-02-05 reply in issue #1374, an xFormers contributor said Blackwell support is not expected in xFormers soon and pointed to MSLK or FlashAttention 4 instead.operator wasn't built - see `python -m xformers.info` for more info: that kernel is not in your wheel. Check theunavailablelines from Step 4.dtype=torch.float32 (supported: {torch.bfloat16, torch.float16}): the FlashAttention kernels take only float16 or bfloat16 inputs. Run the model in float16 or bfloat16, or drop flags that force float32.
What to do on an RTX 5090 or RTX PRO 6000 (12.0):
- Use PyTorch’s built-in attention (SDPA) and skip xFormers. For ComfyUI, start it with PyTorch cross-attention:
python main.py --use-pytorch-cross-attention
--use-pytorch-cross-attention and --disable-xformers are both ComfyUI command-line options (from comfy/cli_args.py, read 2026-11-01). Check that ComfyUI starts and renders a test workflow on your instance.
2. If your workload needs a different attention library, use the upstream advice in issue #1374: MSLK or FlashAttention 4. See our FlashAttention install guide, then check it with a test call as in Step 4.
Fix: “xformers 0.0.34 depends on torch==2.10.0” (ResolutionImpossible)
xFormers issue #1374 shows pip stopping with The conflict is caused by: xformers 0.0.34 depends on torch==2.10.0 and ERROR: ResolutionImpossible when the environment had a different torch. The same pin explains why pip install xformers can download a different PyTorch: an exact-pin release was picked. Fixes:
- Ask for
"xformers>=0.0.35", whose PyPI metadata declarestorch>=2.10instead of one exact version. - Install from the PyTorch index that matches your torch’s CUDA build (Step 3).
- After any install, compare
torch.__version__with the value you noted before.
Build from source (only if no wheel fits)
Per the xFormers README, read 2026-11-01:
- Install
ninja, then runpip install -v --no-build-isolation -U git+https://github.com/facebookresearch/xformers.git@main#egg=xformersin the environment that already has your PyTorch. nvcc --versionmust match the CUDA version of your PyTorch build (torch.version.cuda), and your GCC must be a version NVCC supports.- Set
TORCH_CUDA_ARCH_LISTto your compute capability (for example"8.9"on an RTX 4090) to build only what you need. If the build runs out of memory, setMAX_JOBS=2. - On a Raw GPU you have root, so you can install build tools yourself; run long builds inside
tmuxorscreenso they keep going if your SSH session drops (see How do I keep a job running after SSH disconnects?). - A source build does not add Blackwell support that the code does not have; the CUTLASS limit above comes from the source.
Data on local instance storage is permanently deleted when you destroy the instance (see /terms), so keep your install commands in a script you can re-run on the next instance. Billed per minute, rounded up, with a 1-minute minimum; billing stops when you destroy the instance (see /terms).
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| pip downloads a different torch | an xFormers release with an exact torch pin was picked | install "xformers>=0.0.35" from the matching PyTorch index |
ResolutionImpossible with depends on torch==2.10.0 |
0.0.34 pins torch 2.10.0 | use "xformers>=0.0.35" |
No operator found for memory_efficient_attention_forward with (12, 0) (too new) |
RTX 5090 / RTX PRO 6000 Blackwell, CUTLASS kernel limited to 9.0 | skip xFormers and use PyTorch SDPA (ComfyUI: --use-pytorch-cross-attention); upstream: MSLK or FlashAttention 4 |
operator wasn't built |
kernel not in your wheel | check python -m xformers.info, use a wheel from the matching index |
dtype=torch.float32 reason |
float32 inputs | run in float16 or bfloat16 |
no xFormers wheel for cu132 / cu134 |
those indexes have no xFormers folder on 2026-11-01 | use a cu130, cu128 or cu126 pair, or keep your torch with Option B and verify |
FAQ
How do I check that xFormers works on my GPU?
Run python -m xformers.info and look at the memory_efficient_attention lines, which read available or unavailable. Then call xformers.ops.memory_efficient_attention on a small float16 CUDA tensor; if it returns without NotImplementedError, xFormers found a kernel for your card.
Which pip command installs xFormers with the right CUDA build?
The xFormers README installs it from the PyTorch index, for example pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu130, with cu126 and cu128 as the other CUDA options. Use the index that matches the CUDA build of your PyTorch.
Why did pip install xformers replace my PyTorch?
Some xFormers releases pin one exact PyTorch: 0.0.34 depends on torch==2.10.0 and 0.0.33.post1 on torch==2.9.0. Ask for xformers>=0.0.35, which declares torch>=2.10, and check torch.version before and after the install.
Does xFormers work on an RTX 5090?
Check it on your instance. The RTX 5090 has compute capability 12.0, the CUTLASS kernel in xFormers 0.0.35 accepts GPUs only up to 9.0, and GitHub issue reports show “No operator found for memory_efficient_attention_forward” on RTX 5090. For ComfyUI, skip xFormers and start it with --use-pytorch-cross-attention so it uses PyTorch SDPA; upstream, an xFormers contributor pointed to MSLK or FlashAttention 4 for Blackwell in issue #1374 on 2026-02-05.
How do I fix “No operator found for memory_efficient_attention_forward”?
Read the reason printed under each kernel. “too new” means your GPU’s compute capability is above what the kernel accepts, so skip xFormers and use PyTorch SDPA (in ComfyUI, --use-pytorch-cross-attention), or MSLK or FlashAttention 4; “operator wasn’t built” means the kernel is missing from your wheel; a dtype=torch.float32 reason means you should run in float16 or bfloat16.
Is there an xFormers wheel for PyTorch 2.15 on CUDA 13.2 or 13.4?
Not on the PyTorch index on 2026-11-01: the cu132 and cu134 indexes have no xFormers folder. Install a matched pair from the cu130, cu128 or cu126 index, or keep your PyTorch and install xformers>=0.0.35 from the cu130 index, then verify with python -m xformers.info and a test call.
Do I need to build xFormers from source?
Usually not. The README provides wheels on the PyTorch index for CUDA 12.6, 12.8 and 13.0. Build from source only if no wheel fits your PyTorch, and match nvcc to torch.version.cuda before you start.
Sources
- xFormers README and CHANGELOG, read 2026-11-01
- xformers on PyPI (0.0.35, 0.0.34, 0.0.33.post1 metadata), read 2026-11-01
- xFormers optimized operators docs and the v0.0.35 source (
xformers/ops/fmha/), read 2026-11-01 - PyTorch wheel index (cu126, cu128, cu130 xFormers folders) and the PyTorch install page, read 2026-11-01
- xFormers issue #1374, xFormers issue #1357, ComfyUI issue #11329 and ComfyUI
comfy/cli_args.py, read 2026-11-01 - NVIDIA CUDA GPUs list and legacy list, read 2026-11-01