NVIDIA Driver Version Compatibility with PyTorch CUDA Toolkit Versions: A Complete Guide

To run PyTorch with CUDA 12.4 GPU acceleration, your system must have an NVIDIA driver version 525.60.13 or newer; otherwise, PyTorch falls back to CPU execution.

Understanding NVIDIA driver version compatibility with PyTorch CUDA toolkit versions is essential for successful GPU-accelerated machine learning deployments. The baonguyen6742/uv-install-torch repository demonstrates how modern Python packaging handles these constraints through pyproject.toml configuration, explicitly mapping PyTorch extras to specific CUDA toolkit versions and their corresponding minimum driver requirements.

Understanding CUDA Toolkit and Driver Dependencies

PyTorch wheels compiled for specific CUDA toolkit versions embed the CUDA runtime libraries required for GPU operations. At runtime, these libraries communicate with the host system's NVIDIA driver through the CUDA driver API. If the installed driver predates the minimum required version for that CUDA toolkit, the runtime cannot initialize, forcing PyTorch to disable GPU support and execute on CPU.

This compatibility chain is strict: PyTorch wheel → CUDA Toolkit version → Minimum NVIDIA driver version.

PyTorch Configuration in uv-install-torch

The baonguyen6742/uv-install-torch repository defines two optional dependency groups in pyproject.toml that handle different hardware configurations and driver requirements.

CPU-Only Installation

The cpu extra installs PyTorch built without CUDA support, making it suitable for machines without NVIDIA GPUs or for CPU-only inference workloads.

  • Packages: torch==2.4.1, torchvision==0.19.1, torchaudio==2.4.1
  • CUDA Toolkit: None (CPU-only build)
  • Driver Requirement: Not applicable

CUDA 12.4 Installation

The cu124 extra installs PyTorch wheels compiled against CUDA 12.4, enabling GPU acceleration on compatible hardware. According to the pyproject.toml configuration (lines 59-62), this extra maps to a custom PyTorch index:

[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
  • Packages: torch==2.4.1, torchvision==0.19.1, torchaudio==2.4.1
  • CUDA Toolkit: 12.4
  • Minimum NVIDIA Driver: 525.60.13 or newer

NVIDIA's official compatibility matrix confirms that the CUDA 12.4 runtime requires driver version 525.60.13 or higher to function correctly.

Checking Your NVIDIA Driver Version

Before installing the CUDA-enabled PyTorch build, verify your driver meets the minimum requirement of 525.60.13.

On Linux or Windows, run:

nvidia-smi

Examine the first line of the output, which displays the driver version. If the version is less than 525.60.13, you must upgrade your NVIDIA driver before installing the cu124 extra.

Installing PyTorch with UV

Use the uv package manager to install the appropriate extra based on your hardware capabilities and driver version.

For CPU-only systems:

uv pip install .[cpu]

For CUDA 12.4-capable systems with driver >= 525.60.13:

uv pip install .[cu124]

Verifying CUDA Availability in Python

After installation, confirm PyTorch can access the GPU by running a verification script. The repository includes this functionality in main.py.

import torch

print("torch version:", torch.__version__)
print("CUDA available:", torch.cuda.is_available())

if torch.cuda.is_available():
    print("CUDA driver version:", torch.version.cuda)
    print("GPU name:", torch.cuda.get_device_name(0))

Expected output with a compatible driver:


torch version: 2.4.1
CUDA available: True
CUDA driver version: 12.4
GPU name: NVIDIA GeForce RTX 4090

If the driver is incompatible or too old, torch.cuda.is_available() returns False and PyTorch operates in CPU mode.

Summary

  • NVIDIA driver version compatibility with PyTorch CUDA toolkit versions determines whether GPU acceleration is available at runtime.
  • The baonguyen6742/uv-install-torch repository provides explicit dependency groups: cpu for driver-independent execution and cu124 for CUDA 12.4 support.
  • CUDA 12.4 requires NVIDIA driver 525.60.13 or newer; older drivers cause silent fallback to CPU execution.
  • Verify driver compatibility using nvidia-smi before installing CUDA-enabled PyTorch wheels.
  • Use torch.cuda.is_available() to programmatically confirm GPU access after installation.

Frequently Asked Questions

What is the minimum NVIDIA driver version for PyTorch with CUDA 12.4?

The minimum NVIDIA driver version for PyTorch compiled against CUDA 12.4 is 525.60.13. This requirement is defined by NVIDIA's CUDA compatibility matrix, which specifies that the CUDA 12.4 runtime requires a driver supporting at least the 525.60.13 API level. Installing PyTorch with the cu124 extra on a system with an older driver will result in torch.cuda.is_available() returning False.

How do I check if my NVIDIA driver is compatible with PyTorch CUDA support?

Run the nvidia-smi command in your terminal or command prompt and examine the first line of the output, which displays the driver version. Compare this version against the minimum required for your PyTorch CUDA toolkit version. For CUDA 12.4 wheels, your driver must be 525.60.13 or newer. If nvidia-smi fails to execute, the NVIDIA driver is likely not installed or not properly configured.

Can I install PyTorch with CUDA support if my driver is too old?

You can install the package successfully, but CUDA will not be available at runtime. PyTorch will install because the wheels contain the necessary CUDA runtime libraries, but when you attempt to use GPU features, torch.cuda.is_available() will return False and PyTorch will fall back to CPU execution. To enable GPU acceleration, you must upgrade your NVIDIA driver to meet the minimum version required by the CUDA toolkit bundled with PyTorch.

What is the difference between the cpu and cu124 extras in uv-install-torch?

The cpu extra installs PyTorch wheels built without CUDA support, making them suitable for machines without NVIDIA GPUs or for CPU-only inference and training. This configuration requires no NVIDIA driver. The cu124 extra installs PyTorch wheels specifically compiled against CUDA 12.4, enabling GPU acceleration on compatible hardware. This requires an NVIDIA driver version 525.60.13 or newer. Both extras install the same PyTorch version (2.4.1), but the underlying binaries differ in their CUDA support as configured in the pyproject.toml file.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →