install
Get the safe install command for GPU libraries that matches your driver.
Usage
Supported Libraries
torch/pytorch- PyTorch with correct CUDA wheelstensorflow- TensorFlow with GPU supportjax- JAX with CUDA support
How It Works
- Detects your NVIDIA driver version
- Determines the maximum CUDA version your driver supports
- Looks up the correct wheel URL for that CUDA version
- Outputs the exact
pip installcommand
Example
Output:
🔍 Detecting your GPU environment...
🎮 GPU Driver: 535.146.02
└─ Max CUDA: 12.2
⬇️ Run this command to install the SAFE version:
---------------------------------------------------
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
---------------------------------------------------
💡 This installs PyTorch built for CUDA 12.1, which is compatible
with your driver (supports up to CUDA 12.2).
Why This Matters
The default pip install torch gives you the latest wheel, which might be built for CUDA 12.4. If your driver only supports CUDA 11.8, you'll get cryptic errors like:
Env-Doctor prevents this by prescribing the correct version for your hardware.
Common Scenarios
Older Driver
$ env-doctor install torch
🎮 GPU Driver: 470.82.01
└─ Max CUDA: 11.4
⬇️ Run this command to install the SAFE version:
---------------------------------------------------
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu113
---------------------------------------------------
No GPU Detected
$ env-doctor install torch
⚠️ No NVIDIA GPU detected
⬇️ Installing CPU-only version:
---------------------------------------------------
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
---------------------------------------------------