A CLI tool to verify and fix AI/ML environment compatibility (Driver <-> CUDA <-> Wheels).
Project description
Env-Doctor
The missing link between your GPU and Python AI libraries
"Why does my PyTorch crash with CUDA errors when I just installed it?"
Because your driver supports CUDA 11.8, but
pip install torchgave you CUDA 12.4 wheels.
Env-Doctor diagnoses and fixes the #1 frustration in GPU computing: mismatched CUDA versions between your NVIDIA driver, system toolkit, cuDNN, and Python libraries.
It takes 5 seconds to find out if your environment is broken - and exactly how to fix it.
Doctor "Check" (Diagnosis)
Features
| Feature | What It Does |
|---|---|
| One-Command Diagnosis | Check compatibility: GPU Driver → CUDA Toolkit → cuDNN → PyTorch/TensorFlow/JAX |
| Safe Install Commands | Get the exact pip install command that works with YOUR driver |
| AI Model Compatibility | Check if LLMs, Diffusion, or Audio models fit on your GPU before downloading |
| WSL2 GPU Support | Validate GPU forwarding, detect driver conflicts within WSL2 env for Windows users |
| Deep CUDA Analysis | Find multiple installations, PATH issues, environment misconfigurations |
| Container Validation | Catch GPU config errors in Dockerfiles before you build |
| CI/CD Ready | JSON output and proper exit codes for automation |
Installation
pip install env-doctor
Or from source:
git clone https://github.com/mitulgarg/env-doctor.git
cd env-doctor
pip install -e .
Usage
Diagnose Your Environment
env-doctor check
Example output:
🩺 ENV-DOCTOR DIAGNOSIS
============================================================
🖥️ Environment: Native Linux
🎮 GPU Driver
✅ NVIDIA Driver: 535.146.02
└─ Max CUDA: 12.2
🔧 CUDA Toolkit
✅ System CUDA: 12.1.1
📦 Python Libraries
✅ torch 2.1.0+cu121
✅ All checks passed!
Get Safe Install Command
env-doctor install torch
⬇️ Run this command to install the SAFE version:
---------------------------------------------------
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
---------------------------------------------------
Check Model Compatibility
env-doctor model llama-3-8b
🤖 Checking: LLAMA-3-8B (8.0B params)
🖥️ Your Hardware: RTX 3090 (24GB)
💾 VRAM Requirements:
✅ FP16: 19.2GB - fits with 4.8GB free
✅ INT4: 4.8GB - fits with 19.2GB free
✅ This model WILL FIT on your GPU!
List all models: env-doctor model --list
Validate Dockerfiles
env-doctor dockerfile
🐳 DOCKERFILE VALIDATION
❌ Line 1: CPU-only base image: python:3.10
Fix: FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
❌ Line 8: PyTorch missing --index-url
Fix: pip install torch --index-url https://download.pytorch.org/whl/cu121
More Commands
| Command | Purpose |
|---|---|
env-doctor check |
Full environment diagnosis |
env-doctor install <lib> |
Safe install command for PyTorch/TensorFlow/JAX |
env-doctor model <name> |
Check model VRAM requirements |
env-doctor cuda-info |
Detailed CUDA toolkit analysis |
env-doctor cudnn-info |
cuDNN library analysis |
env-doctor dockerfile |
Validate Dockerfile |
env-doctor docker-compose |
Validate docker-compose.yml |
env-doctor scan |
Scan for deprecated imports |
env-doctor debug |
Verbose detector output |
CI/CD Integration
# JSON output for scripting
env-doctor check --json
# CI mode with exit codes (0=pass, 1=warn, 2=error)
env-doctor check --ci
GitHub Actions example:
- run: pip install env-doctor
- run: env-doctor check --ci
Documentation
Full documentation: https://mitulgarg.github.io/env-doctor/
Contributing
Contributions welcome! See CONTRIBUTING.md for details.
License
MIT License - see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file env_doctor-0.1.2.tar.gz.
File metadata
- Download URL: env_doctor-0.1.2.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
431c87c8221319048eed3375731a24bed18cf44f24ccb526085c5c9c1b8a9c78
|
|
| MD5 |
36ace78ca89758232ccf696b18219e83
|
|
| BLAKE2b-256 |
fc4e76191e1696aa7f66f9d4b72734a862e7efd4765ba58acaa928ac69d30e31
|
Provenance
The following attestation bundles were made for env_doctor-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on mitulgarg/env-doctor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
env_doctor-0.1.2.tar.gz -
Subject digest:
431c87c8221319048eed3375731a24bed18cf44f24ccb526085c5c9c1b8a9c78 - Sigstore transparency entry: 854479696
- Sigstore integration time:
-
Permalink:
mitulgarg/env-doctor@7717f898190a3efaa0bda04f9f956027ac1beed0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mitulgarg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7717f898190a3efaa0bda04f9f956027ac1beed0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file env_doctor-0.1.2-py3-none-any.whl.
File metadata
- Download URL: env_doctor-0.1.2-py3-none-any.whl
- Upload date:
- Size: 65.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c9ca3c906543fc05fdda0c496e3ed62aaabba10a329238e815c4c0f7382e106
|
|
| MD5 |
7dbf0ca870b7f5f98deb3b27d02cd918
|
|
| BLAKE2b-256 |
5c11c5dbed5f8d215f3c3e81085844613b8bdfdaa6e5708e51546afe118e790e
|
Provenance
The following attestation bundles were made for env_doctor-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on mitulgarg/env-doctor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
env_doctor-0.1.2-py3-none-any.whl -
Subject digest:
5c9ca3c906543fc05fdda0c496e3ed62aaabba10a329238e815c4c0f7382e106 - Sigstore transparency entry: 854479710
- Sigstore integration time:
-
Permalink:
mitulgarg/env-doctor@7717f898190a3efaa0bda04f9f956027ac1beed0 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/mitulgarg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7717f898190a3efaa0bda04f9f956027ac1beed0 -
Trigger Event:
push
-
Statement type: