check

check is a command for coding agents from mitulgarg/env-doctor. It costs 0 tokens per session (1,748 once invoked), scanned B, original, MIT.

An environment diagnostic command for checking whether a computer’s GPU, drivers, CUDA toolkit, and machine-learning libraries are compatible. CUDA is the software platform commonly used to run calculations on NVIDIA GPUs.

In plain words
What is it for?
Use it to inspect Linux or WSL environments, NVIDIA driver health, CUDA installations, PyTorch, TensorFlow, JAX, and whether PyTorch supports the GPU’s architecture.
Why use it?
It can reveal mismatches that make GPU acceleration fail even when basic tools such as the driver or CUDA compiler appear installed.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mitulgarg/env-doctor/check
Clone the repo
git clone --depth 1 https://github.com/mitulgarg/env-doctor

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for check

README.md
[![agentmods](https://agentmods.dev/badge/commands/mitulgarg/env-doctor/check.svg)](https://agentmods.dev/commands/mitulgarg/env-doctor/check)
Your own site
<a href="https://agentmods.dev/commands/mitulgarg/env-doctor/check"><img src="https://agentmods.dev/badge/commands/mitulgarg/env-doctor/check.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,748 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01748
Opus 5 $0.00000 $0.00874
Sonnet 5 $0.00000 $0.00350
Haiku 4.5 $0.00000 $0.00175

Measured 4d ago against content hash 50127dfe9d72, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

check scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

→ Run: sudo apt remove --purge nvidia-*
docs/commands/check.md · 230 lines

How it starts

The opening of the file, as written. The whole thing — 230 lines — stays where its author put it; the contents beside it link to each section on GitHub.

check

Diagnose your environment for GPU/CUDA compatibility issues.

Usage

env-doctor check

What It Checks

Environment Detection

  • Native Linux: Standard Linux environment
  • WSL1: Detects WSL1 and warns that CUDA is not supported
  • WSL2: Full GPU forwarding validation

GPU Driver

  • Driver version detection via NVML
  • Maximum supported CUDA version
  • Driver health status

System CUDA Toolkit

  • Installation path and version
  • Multiple installation detection
  • PATH and environment configuration

Python Libraries

  • PyTorch, TensorFlow, JAX detection
  • CUDA version each library was compiled for
  • Compatibility with your driver

GPU Compute Capability

Checks whether the installed PyTorch wheel includes compiled kernels for your GPU's SM architecture. This catches a silent failure mode common with new GPU generations: everything looks healthy (nvidia-smi, nvcc, driver all pass) but CUDA may not work correctly because the stable PyTorch wheel doesn't include kernels for the new architecture.

env-doctor probes torch.cuda.is_available() at runtime and distinguishes two failure modes:

  • Hard failureis_available() returns False. The GPU cannot be used at all.
  • Soft failureis_available() returns True via NVIDIA's driver-level PTX JIT, but complex CUDA ops may silently degrade or fail.

Other behaviours:

  • Reads GPU compute capability from the driver (e.g. 12.0 for Blackwell RTX 5070)
  • Reads the compiled SM list from torch.cuda.get_arch_list()
  • Handles PTX forward compatibility — compute_90 in the arch list covers newer SMs via JIT compilation
  • On mismatch, prints the exact nightly install command to fix it

Library Conflicts

Detects "Frankenstein" environments where:

  • PyTorch is built for CUDA 12.4 but driver only supports 11.8
  • Multiple libraries compiled for different CUDA versions
  • System toolkit doesn't match library requirements

Example Output

🩺 ENV-DOCTOR DIAGNOSIS
============================================================

🖥️  Environment: WSL2 (GPU forwarding enabled)

🎮 GPU Driver
   ✅ NVIDIA Driver: 535.146.02
   └─ Max CUDA: 12.2

🔧 CUDA Toolkit
   ✅ System CUDA: 12.1.1
   └─ Path: /usr/local/cuda-12.1

📦 Python Libraries
   ✅ torch 2.1.0+cu121
   └─ CUDA 12.1 ✓ (compatible with driver)

✅ All checks passed!

Read the full file on GitHub · 230 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 230 lines · 0 tokens per session scan B 50127dfe9d72

Subscribe to this mod's changes

check is a command published in the GitHub repository mitulgarg/env-doctor (172 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,748 tokens. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.