Skip to main content

torch-cuda-compat

Tells you which PyTorch wheel runs on a given NVIDIA GPU, and shows you the line on NVIDIA's or PyTorch's own page that says so.

$ 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
>>> 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'
>>> r["recommended"]["evidence"][0]["quote"]
'TORCH_CUDA_ARCH_LIST="7.5;8.0;8.6;9.0;10.0;12.0+PTX"'

The thing this gets right

A PyTorch wheel only runs on a GPU whose compute capability was compiled into it, and that list is not the same as "CUDA supports this card". An RTX 5090 is compute capability 12.0; the cu126 build of PyTorch 2.7 was compiled for 5.0 through 9.0. It installs perfectly and then dies at the first kernel launch. cu128 was compiled for 12.0 and works.

Three rules decide it, and all three are applied here:

  • Compiled in. The wheel's TORCH_CUDA_ARCH_LIST names the card's compute capability outright.
  • Binary compatibility. A cubin runs on any later minor revision of the same major architecture. This is why cu126, compiled for 8.0 and 8.6 and never mentioning 8.9, runs fine on an RTX 4090 — the case a hand-written table usually gets wrong. It does not cross a major: an sm_100 cubin (data-centre Blackwell, a B200) does not run on an sm_120 card (consumer Blackwell, a 5090), even though both are called Blackwell.
  • +PTX. An architecture marked +PTX ships as JIT source too, so the driver compiles it at first launch for any newer card. It works, after a pause the first time.

Where no source states which architectures a build was compiled for, runs is None — not known, rather than no.

Every value cites its source

>>> r = resolve("RTX 4090", "2.6")
>>> r["gpu_evidence"]["source"]
'https://developer.nvidia.com/cuda/gpus'
>>> r["gpu_evidence"]["quote"]          # the row the 8.9 was read out of
'8.9 | NVIDIA L4 NVIDIA L40 NVIDIA L40S | ... GeForce RTX 4090'
>>> {e["source"] for e in r["recommended"]["evidence"]}
{'https://raw.githubusercontent.com/pytorch/pytorch/release/2.6/.ci/manywheel/build_cuda.sh',
 'https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html'}

That is the point of the package. The values come from NVIDIA's CUDA GPU list, NVIDIA's CUDA Toolkit release notes and PyTorch's RELEASE.md and per-release build scripts, and each one carries the URL and the verbatim quote it was read from, so you can check it instead of trusting it. Nothing here is a value 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. About 300 KB of JSON, no dependencies, and no network access at runtime.

API

resolve(gpu, torch) the answer: every CUDA build of that release, each with runs, why and its evidence, plus recommended
compute_capability(gpu) the GPU table entry; raises GPUNotFound rather than guessing
architectures(pairing) the compute capabilities a build was compiled for
gpus(), pairings(), data() the shipped dataset

GPU names are matched leniently: "RTX 5090", "rtx-5090" and the "NVIDIA GeForce RTX 5090" that torch.cuda.get_device_name() returns all find the same card. An ambiguous name raises and lists the candidates instead of picking one.

Data and licence

Browse the dataset, one page per record, at https://referencesource.org/gpu-cuda-pytorch-compatibility/.

The compilation is CC0-1.0. The underlying facts come from PyTorch (BSD-3-Clause) and NVIDIA's technical documentation; each value cites its source, and short attributed quotes are all that is reproduced.

A JavaScript port shipping the identical data is on npm as torch-cuda-compat.

Metadata

Release files for torch-cuda-compat 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torch-cuda-compat 0.2.0
File Size Uploaded Provenance Actions
torch_cuda_compat-0.2.0.tar.gz 27.0 kB Without provenance Details for torch_cuda_compat-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for torch-cuda-compat 0.2.0
File Interpreter ABI Platform Actions
torch_cuda_compat-0.2.0-py3-none-any.whl Python 3 none any Details for torch_cuda_compat-0.2.0-py3-none-any.whl

Total release size: 51.7 kB

Release files / torch_cuda_compat-0.2.0.tar.gz

Download URL torch_cuda_compat-0.2.0.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bb9bbb4d1b2873b16a175cdaedb7a77ddf6fd70c5ef6e2d684f7939f8888972c
BLAKE2b-256 checksum
How to use checksums
de71a4e2cd56c7cb594ba8d5c2f62e1388056910d74c67a1f83cc66c34d10414
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / torch_cuda_compat-0.2.0-py3-none-any.whl

Download URL torch_cuda_compat-0.2.0-py3-none-any.whl
Size 24.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b39f3c91eae9f97ce3f43e2c4dafd5f8f3874acb81e316e52f441cf7310603e
BLAKE2b-256 checksum
How to use checksums
3690c78840e1d047147249c4a76bfd0d5bea80b2fb0041dc25142eba2a4de33c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for torch-cuda-compat 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page