Why torch.cuda.is_available() Returns False After Installing PyTorch with CUDA on Windows 10? (NVIDIA GeForce 820M Fix Guide)

If you’ve recently installed PyTorch with CUDA support on your Windows 10 machine, only to find that torch.cuda.is_available() returns False, you’re not alone. This issue is particularly common with older NVIDIA GPUs like the GeForce 820M, a budget laptop GPU released in 2013. While modern GPUs (e.g., RTX series) work seamlessly with recent PyTorch and CUDA versions, older models like the 820M face compatibility hurdles due to their limited compute capability and outdated architecture.

This guide demystifies why torch.cuda.is_available() fails for the GeForce 820M and provides a step-by-step fix to enable CUDA acceleration. We’ll cover compatibility issues, driver requirements, and the exact software versions needed to get PyTorch working with your GPU.

Table of Contents#

  1. Understanding the Problem
  2. Common Causes
  3. Prerequisites
  4. Step-by-Step Fix Guide
  5. Verification
  6. Troubleshooting
  7. Conclusion
  8. References

Understanding the Problem#

When you run torch.cuda.is_available() in Python, PyTorch checks if a CUDA-enabled GPU is detected and usable. A False result means PyTorch is running on CPU only, even if you installed a "CUDA-enabled" PyTorch version. For NVIDIA GeForce 820M users, this is almost always due to incompatibility between the GPU’s capabilities and modern PyTorch/CUDA versions.

Key Limitation of GeForce 820M: Compute Capability#

The NVIDIA GeForce 820M is an entry-level GPU released in 2013. Its critical limitation is its compute capability (CC) of 2.1 (check NVIDIA’s compute capability list). Compute capability is a hardware specification that determines which CUDA features and software versions the GPU supports.

Recent PyTorch versions (1.8.0+) drop support for GPUs with compute capability < 3.5. Since the 820M’s CC is 2.1, it is incompatible with PyTorch 1.8.0 and later. This is the root cause for most users.

Common Causes#

Before diving into fixes, let’s identify why torch.cuda.is_available() returns False for the 820M:

1. Incompatible PyTorch Version#

Modern PyTorch (1.8.0+) requires compute capability ≥ 3.5. The 820M (CC 2.1) is unsupported here.

2. Incorrect CUDA Toolkit Installation#

Installing a CUDA Toolkit version newer than what the 820M supports (e.g., CUDA 11.0+) will fail, as the GPU lacks hardware support for newer CUDA features.

3. Outdated or Mismatched NVIDIA Drivers#

Older drivers may not recognize the CUDA Toolkit, while newer drivers often drop support for legacy GPUs like the 820M.

4. Missing PATH Variables#

CUDA binaries (e.g., nvcc) or PyTorch libraries may not be in your system’s PATH, preventing PyTorch from detecting CUDA.

5. Accidental CPU-Only PyTorch Installation#

If you installed the CPU-only version of PyTorch (e.g., via pip install torch without specifying CUDA), torch.cuda.is_available() will always return False.

Prerequisites#

Before starting the fix, gather the following:

  • GPU Model: Confirm you have an NVIDIA GeForce 820M (check via Device Manager > Display Adapters or dxdiag).
  • Compute Capability: Verify CC 2.1 (via NVIDIA’s GPU database).
  • Windows 10: This guide targets Windows 10 (64-bit).
  • Admin Rights: Required for installing drivers, CUDA, and modifying system settings.
  • Internet: To download drivers, CUDA, and PyTorch.

Step-by-Step Fix Guide#

The solution involves installing legacy PyTorch and CUDA versions compatible with the 820M’s compute capability (2.1). Here’s how:

Step 1: Uninstall Existing PyTorch and CUDA (If Any)#

First, remove conflicting software to avoid version mismatches:

  • Uninstall PyTorch: Open Command Prompt (Admin) and run:
    pip uninstall torch torchvision torchaudio
  • Uninstall CUDA Toolkit: Go to Control Panel > Programs > Programs and Features, then uninstall:
    • NVIDIA CUDA Toolkit (any version)
    • NVIDIA PhysX System Software
    • NVIDIA Graphics Driver

Step 2: Clean Uninstall NVIDIA Drivers (Critical!)#

Old driver residues often cause conflicts. Use Display Driver Uninstaller (DDU) to wipe drivers:

  1. Download DDU.
  2. Restart your PC in Safe Mode (hold Shift while restarting > Troubleshoot > Advanced Options > Startup Settings > Enable Safe Mode).
  3. Run DDU, select "Clean and restart" to remove all NVIDIA drivers.

Step 3: Install Compatible NVIDIA Drivers#

The 820M’s last supported driver is 425.31 (released 2019). Newer drivers (≥ 430) drop support for Kepler architecture GPUs like the 820M.

  • Download NVIDIA Driver 425.31 (select "Windows 10 64-bit" > "GeForce 800M Series" > "GeForce 820M").
  • Install the driver and restart your PC.

Step 4: Install CUDA Toolkit 10.2#

The 820M supports up to CUDA 10.2 (newer CUDA versions require CC ≥ 3.5). PyTorch 1.7.1 (our target) is compatible with CUDA 10.2.

  • Download CUDA Toolkit 10.2 (select "Windows" > "x86_64" > "10" > "exe (local)").
  • Run the installer, select "Custom (Advanced)" > Check "CUDA" (uncheck "Visual Studio Integration" if not needed).
  • Ensure the installer adds CUDA to your PATH (check "Add CUDA to system PATH" during installation).

Step 5: Verify CUDA Installation#

Confirm CUDA 10.2 is installed:

  • Open Command Prompt and run:
    nvcc --version
    You should see Cuda compilation tools, release 10.2, V10.2.89.

Step 6: Install PyTorch 1.7.1 (Last Supported for CC 2.1)#

PyTorch 1.7.1 is the final version supporting compute capability ≥ 2.0. Install it with CUDA 10.2:

  • Open Command Prompt (Admin) and run:
    pip install torch==1.7.1+cu102 torchvision==0.8.2+cu102 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
    This command forces installation of the CUDA 10.2-compatible PyTorch 1.7.1 wheel.

Step 7: Update PATH Variables (If Needed)#

If nvcc --version fails or PyTorch still can’t detect CUDA, manually add CUDA to your PATH:

  1. Open Control Panel > System > Advanced System Settings > Environment Variables.
  2. Under "System Variables", edit Path and add:
    • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
    • C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp

Verification#

To confirm the fix, test PyTorch’s CUDA detection:

  1. Open Python (via Command Prompt or Anaconda Prompt):
    python
  2. Run the following code:
    import torch
    print("PyTorch Version:", torch.__version__)
    print("CUDA Available:", torch.cuda.is_available())  # Should return True!
    print("CUDA Version:", torch.version.cuda)  # Should show 10.2

If CUDA Available: True, congratulations! The 820M is now detected.

Troubleshooting#

If torch.cuda.is_available() still returns False:

1. Recheck Driver Installation#

  • Ensure you installed NVIDIA Driver 425.31. Newer drivers (e.g., 450+) will not work.

2. Verify CUDA 10.2 Path#

  • Run where nvcc in Command Prompt. It should point to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe.

3. Reinstall PyTorch with Explicit CUDA Flag#

  • Use the exact pip command from Step 6 to avoid accidental CPU-only installs.

4. Check for Conflicting Software#

  • Uninstall other Python environments (e.g., Anaconda, Miniconda) temporarily to rule out path conflicts.

Conclusion#

The NVIDIA GeForce 820M can run PyTorch with CUDA, but only with legacy software: PyTorch 1.7.1 + CUDA 10.2 + NVIDIA Driver 425.31. By following this guide, you’ve bypassed modern compatibility restrictions and enabled GPU acceleration for your 820M.

While performance will be limited (the 820M is a low-end GPU), this setup is ideal for learning and small-scale projects.

References#