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_LISTnames 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+PTXships 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.
Read the box you are on
torch.cuda.is_available() is False, or the first kernel launch died, and you
cannot tell whether the card, the driver or the wheel is the problem. Point this
at nvidia-smi:
$ torch-cuda-compat --smi 2.7
This box: driver 470.199.02, nvidia-smi reports CUDA 11.4
PyTorch 2.7, 1 GPU(s) found
YES GPU 0: GeForce RTX 5090 — compute capability 12.0
CUDA 12.8: compute capability 12.0 is compiled into this build
https://referencesource.org/nvidia-cuda-compute-capability-by-gpu/geforce-rtx-5090/
pip install torch --index-url https://download.pytorch.org/whl/cu128
needs an NVIDIA driver >= 525; YOUR DRIVER 470.199.02 IS BELOW IT — update the
driver or install an older CUDA build
source says: "12.x | >= 525 | < 580"
The card is fine and the driver is not, and the output says which — that is the distinction the error message you got does not make. Exit status is 1 when something is wrong, so it works in CI.
Three ways in, because it depends where you are:
$ torch-cuda-compat --smi 2.7 # runs nvidia-smi here
$ nvidia-smi | torch-cuda-compat --smi 2.7 # piped from the GPU box
$ torch-cuda-compat --smi 2.7 --from saved.txt # output somebody sent you
It reads the table nvidia-smi prints, nvidia-smi -L, and
--query-gpu=name --format=csv. It matches the full SKU name the driver
prints — NVIDIA A100-SXM4-40GB, Tesla V100-SXM2-16GB — against the GPU
table's family names.
What it does not use: the "CUDA Version" in the nvidia-smi header. That is
the newest CUDA runtime the installed driver can serve, not the CUDA build you
have to install — a PyTorch wheel carries its own runtime, so a driver at or
above the floor NVIDIA states for the 12.x family runs a cu128 wheel even
though nvidia-smi says 12.4. The driver is compared against that floor, which
is quoted above, and the comparison is our arithmetic over a number NVIDIA
published. Where no source states a floor, driver_ok is None — not known,
rather than a pass or a failure we invented.
API
resolve(gpu, torch) |
the answer: every CUDA build of that release, each with runs, why and its evidence, plus recommended |
diagnose(nvidia_smi_output, torch) |
the same answer for every card in a box, plus the driver comparison |
read_smi(text) |
{"driver", "driver_cuda", "gpus", "shape"}; raises SMIUnreadable rather than returning an empty box |
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 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.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| torch_cuda_compat-0.3.1.tar.gz | 34.3 kB | Without provenance | Details for torch_cuda_compat-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| torch_cuda_compat-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for torch_cuda_compat-0.3.1-py3-none-any.whl |
Total release size: 64.6 kB
Release files / torch_cuda_compat-0.3.1.tar.gz
| Download URL | torch_cuda_compat-0.3.1.tar.gz |
|---|---|
| Size | 34.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c92b430b4ffe50bcdc05ccb575900e18eee287d70cfbd4e8e5ecfd188fcd84d8
|
|
BLAKE2b-256 checksum How to use checksums |
164b7e2603551c863c882629cf2035e257fe260d3172203d23c9a073df98b219
|
| 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.3.1-py3-none-any.whl
| Download URL | torch_cuda_compat-0.3.1-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57622bfcb9b68b5648efeaea94d46f4d6eddb1ce99a60a78db45d4ae49e972e2
|
|
BLAKE2b-256 checksum How to use checksums |
575498b86f422887d2cb742ebbcc32c7fafe2b3a97c70b49e5c101b44e3d6c63
|
| 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.3.1
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.