Reference Source

torch-cuda-compat — will this PyTorch wheel actually run on this GPU?

Published .

An RTX 5090 is compute capability 12.0. PyTorch 2.7's cu126 build was compiled for 5.0 through 9.0. It installs perfectly and then dies at the first kernel launch.

$ pip install torch-cuda-compat
$ torch-cuda-compat "RTX 5090" 2.7
GeForce RTX 5090 — compute capability 12.0
PyTorch 2.7

  no   CUDA 11.8   this build stops at compute capability 9.0; the card is
                   12.0, so the wheel installs and then fails at the first
                   kernel launch
  no   CUDA 12.6   this build stops at compute capability 9.0; the card is
                   12.0, so the wheel installs and then fails at the first
                   kernel launch
  YES  CUDA 12.8   compute capability 12.0 is compiled into this build

pip install torch --index-url https://download.pytorch.org/whl/cu128
needs an NVIDIA driver >= 525

The same package is on npm, and prints byte-identical output:

$ npx torch-cuda-compat "RTX 5090" 2.7

Install

PyPIpip install torch-cuda-compat — Python 3.8+
npmnpm install torch-cuda-compat — Node 14+
LicenceCC0-1.0 — public domain, no attribution required
Dependenciesnone, in either language
Network at runtimenone; the data ships inside the package

As a library

>>> from torch_cuda_compat import resolve
>>> r = resolve("RTX 5090", "2.7")
>>> r["recommended"]["cuda"]
'12.8'
>>> r["recommended"]["install"]
'pip install torch --index-url https://download.pytorch.org/whl/cu128'

The three rules it applies

Most hand-written compatibility tables get at least one of these wrong.

Where no source states which architectures a build was compiled for, the answer is None — *not known*, rather than *no*. Eighteen of the older pairings (PyTorch 1.12 to 2.5) are in that state and say so.

Every value cites the page it came from

>>> r = resolve("RTX 4090", "2.6")
>>> r["gpu_evidence"]["source"]
'https://developer.nvidia.com/cuda/gpus'
>>> r["gpu_evidence"]["quote"]
'8.9 | NVIDIA L4 NVIDIA L40 NVIDIA L40S | ... GeForce RTX 4090'

The values are read from NVIDIA's CUDA GPU list, NVIDIA's CUDA Toolkit release notes, and PyTorch's RELEASE.md and per-release build scripts. Each one carries the URL and the verbatim quote it was read from, so you can check it rather than trust it. Nothing in the package is a number somebody typed out from memory.

What is in it

441 NVIDIA GPUs with their compute capability, and 45 (PyTorch release, CUDA build) pairings covering PyTorch 1.12 through 2.14 and CUDA 11.3 through 13.2 — each with the Python versions, the cuDNN version, the wheel index URL, the compiled architecture list and the minimum NVIDIA driver.

The two implementations were cross-checked against each other over all 7,497 (GPU × PyTorch release) combinations, with zero disagreements.

The data on its own

The pairings are published as a browsable dataset, and as JSON and CSV you can fetch without installing anything:

Nobody else publishes this join. PyTorch's release notes state the CUDA builds but not the driver floor; NVIDIA's release notes state the driver floor but say nothing about PyTorch; and the compiled architecture list exists only inside PyTorch's own build script.

Known gaps

Stated here rather than discovered later: